Please read the new rule regarding the restriction on the use of AI tools. ×

Giaco's blog

By Giaco, history, 5 years ago, In English

Hello guys, i'm practicing with python and i don't understand why this sub 58435675 on codefroces always print -1 while on ideone just works fine. Can you help me? <.<

If you have any advice on how to improve my code in python it is appreciated.

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

You can try to submit with some other compiler. Today, while I was solving a problem on CF, I got WA on test 1 and it worked perfectly fine on my computer. Then I changed the compiler from GNU C++ 11 to GNU C++ 14 and I got AC. I hope this helps :)

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

The best way to find out what's wrong is to use custom invocation tool it runs your code with custom input on CF server.It's better if you try to find the problem yourself because exact thing can happen during contest and there will be no way to ask someone else to help(i mean you can ask someone but that's against the rules).

  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    i will use it more often from now, ty

»
5 years ago, # |
  Vote: I like it +8 Vote: I do not like it

I just noticed that python's set are not ordered.. sorting the elements of list has fixed the problem.