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

Автор UzUmAk1_NaRuTo, история, 3 года назад, По-английски

Can someone help me, I am facing this(Title) runtime error while submitting my solution to the problem 1822F - Gardening Friends Link to my submission-[submission:206155993]. The solution is working on my VS Code and various online IDEs. Thanks.

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

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Clion says that in line: int x1 = G[s][ind]; you have s = 0, ind = -1.

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

I have run your code on custom invocation and I wanted to tell you where the error is. The error is in variable x2 (at line 179), it's value is like 2882432546906025180 if you run it on test case 2 and output x2 before saying dp[x2] (which will of course go out of bounds). When your own IDE is giving correct and CF is not then run on Custom Invocation to check where is the fault.

Just a suggestion that, kindly write your codes such that they are more readable and understandable, look at other people codes (after getting accepted or lot of hard work) to learn how to improve implementation. I have got it accepted just now, you can see my code, and you can ask me if you don't understand something.

My Code : 206168140.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

There is some undefined behavior in your code

Hint