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:
<blockquote> </p>
Separate what your code does from what you think it should do. <blockquote>
Conceptualize an approach, then put it aside. Implement exactly Separate what your code does from what you think it should do.
what the approach says to do (not what you think it should say). Conceptualize an approach, then put it aside. Implement exactly what
If the approach left something out, the approach says to do (not what you think it should say). If the
<i approach left something out,
>step away from implementing, reconsider the approach, then <i
resume implementing</i >step away from implementing, reconsider the approach, then resume
>. <b>Never reconsider and alter your strategy while coding.</b> implementing</i
</blockquote> >. <b>Never reconsider and alter your strategy while coding.</b>
</div> </blockquote>
<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.
<blockquote> </p>
Take problems seriously or you're wasting your time. <blockquote>
</blockquote> Take problems seriously or you're wasting your time.
. I was also continually nervous/pressuring myself and thought about </blockquote>
<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.
<blockquote>Pressure ruins performance.</blockquote> </p>
</div> <blockquote>Pressure ruins performance.</blockquote>
<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,70 +607,68 @@
<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> A: math intuition building. Jumped to assuming the problem
A: math intuition building. Jumped to assuming the problem statement but it was much simpler.
statement but it was much simpler. <b>Answer the problem only.</b>
<b>Answer the problem only.</b> </li>
</li> <li>
<li> B: textbook simple problem that I struggle to mathematically
B: textbook simple problem that I struggle to mathematically quantify being distracted by many components. In retrospect, I
quantify being distracted by many components. In retrospect, I should interpret the problem simply like:
should interpret the problem simply like: <blockquote>
<blockquote> 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 right
I also just plug in \(ceil\) and \(floor\) until I find the answer (I'm not lying). Instead, note that for
right 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 k\].
\[\frac{s}{2}>k\leftrightarrow\lfloor\frac{s-1}{2}\rfloor\geq This simply "edges out" the fractional term to line up cleanly
k\]. This simply "edges out" the fractional term to line up with the divisor.
cleanly 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 parts.
D: took me a while because I was distracted with the moving Specifically, I forgot that I could choose the permutation and
parts. Specifically, I forgot that I could choose the that the question was merely asking to pick the largest/smallest
permutation and that the question was merely asking to pick the numbers on \(x\)/\(y\) slots respectively. End solution was
largest/smallest numbers on \(x\)/\(y\) slots respectively. End expressive and elegant.
solution was expressive and elegant. <b
<b >Express the question and reframe the constraints in simple but
>Express the question and reframe the constraints in simple accurate terms</b
but accurate terms</b >.
>. </li>
</li> <li>
<li> E: Black-boxed a lazy segment tree (with the help of AI, I must
E: Black-boxed a lazy segment tree (with the help of AI, I must admit&mdash;I need to make a template).
admit&mdash;I need to make a template). <blockquote>
<blockquote> <i
<i >Everything I did here was wrong and this problem showed an
>Everything I did here was wrong and this problem showed an embarrassingly fundamental flaw in my practice strategy.</i
embarrassingly fundamental flaw in my practice strategy.</i >
> </blockquote>
</blockquote> Namely, I should divide up practice time into:
Namely, I should divide up practice time into: <ol>
<ol> <li>Contests, emphasizing speed and implementation</li>
<li>Contests, emphasizing speed and implementation</li> <li>
<li> Single problems, emphasizing specific learning objectives
Single problems, emphasizing specific learning objectives </li>
</li> </ol>
</ol> </li>
</li> 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 in
but also cemented in unrealistic practice (I would never do this a real contest) and worsened my virtual contest performance. As for
in a real contest) and worsened my virtual contest performance. As the prefix-XOR solution, focusing on just one/zero corresponding
for the prefix-XOR solution, focusing on just one/zero elements and
corresponding 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,55 +729,52 @@
<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 paths
A: Solved a much harder problem related to majority element on tree&mdash;realized the solution after a minute.
paths 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 of divisibility and odd numbers.
of divisibility and odd numbers. <b
<b >Math is still a weakness. Take simpler approaches to complex
>Math is still a weakness. Take simpler approaches to complex constraints, such as considering parity.</b
constraints, such as considering parity.</b >
> </li>
</li> <li>
<li> Went off of gut instinct that it is always possible to form the
Went off of gut instinct that it is always possible to form the given \(x\) if encompassed in the range of numbers.
given \(x\) if encompassed in the range of numbers. <b
<b >Failed to prove this mathematical validity but had fair
>Failed to prove this mathematical validity but had fair intuition</b
intuition</b >
> (i.e. just "take off one" if too big/small). This is acceptable,
(i.e. just "take off one" if too big/small). This is acceptable, though not perfect.
though not perfect. </li>
</li> <li>
<li> D: cooked. Solved E first and had mentally given up by this point.
D: cooked. Solved E first and had mentally given up by this <b
point. >If you've given up, just stop trying and take a break/do
<b something else. You're wasting your time.</b
>If you've given up, just stop trying and take a break/do >
something else. You're wasting your time.</b </li>
> <li>
</li> E: incredibly easy with segtree. Realized the lower bound/walk
<li> solution after 2-3 minutes. Binary search indexing can be improved
E: incredibly easy with segtree. Realized the lower bound/walk (i.e. which pointer to return?) as well as realizing one binary
solution after 2-3 minutes. Binary search indexing can be search is necessary across both arrays. Good mathematical
improved (i.e. which pointer to return?) as well as realizing deduction to realize relationship between input arrays. Revisit
one binary search is necessary across both arrays. Good sparse table + simpler solution&mdash;<i
mathematical deduction to realize relationship between input >don't be content with an advanced solution when a
arrays. Revisit sparse table + simpler solution&mdash;<i simpler/elegant idea also suffices</i
>don't be content with an advanced solution when a >.
simpler/elegant idea also suffices</i </li>
>. </ul>
</li>
</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,31 +1312,28 @@
<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. Driven by my admiration for competitive programmers, love of
Driven by my admiration for competitive programmers, love of challenge, and desire for a decent new-grad job, I'm excited to
challenge, and desire for a decent new-grad job, I'm excited to start putting in the work.
start putting in the work. </p>
</p> <p>
<p> This webpage will be an archive of everything related to this
This webpage will be an archive of everything related to this process, including my practice strategies, setup, shortcomings,
process, including my practice strategies, setup, shortcomings, logs, and more. For now, I'll be practicing on
logs, and more. For now, I'll be practicing on <a href="https://codeforces.com" target="_blank">CodeForces</a>
<a href="https://codeforces.com" target="_blank">CodeForces</a> (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 the
>) and <a href="https://cses.fi" target="_blank">CSES</a>, using <a href="https://cses.fi/book/book.pdf" target="_blank"
the >CP Handbook</a
<a href="https://cses.fi/book/book.pdf" target="_blank" >
>CP Handbook</a and browsing by related problem tags with ever-increasing
> difficulty.
and browsing by related problem tags with ever-increasing </p>
difficulty.
</p>
</div>
</article> </article>
</div> </div>
</main> </main>