Hello Everyone! Today I encountered a weird bug for the first time. So basically I was submitting some code to a problem and that's when I encountered this weird bug where I got wrong answer on test case 1 even though when I copied the input and tried it in my code editor it passed the first testcase? Can anyone see why this happened pls. Thank you. Here's the problem and the submission: [problem:https://mirror.codeforces.com/problemset/problem/2191/B] and [submission:https://mirror.codeforces.com/contest/2191/submission/368125504].








Auto comment: topic has been updated by NazihBaydoun (previous revision, new revision, compare).
well hello! i submited your code at me using python 3 and it gave me wrong answer 2 so here's the sumbission url https://mirror.codeforces.com/contest/2191/submission/368135137 it's prob bug yea but your logic deff got some problems ig and WHAT THA HEEEECK wrong answer expected YES, found NO [445th token] u deff got somewhere little bug tht making u give WA
I'm gonna try again, but thank you for testing it out.
set does not keep elements in a particular order, so it keeps changing with different versions, just use
l1 = sorted(list(set(a[:i + 1])))
similarly for l2, should not give different answers then
Thanks a lot! I that explains the error on 445th token on testcase 2. I thought I had put sorted.