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

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

Hello all,

I'm solving Problem using dfs and dp.

Here is the accepted solution https://cses.fi/paste/0ce952848211df07881291/ logic above is to store u->v to store the child who gives best result

Here is the incorrect solution https://cses.fi/paste/7036dbe274524616881807/ logic above is to store u->v to store parent and backtrack to parent

since the test cases are long i can't debug the code myself.

the code start from line 381.

Please anyone can help me why it is giving wrong output.

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

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

Автор m_nigam01, история, 6 месяцев назад, По-английски

Hello, my basic thinking is if I can connect all elements in x iterations. then x+1, x+2... can be ignored.

https://codeforces.com/contest/1830/submission/234754662

https://codeforces.com/contest/1830/submission/234753813

This is my submission in python and c++ one I've converted using help from gpt.

Thank you for reply.

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

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

Автор m_nigam01, история, 6 месяцев назад, По-английски

Hello, https://codeforces.com/contest/1843/submission/233813396

I am not able to figure out why I'm getting runtime error. If anyone can help what is the possible cause of this.

Thank you

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

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

Автор m_nigam01, история, 6 месяцев назад, По-английски

Hello all,

I have been doing questions for a while now. I watched some youtube guy and he told to practice harder question instead of grinding simpler ones. I have been doing it but it's hard I give 45 minutes to 1200 -1300 level questions but couldn't come up with solutions. Even I code some solution i get wrong answer on some 97th or some test case i couldn't see. I can use stress testing but writing brute force solution every third question is pointless. I am using cfTracker as well currently i'm solved 73 question from (1200-1300) range out of those 38 is in again do tracker (couldn't come up with solution, made reading error, etc).

I am 26 years old and sometimes i think it would be better if i started earlier. I generally look at other people code who coded it during contest to see how i could have approached the solution but these guys are master or expert. Sometimes i have no clue what they are trying to do. I can see the code but couldn't understand why they used something or how something will be used later if i declare some variable. Since <1400 level question are generally involve some observation or constructive algorithms and i am struggling to solve even those, I get discouraged.

Thanks for listening to my rant. I will keep to trying even it is tough for now.

If you have any points on anything much appreciated especially for this one (i get wrong answer on some 97th or some test case).

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

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

Автор m_nigam01, история, 11 месяцев назад, По-английски

I am trying to solve my rank that is close to 1100 +200 questions. I have tried 3 questions, but I'm stuck at something. Like in
https://codeforces.com/problemset/problem/1839/C . Here if last digit is 1 no solution exist. How can I come up with this. Also in this question https://codeforces.com/problemset/problem/1838/C . If we change the order of rows, we can achieve what the question is asking us. For previous question I used 1 hr to think of backtracking and that also i wasn't even to solve given my implementation sucks for complex topic like backtracking. Is there a way to improve my intuition. Do I need to solve more questions to get better at it?

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

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

Автор m_nigam01, история, 23 месяца назад, По-английски

Hello, Codeforces!

I am solving this problem https://codeforces.com/contest/1665/problem/B

But I'm getting TLE on test case 13. I don't think there should be any TLE. Please look at my code and guide me what's wrong with my thought process. https://pastebin.com/EmhQpghv

I also optimized my code to get rid of inner while loop https://pastebin.com/5800fc8C But still get TLE on testcase 13.

Thanks for any help or suggestion!

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

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