[Bug?] Different verdict for same code with different language

Revision en1, by Hisiri, 2024-05-04 13:23:03

I was solving the [problem:https://mirror.codeforces.com/contest/1942/problem/H], but some strange things happened.

At the beginning, I got a RE in testcase 70, I thought it may be some memory problem in my code, so I use the variable is_special to locate it. But it doesn't work, so I tried to sumbit the same code in another language, it got accepted!

C++20: AC code

C++17: RE code

You may think that there must be some undefined behaviors in my code, but actually I tried to hack at the front of the code, it got different verdicts too!

C++20: AC code

C++17: TLE code

And the strangest thing is that the flag is_special is about the data input, theoretically it shouldn't be different even though with different language. It really confused me, can someone tell me what happened?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Hisiri 2024-05-04 13:27:34 19
en1 English Hisiri 2024-05-04 13:23:03 1104 Initial revision (published)