Weird non-determinism in 2197E1 (Interactive Graph)↵
===================================================↵
↵
While solving 2197E1 (Interactive Graph – Simple Version) in the recent Div 2, I ran into something really confusing, the same logic gave both AC and WA depending on tiny, irrelevant code changes.↵
↵
I had multiple submissions within minutes:↵
↵
Some Accepted, some WA on test 8 / 9 / 20 / 21 / 22 / 23↵
↵
No logic changes. Same idea. Same queries.↵
↵
The strangest example↵
↵
This version ACs:↵
↵
if (q == -1) {↵
return;↵
}↵
↵
↵
This version WAs:↵
↵
if (q == -2) {↵
return;↵
}↵
Logically, if I'm getting accepted, both branches are dead code. ↵
↵
Either the checker is non deterministic or there's some UB shenanigans going on. ↵
↵
Links to submissions↵
↵
[submission:362583126] ↵
WA↵
↵
[submission:362583031] ↵
AC↵
↵
[user:Darsh_Jain,2026-02-12] also tried testing it, and the following two submissions↵
↵
[submission:362582232]↵
WA↵
↵
[submission:362581962]↵
AC↵
↵
And the difference between the two is only that we have added a comment in the first one!↵
↵
[user:FelixArg,2026-02-12] and [user:sevlll777,2026-02-12] pls help
===================================================↵
↵
While solving 2197E1 (Interactive Graph – Simple Version) in the recent Div 2, I ran into something really confusing, the same logic gave both AC and WA depending on tiny, irrelevant code changes.↵
↵
I had multiple submissions within minutes:↵
↵
Some Accepted, some WA on test 8 / 9 / 20 / 21 / 22 / 23↵
↵
No logic changes. Same idea. Same queries.↵
↵
The strangest example↵
↵
This version ACs:↵
↵
if (q == -1) {↵
return;↵
}↵
↵
↵
This version WAs:↵
↵
if (q == -2) {↵
return;↵
}↵
Logically, if I'm getting accepted, both branches are dead code. ↵
↵
Either the checker is non deterministic or there's some UB shenanigans going on. ↵
↵
Links to submissions↵
↵
[submission:362583126] ↵
WA↵
↵
[submission:362583031] ↵
AC↵
↵
[user:Darsh_Jain,2026-02-12] also tried testing it, and the following two submissions↵
↵
[submission:362582232]↵
WA↵
↵
[submission:362581962]↵
AC↵
↵
And the difference between the two is only that we have added a comment in the first one!↵
↵
[user:FelixArg,2026-02-12] and [user:sevlll777,2026-02-12] pls help




