CF1705F.Mark and the Online Exam

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Mark is administering an online exam consisting of nn true-false questions. However, he has lost all answer keys. He needs a way to retrieve the answers before his client gets infuriated.

Fortunately, he has access to the grading system. Thus, for each query, you can input the answers to all nn questions, and the grading system will output how many of them are correct.

He doesn't have much time, so he can use the grading system at most 675675 times. Help Mark determine the answer keys.

Note that answer keys are fixed in advance and will not change depending on your queries.

输入格式

The first line of the input consists of an integer nn ( 1n10001\leq n\leq 1000 ) — the number of questions.

输出格式

After reading nn , you can start making queries to the grading system. For each query, print a line containing a string ss of length nn consisting of only letters 'T' and 'F'.

  • $s_i = $ 'T' means that you answer the ii -question true.
  • $s_i = $ 'F' means that you answer the ii -question false.

After a successful query, you should read an integer kk ( 0kn0\leq k\leq n ) — the number of correct answers. If you read nn , then you found the answers, and your program should not make any more queries.

If your program reads k=1k = -1 instead of the number of correct answers, it means that you either made an invalid query or exceeded the query limits. Exit immediately after receiving 1-1 , and you will see Wrong answer verdict. Otherwise, you can get an arbitrary verdict because your solution will continue to read from a closed stream.

After printing a query do not forget to output end of line and flush the output. Otherwise, you will get Idleness limit exceeded. To do this, use:

  • fflush(stdout) or cout.flush() in C++;
  • System.out.flush() in Java;
  • flush(output) in Pascal;
  • stdout.flush() in Python;
  • see documentation for other languages.

Hacks

To hack, use the following format:

The first line contains an integer nn ( 1n10001\leq n\leq 1000 ) — the number of questions.

The second line contains a string ss of length nn consisting of only 'T' and 'F' — the answer key.

输入输出样例

  • 输入#1

    3
    
    1
    
    3

    输出#1

    FTT
    
    TTF
  • 输入#2

    4
    
    0
    
    3
    
    4

    输出#2

    FTFF
    
    TTTT
    
    TFTT

说明/提示

The empty lines in the example are just for you to better understand the interaction process. You're not required to print them.

In the first example, there are 33 questions, and the answer to each question is 'true', 'true', and 'false', respectively.

  • The first query, guessing the answers to be 'false', 'true', and 'true', respectively, guesses only one question — the 22 -nd question — correctly.
  • Then, in the second query, the program correctly guesses the answer key. The interaction ends here.

In the second example, there are 44 questions, and the answer to each question is 'true', 'false', 'true', and 'true', respectively.

  • The first query guessed none of the questions correctly, resulting in the answer 00 .
  • The second query guessed the 11 -st, 33 -rd, and 44 -th question correctly, resulting in the answer 33 .
  • In the third query, the program correctly guesses the answer key. Then, the interaction ends.
首页