Блог пользователя Giaco

Автор Giaco, история, 5 лет назад, По-английски

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.

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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 лет назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

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