Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×
Изменения рейтингов за последние раунды временно удалены. Скоро они будут возвращены. ×

Блог пользователя Negationist

Автор Negationist, история, 47 часов назад, По-английски

In the editorial, they use prefix sums to find the MEXs, but we can actually calculate the final MEX of the subsegments directly. This is based on the fact that if an element is in the array, there MUST be a subsegment that does NOT have it as the MEX. Thus, the final MEX(for all subsegments) must be just the MEX of the original array. With this knowledge we can simply find the first subsegment with that MEX as the MEX. From there, we look for one more subsegment with this as the MEX, if found, we are done. If not, we know it must be impossible. Please note this is my first real blog, let me know if I did something wrong.

Code: https://mirror.codeforces.com/contest/1935/submission/282863993

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор Negationist, история, 8 дней назад, По-английски

On many problems, I think of the solution very quickly but often spend a long time fixing and debugging the code to do what I want. For https://mirror.codeforces.com/problemset/problem/1973/B, I thought of a sliding window technique to find all windows that satisfy the or condition which is O(n). Yet, it took me like an hour and multiple failed submissions to get an AC. Right now, it feels like I have the "brains"(ingenuity) but not the "brawn"(implementation skills) right now. Furthermore, when I'm spending more time debugging than constructing it feels like I'm somewhat wasting my time(also its not very fun lol). What should I do?

P.S: I know someone is going to comment on how long I have been doing cp. Yes, I have only being doing cp for 1.5 months, and yes I know my implementation will naturally get better over time. Still, I'm looking for any advice BESIDES that. Thank you.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +2
  • Проголосовать: не нравится