|시간 제한||메모리 제한||제출||정답||맞힌 사람||정답 비율|
|1 초||1024 MB||127||58||26||30.588%|
You and your friend are playing a game which you call Ninety-nine. You start, by saying either the number 1 or 2. You then take turns, starting with your friend, increasing this number by either 1 or 2 in each step. The first player who gets to say the number 99 wins!
Write a program which plays this game for you and wins.
This problem is interactive.
Your program should start by printing either the number 1 or 2 on a single line. The grader will then read this number (call it x), and in return print a line with either x+1 or x+2, which can be read by your program. Your program should then print a number which is 1 or 2 higher, and so on.
If you manage to win the game and print 99, your program should then exit normally (with status code 0). On the other hand, if your program reads 99, it should also exit normally; the test group will then get the verdict Wrong Answer. Printing an invalid value (including numbers larger than 99) will also result in Wrong Answer, assuming your program exits afterwards. If your program does not exit as it should, its verdict may be either Wrong Answer, Runtime Error or Time Limit Exceeded, depending on exact circumstances.
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:
Your friend always increases the number by 1.
Your friend always increases the number by 2 (unless at 98).
Your friend plays randomly, with each option having 50% probability (unless at 98).