Problem C
Ninety-nine
Languages
en
et
is
ja
lv
pl
ru
You and your friend are playing a game which you call
Ninety-nine. You start, by saying either the number
Write a program which plays this game for you and wins.
Interactivity
This problem is interactive.
Your program should start by printing either the number
If you manage to win the game and print
You must make sure to flush standard output before reading the grader’s response, or else your program will get judged as Time Limit Exceeded. This works as follows in the supported languages:
-
Java: System.out.println() flushes automatically.
-
Python: print() flushes automatically.
-
C++: cout << endl; flushes, in addition to writing a newline. If using printf, fflush(stdout).
-
Pascal: Flush(Output).
Constraints
Your solution will be tested on a set of test groups, each worth a number of points. Each test group contains a set of test cases. To get the points for a test group you need to solve all test cases in the test group. Your final score will be the maximum score of a single submission.
Group |
Points |
Constraints |
1 |
30 |
Your friend always increases the number by 1. |
2 |
30 |
Your friend always increases the number by 2 (unless at 98). |
3 |
40 |
Your friend plays randomly, with each option having 50% probability (unless at 98). |