feat(codeforces): 937 a-f
This commit is contained in:
parent
07a7b7ce71
commit
42a6d4ec47
1 changed files with 75 additions and 5 deletions
|
|
@ -24,6 +24,71 @@
|
||||||
<h1 class="post-title">competitive programming log</h1>
|
<h1 class="post-title">competitive programming log</h1>
|
||||||
</header>
|
</header>
|
||||||
<article class="post-article">
|
<article class="post-article">
|
||||||
|
<h2>
|
||||||
|
<a href="https://codeforces.com/contest/2094" target="_blank"
|
||||||
|
>937 (div. 4)</a
|
||||||
|
>
|
||||||
|
<span class="post-meta">
|
||||||
|
<time datetime="2025-04-16">04/16/2025</time>
|
||||||
|
</span>
|
||||||
|
</h2>
|
||||||
|
<div>
|
||||||
|
~1300 performance. Consistently finishing E, getting F occasionally.
|
||||||
|
</div>
|
||||||
|
<ol>
|
||||||
|
<li>
|
||||||
|
B: took me way too long because I just wanted to code. Wasted 5
|
||||||
|
minutes when I know better—patience and a formula got me
|
||||||
|
there in 30 seconds.
|
||||||
|
</li>
|
||||||
|
<blockquote>
|
||||||
|
Impatience is holding me back. Lack of discipline and focus is
|
||||||
|
holding me back. It doesn't just harm my <s>ranking</s>
|
||||||
|
problem-solving ability but it
|
||||||
|
<i>prevents me from improving</i>.
|
||||||
|
</blockquote>
|
||||||
|
<li>C: submitted without rigorously checking all edge cases.</li>
|
||||||
|
<li>
|
||||||
|
D: misunderstood the problem statement twice. Polya and Zeitz both
|
||||||
|
advise to fully understand exactly what the problem statement is
|
||||||
|
asking, whether through direct analysis or examples. Then, I
|
||||||
|
messed up the brute force. However, I did notice that raw
|
||||||
|
recursion would not TLE based on the fact that each number can be
|
||||||
|
divided in only a few ways.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
E: I knew a number didn't have that many divisors but the
|
||||||
|
implementation took me too long.
|
||||||
|
<b
|
||||||
|
>Pay closer attention to the constraints and just solve the
|
||||||
|
problem.</b
|
||||||
|
>. Spend a bit more time on implementation,
|
||||||
|
<i>even if you know a way that works</i>. Here, I knew an approach
|
||||||
|
to code but it was easily error-prone.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Immediately came up with the idea but was unable to express it in
|
||||||
|
code. This means I did not fully understand the problem, namely
|
||||||
|
with some core mistakes:
|
||||||
|
<ol>
|
||||||
|
<li>The tree it not necessarily binary</li>
|
||||||
|
<li>
|
||||||
|
C's cannot have children, so tracking depth/available nodes to
|
||||||
|
fill per level is crucial
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Coming up with the expression \(a=c+1\) (and ensuring the
|
||||||
|
input conforms to that) is a lot easier than cusotm coding
|
||||||
|
logic to ensure levels are filled out properly. The core
|
||||||
|
problem is that I lack the mathematical prowess to be certain
|
||||||
|
of what exactly I need to check after I make that assertion
|
||||||
|
and why. In this case, it means that the number of C's is
|
||||||
|
appropriate, <i>so I never even need to check them</i>—I
|
||||||
|
just need to make sure that the rest of the solution is valid.
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
<h2>
|
<h2>
|
||||||
<a href="https://codeforces.com/contest/2094" target="_blank"
|
<a href="https://codeforces.com/contest/2094" target="_blank"
|
||||||
>1017 (div. 4)</a
|
>1017 (div. 4)</a
|
||||||
|
|
@ -715,7 +780,8 @@
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
<h2>cses (range queries, sorting and searching)
|
<h2>
|
||||||
|
cses (range queries, sorting and searching)
|
||||||
<span class="post-meta">
|
<span class="post-meta">
|
||||||
<time datetime="2025-03-01">03/01/2025</time>
|
<time datetime="2025-03-01">03/01/2025</time>
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -833,7 +899,8 @@
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
<h2>sorting and searching
|
<h2>
|
||||||
|
sorting and searching
|
||||||
<span class="post-meta">
|
<span class="post-meta">
|
||||||
<time datetime="2025-02-24">02/24/2025</time>
|
<time datetime="2025-02-24">02/24/2025</time>
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -897,7 +964,8 @@
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
<h2>more cses
|
<h2>
|
||||||
|
more cses
|
||||||
<span class="post-meta">
|
<span class="post-meta">
|
||||||
<time datetime="2025-02-22">02/22/2025</time>
|
<time datetime="2025-02-22">02/22/2025</time>
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -931,7 +999,8 @@
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
<h2>cses
|
<h2>
|
||||||
|
cses
|
||||||
<span class="post-meta">
|
<span class="post-meta">
|
||||||
<time datetime="2025-02-21">02/21/2025</time>
|
<time datetime="2025-02-21">02/21/2025</time>
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -1157,7 +1226,8 @@
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
<h2>the beginning
|
<h2>
|
||||||
|
the beginning
|
||||||
<span class="post-meta">
|
<span class="post-meta">
|
||||||
<time datetime="2025-02-12">02/12/2025</time>
|
<time datetime="2025-02-12">02/12/2025</time>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue