Solved 1610C – Keshi Is Throwing a Party 🎉
❌ Mistake: I was only checking the mid-th friend’s (a,b)
✅ Fix: I now iterate from poorest to richest, counting valid friends — if count reaches k, it’s possible.
Binary Search + Greedy finally clicked → got AC 💪🔥
#whatididtoday
✅ Solved CSES Array Division 🔥
🧠 Key Learnings:
Debugged with while (l <= h) ➝ fixed off-by-1 bug (ans was 1000, my O/P was 1001 😅)
Realized we need subparts ≤ k (not == k) when checking if x can be the max subarr sum
Code: 🔗https://t.co/SRoIKoJTZd
today i solved Lc 780 and
atcoder • abc241_d - Sequence Query-map val with idx
• cses_1161 - Stick Divisions - join like huffman
"LC 780 — instead of subtracting many times, just do tx %= ty / ty %= tx; % compresses n subtractions into one shot ⚡"
Today’s progress 🚀
✅ Solved 2 Qs:
1️⃣ CSES: Multiplication Table → BS on range [1, n²], check mid via count ≤ mid vs n(n+1)/2.
2️⃣ CF C. Chat Ban: BS on [1, 2k–1], calc total emotes in m its like prefix sum or sum of first m natural nums , adjust low/high.