When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

HeydarBABA's blog

By HeydarBABA, history, 4 years ago, In English

1239C - Очередь в поезде

63055149

can someone explain why my code is wrong.

thanks

EDIT: I missed this part in the problem text "at the very first moment he observes that all seats with numbers smaller than i are busy, he will go to the tank."

  • Vote: I like it
  • +2
  • Vote: I do not like it

»
4 years ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

3 10

2 1 0

The answer is 30 20 10, your code will print 20 30 10.