The Ticket Chase#14

The Ticket Chase (Discussion)

  1. user170558Sep 14, 2025, 7:55 PMedited

    Помилка в перекладі на Українську і Російську мови

    Чи є шанс у Петі купити такий квиток до наступної зупинки, якщо у кондуктора лише один рулон квитків, кількість цифр у номерах білетів якого визначається купленим квитком. Цей додаток до умови тільки плутає та не відповідає дійсності і тестам

  2. Khayyam7Nov 14, 2024, 8:29 PM

    In input 4, isn't the answer 5? Because Peter will be the sixth person and he will get a prime number ticket which is 29. But the given answer is -1. In my program, everything is true except for the 4th test.

    1. skolodyazhnyyNov 14, 2024, 9:02 PMedited

      Khayyam7 keep in mind that Vanja and Peter are also included in , meaning Peter can only advance ticket number by N-2 before taking a ticket himself.

      In the example, the starting ticket number is 23 (one taken by Vanja), Peter can let up to 4 passengers to take tickets before him, reaching number 27, then he will take #28.

  3. user117860Nov 3, 2024, 11:45 AM

    I get 90% but test 2 is wrong, why?

    1. skolodyazhnyyNov 3, 2024, 12:56 PM

      user117860 in the second test the numbers in the input file were separated by two spaces and your solution couldn't handle it correctly. I have corrected the test.

  4. MishaOkpagJun 18, 2024, 5:41 PM

    Тест номер 4: изначальный билет номер 23, количество пассажиров 6. Нужно пропустить 5 пассажиров, чтобы купить простой билет с номером 29. У вас указано, что в этом случае правильный ответ -1, то есть невозможно. Код проходит на 90%, кроме этого случая. Не пойму, у меня ошибка или на сайте ?

    1. skolodyazhnyyJun 18, 2024, 8:54 PMedited

      MishaOkpag обратите внимание, что Ваня и Петя тоже входят в число пассажиров