feat(cp-log): 1020

This commit is contained in:
Barrett Ruth 2025-04-25 11:31:39 -04:00
parent 7a9213bb9d
commit 817985e42a

View file

@ -24,6 +24,24 @@
<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/2106" target="_blank"
>1020 (div. 3)</a
>
<span class="post-meta">
<time datetime="2025-04-25">04/25/2025</time>
</span>
</h2>
<p>
Unfortunately, the moment this contest started I'd already given up.
In contest my main weakness is that I just rush and panic. If my
next contest results in me wasting 2 hours I'm going to take a step
back and just do intentional practice.
</p>
<p>
I learned nothing. I didn't read problem statements nor prove my
answers.
</p>
<h2> <h2>
<a href="https://codeforces.com/contest/2008" target="_blank" <a href="https://codeforces.com/contest/2008" target="_blank"
>970 (div. 3)</a >970 (div. 3)</a
@ -32,12 +50,12 @@
<time datetime="2025-04-21">04/21/2025</time> <time datetime="2025-04-21">04/21/2025</time>
</span> </span>
</h2> </h2>
<div> <p>
~1450 performance. OK contest, not very exhilirating. Hedonistic ~1450 performance. OK contest, not very exhilirating. Hedonistic
treadmill at work with me solving A-F on Div. 3 when a 2 weeks ago I treadmill at work with me solving A-F on Div. 3 when a 2 weeks ago I
couldn't even do that on Div. 4. Definitely need to upsolve this to couldn't even do that on Div. 4. Definitely need to upsolve this to
improve my ability at expressing ideas simply. improve my ability at expressing ideas simply.
</div> </p>
<blockquote> <blockquote>
From now on, prioritize actually <i>learning</i> and problem-solving From now on, prioritize actually <i>learning</i> and problem-solving
in a pressurized format (we all die eventually, everything is under in a pressurized format (we all die eventually, everything is under
@ -97,9 +115,9 @@
<time datetime="2025-04-16">04/16/2025</time> <time datetime="2025-04-16">04/16/2025</time>
</span> </span>
</h2> </h2>
<div> <p>
~1300 performance. Consistently finishing E, getting F occasionally. ~1300 performance. Consistently finishing E, getting F occasionally.
</div> </p>
<ol> <ol>
<li> <li>
B: took me way too long because I just wanted to code. Wasted 5 B: took me way too long because I just wanted to code. Wasted 5
@ -162,11 +180,11 @@
<time datetime="2025-04-14">04/14/2025</time> <time datetime="2025-04-14">04/14/2025</time>
</span> </span>
</h2> </h2>
<div> <p>
Decent contest. Lost focus near the end and was not paying attention Decent contest. Lost focus near the end and was not paying attention
at the start (I was working on my makefile). This is a telltale sign at the start (I was working on my makefile). This is a telltale sign
that Div. 4 is a bit too easy. F & G should've been lightwork. that Div. 4 is a bit too easy. F & G should've been lightwork.
</div> </p>
<ol> <ol>
<li> <li>
D: submitted what I knew to be incorrect. Can't account for D: submitted what I knew to be incorrect. Can't account for
@ -206,23 +224,23 @@
<time datetime="2025-04-10">04/10/2025</time> <time datetime="2025-04-10">04/10/2025</time>
</span> </span>
</h2> </h2>
<div> <p>
Improvement is marginal. My desire for rating is unquenchable Improvement is marginal. My desire for rating is unquenchable
(joke). Really, though, I'm improving slower than I like. 1400 (joke). Really, though, I'm improving slower than I like. 1400
performance, my best yet&mdash;I'll do one more Div. 4 then I need performance, my best yet&mdash;I'll do one more Div. 4 then I need
to upgrade to Div. {2,3}. I think the most core realization I made to upgrade to Div. {2,3}. I think the most core realization I made
after this contest was: after this contest was:
</p>
<blockquote> <blockquote>
Separate what your code does from what you think it should do. Separate what your code does from what you think it should do.
Conceptualize an approach, then put it aside. Implement exactly Conceptualize an approach, then put it aside. Implement exactly what
what the approach says to do (not what you think it should say). the approach says to do (not what you think it should say). If the
If the approach left something out, approach left something out,
<i <i
>step away from implementing, reconsider the approach, then >step away from implementing, reconsider the approach, then resume
resume implementing</i implementing</i
>. <b>Never reconsider and alter your strategy while coding.</b> >. <b>Never reconsider and alter your strategy while coding.</b>
</blockquote> </blockquote>
</div>
<ol> <ol>
<li> <li>
B: realized parity-based removal immediately. Still, I once again B: realized parity-based removal immediately. Still, I once again
@ -307,11 +325,11 @@
<time datetime="2025-04-09">04/09/2025</time> <time datetime="2025-04-09">04/09/2025</time>
</span> </span>
</h2> </h2>
<div> <p>
Defeating. My speed is improving but I completely wasted my focus. Defeating. My speed is improving but I completely wasted my focus.
Div. 4 is too easy for me to take seriously now. This itself, Div. 4 is too easy for me to take seriously now. This itself,
though, is a problem with discipline. though, is a problem with discipline.
</div> </p>
<blockquote> <blockquote>
I only practice for 2 hours a day. There's no point in practicing I only practice for 2 hours a day. There's no point in practicing
problems and not trying&mdash;just go do something else. problems and not trying&mdash;just go do something else.
@ -365,10 +383,10 @@
<time datetime="2025-04-08">04/08/2025</time> <time datetime="2025-04-08">04/08/2025</time>
</span> </span>
</h2> </h2>
<div> <p>
Horrendous competition but I refrain from cringing for the sake of Horrendous competition but I refrain from cringing for the sake of
improvement. improvement.
</div> </p>
<ul> <ul>
<li>A: trivial</li> <li>A: trivial</li>
<li> <li>
@ -439,17 +457,19 @@
<time datetime="2025-04-03">04/03/2025</time> <time datetime="2025-04-03">04/03/2025</time>
</span> </span>
</h2> </h2>
<div> <p>
Placed top 2000 but did not learn much. Was distracted (thinking Placed top 2000 but did not learn much. Was distracted (thinking
about writing this post itself) and was not taking the problems about writing this post itself) and was not taking the problems
seriously because they were not that challenging in the first place. seriously because they were not that challenging in the first place.
</p>
<blockquote> <blockquote>
Take problems seriously or you're wasting your time. Take problems seriously or you're wasting your time.
</blockquote> </blockquote>
. I was also continually nervous/pressuring myself and thought about <p>
I was also continually nervous/pressuring myself and thought about
my own thought process. The time for analysis is after, not during. my own thought process. The time for analysis is after, not during.
</p>
<blockquote>Pressure ruins performance.</blockquote> <blockquote>Pressure ruins performance.</blockquote>
</div>
<ul> <ul>
<li> <li>
A: couldn't come up with the extensible solution and checked all A: couldn't come up with the extensible solution and checked all
@ -495,7 +515,7 @@
<time datetime="2025-03-28">03/28/2025</time> <time datetime="2025-03-28">03/28/2025</time>
</span> </span>
</h2> </h2>
<div> <p>
Div. 4 to practice implemenation skills + mathematical observations Div. 4 to practice implemenation skills + mathematical observations
thanks to thanks to
<a <a
@ -503,7 +523,7 @@
target="_blank" target="_blank"
>Paul Zeitz</a >Paul Zeitz</a
>. From now on, I will only note useful problems. >. From now on, I will only note useful problems.
</div> </p>
<ul> <ul>
<li> <li>
B: typo, costing a few minutes. Go slower. Declare variables. B: typo, costing a few minutes. Go slower. Declare variables.
@ -587,7 +607,6 @@
<time datetime="2025-03-26">03/26/2025</time> <time datetime="2025-03-26">03/26/2025</time>
</span> </span>
</h2> </h2>
<div>
<p>Decent.</p> <p>Decent.</p>
<ul> <ul>
<li> <li>
@ -603,23 +622,23 @@
Each trap has a known time I must return by. The answer is Each trap has a known time I must return by. The answer is
therefore the minimum of these. therefore the minimum of these.
</blockquote> </blockquote>
I also just plug in \(ceil\) and \(floor\) until I find the I also just plug in \(ceil\) and \(floor\) until I find the right
right answer (I'm not lying). Instead, note that for answer (I'm not lying). Instead, note that for
\(s,k\in\mathbb{Z}\), \(s,k\in\mathbb{Z}\),
\[\frac{s}{2}>k\leftrightarrow\lfloor\frac{s-1}{2}\rfloor\geq \[\frac{s}{2}>k\leftrightarrow\lfloor\frac{s-1}{2}\rfloor\geq k\].
k\]. This simply "edges out" the fractional term to line up This simply "edges out" the fractional term to line up cleanly
cleanly with the divisor. with the divisor.
</li> </li>
<li>C: cooked. <b>Practice number theory.</b></li> <li>C: cooked. <b>Practice number theory.</b></li>
<li> <li>
D: took me a while because I was distracted with the moving D: took me a while because I was distracted with the moving parts.
parts. Specifically, I forgot that I could choose the Specifically, I forgot that I could choose the permutation and
permutation and that the question was merely asking to pick the that the question was merely asking to pick the largest/smallest
largest/smallest numbers on \(x\)/\(y\) slots respectively. End numbers on \(x\)/\(y\) slots respectively. End solution was
solution was expressive and elegant. expressive and elegant.
<b <b
>Express the question and reframe the constraints in simple >Express the question and reframe the constraints in simple but
but accurate terms</b accurate terms</b
>. >.
</li> </li>
<li> <li>
@ -642,15 +661,14 @@
In this problem, I immediately saw the application of the lazy In this problem, I immediately saw the application of the lazy
segment tree but decided to hold off on it, failing to find the segment tree but decided to hold off on it, failing to find the
simpler prefix-XOR solution. Therefore, I not only wasted my time, simpler prefix-XOR solution. Therefore, I not only wasted my time,
but also cemented in unrealistic practice (I would never do this but also cemented in unrealistic practice (I would never do this in
in a real contest) and worsened my virtual contest performance. As a real contest) and worsened my virtual contest performance. As for
for the prefix-XOR solution, focusing on just one/zero the prefix-XOR solution, focusing on just one/zero corresponding
corresponding elements and elements and
<b>walking through small examples</b> <b>walking through small examples</b>
(i.e. "what happens when \(l=r\)?") would've help me pick up the (i.e. "what happens when \(l=r\)?") would've help me pick up the
pattern. pattern.
</ul> </ul>
</div>
<h2> <h2>
<a href="https://codeforces.com/contest/2091" target="_blank" <a href="https://codeforces.com/contest/2091" target="_blank"
>1013 (div. 3)</a >1013 (div. 3)</a
@ -711,15 +729,14 @@
<time datetime="2025-03-22">03/22/2025</time> <time datetime="2025-03-22">03/22/2025</time>
</span> </span>
</h2> </h2>
<div>
<p> <p>
Solved in a coffee shop. Used AI for smaller things (otherwise I'd Solved in a coffee shop. Used AI for smaller things (otherwise I'd
have no idea). have no idea).
</p> </p>
<ul> <ul>
<li> <li>
A: Solved a much harder problem related to majority element A: Solved a much harder problem related to majority element paths
paths on tree&mdash;realized the solution after a minute. on tree&mdash;realized the solution after a minute.
</li> </li>
<li> <li>
B: was confused for about 7 minutes but realized some properties B: was confused for about 7 minutes but realized some properties
@ -740,8 +757,7 @@
though not perfect. though not perfect.
</li> </li>
<li> <li>
D: cooked. Solved E first and had mentally given up by this D: cooked. Solved E first and had mentally given up by this point.
point.
<b <b
>If you've given up, just stop trying and take a break/do >If you've given up, just stop trying and take a break/do
something else. You're wasting your time.</b something else. You're wasting your time.</b
@ -749,17 +765,16 @@
</li> </li>
<li> <li>
E: incredibly easy with segtree. Realized the lower bound/walk E: incredibly easy with segtree. Realized the lower bound/walk
solution after 2-3 minutes. Binary search indexing can be solution after 2-3 minutes. Binary search indexing can be improved
improved (i.e. which pointer to return?) as well as realizing (i.e. which pointer to return?) as well as realizing one binary
one binary search is necessary across both arrays. Good search is necessary across both arrays. Good mathematical
mathematical deduction to realize relationship between input deduction to realize relationship between input arrays. Revisit
arrays. Revisit sparse table + simpler solution&mdash;<i sparse table + simpler solution&mdash;<i
>don't be content with an advanced solution when a >don't be content with an advanced solution when a
simpler/elegant idea also suffices</i simpler/elegant idea also suffices</i
>. >.
</li> </li>
</ul> </ul>
</div>
<h2> <h2>
<a href="https://codeforces.com/contest/1857/" target="_blank" <a href="https://codeforces.com/contest/1857/" target="_blank"
>891 (div. 3)</a >891 (div. 3)</a
@ -1297,7 +1312,6 @@
<time datetime="2025-02-12">02/12/2025</time> <time datetime="2025-02-12">02/12/2025</time>
</span> </span>
</h2> </h2>
<div>
<p> <p>
This marks the (true) beginning of my competitive programming This marks the (true) beginning of my competitive programming
journey. By "true" I mean intentional, focused, daily practice. journey. By "true" I mean intentional, focused, daily practice.
@ -1313,15 +1327,13 @@
(account (account
<a href="https://codeforces.com/profile/sigpipe" target="_blank" <a href="https://codeforces.com/profile/sigpipe" target="_blank"
>sigpipe</a >sigpipe</a
>) and <a href="https://cses.fi" target="_blank">CSES</a>, using >) and <a href="https://cses.fi" target="_blank">CSES</a>, using the
the
<a href="https://cses.fi/book/book.pdf" target="_blank" <a href="https://cses.fi/book/book.pdf" target="_blank"
>CP Handbook</a >CP Handbook</a
> >
and browsing by related problem tags with ever-increasing and browsing by related problem tags with ever-increasing
difficulty. difficulty.
</p> </p>
</div>
</article> </article>
</div> </div>
</main> </main>