NazihBaydoun's blog

By NazihBaydoun, history, 4 weeks ago, In English

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].

  • Vote: I like it
  • -6
  • Vote: I do not like it

»
4 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by NazihBaydoun (previous revision, new revision, compare).

»
4 weeks ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

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

»
4 weeks ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

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