Logo
(追記) (追記ここまで)

31516번 - Sequence Guessing 다국어인터랙티브

시간 제한메모리 제한제출정답맞힌 사람정답 비율
10 초 (추가 시간 없음) 2048 MB131362723.276%

문제

You are tasked with creating a secret sequence of integers that is difficult to guess.

The sequence is subject to the following constraints:

  • The first number in the sequence must be 0ドル$.
  • The last number in the sequence must be 100ドル,000円$.
  • Each number in the sequence must be either 1ドル$ or 2ドル$ greater than the one preceding it.

At first, all you need to reveal is the length of the sequence.

Then, an adversary will guess the numbers in the sequence one at a time.

  • If the guessed number is in your sequence, you must reveal exactly where in the sequence it appears.
  • If the guessed number is not in your sequence, you must simply reveal that it is not in the sequence. This is considered a "miss".

Note that because you are not forced to write down the sequence in advance, you can "cheat" by changing the sequence you have in mind, so long as it does not contradict the information you have revealed so far. It turns out that under these conditions, you can always force the adversary to get 33ドル,333円$ misses before they can guess every number in your sequence. Your job is to write a program that does so.

인터랙션

Your program should begin by printing $k$ $(2 \leq k \leq 100,001円),ドル the length of your sequence, as a single integer on a single line. After this, you will receive one integer $x$ on a single line. This integer is guaranteed to be between $-1$ and 100ドル,000円$ inclusive.

  • If $x = -1,ドル the adversary has given up; your program should print all $k$ integers in your sequence in order, one line per integer, and then exit. The adversary is guaranteed to give this input after it has gotten 33ドル,333円$ misses, though it may do so earlier. After printing all $k$ integers, your program should exit. If you print a valid sequence consistent with your previous responses, your submission will be considered correct for this test case.
  • If $x$ is not in your sequence, print $-1$ on a single line.
  • If $x$ is in your sequence, print a single integer $i$ on a single line, such that $x$ is the $i$th (1-indexed) number in the sequence. If you have printed every integer from 1ドル$ to $k,ドル your program should now exit, and your submission will receive a Wrong Answer verdict.

Do not forget to flush the output after every integer you print.

After this, if your program has not yet exited, the process will repeat, with you receiving another single integer. The adversary is guaranteed to never repeat integers.

The adversary may employ different guessing strategies on different runs.

입력

출력

제한

예제 입력 1

0
1
-1

예제 출력 1

50001
1
-1
0
2
<omitted 49997 lines for brevity>
99998
100000

힌트

출처

ICPC > Regionals > North America > Pacific Northwest Regional > 2023 ICPC Pacific Northwest Region > Division 1 K번

ICPC > Regionals > North America > Pacific Northwest Regional > 2023 ICPC Pacific Northwest Region > Division 2 M번

ICPC > Regionals > North America > South Central USA Regional > 2023 South Central USA Regional Contest > Division 1 J번

ICPC > Regionals > North America > South Central USA Regional > 2023 South Central USA Regional Contest > Division 2 J번

ICPC > Regionals > North America > Mid-Atlantic Regional > 2023 Mid-Atlantic USA Regional Contest > Division 1 J번

ICPC > Regionals > North America > Mid-Atlantic Regional > 2023 Mid-Atlantic USA Regional Contest > Division 2 J번

ICPC > Regionals > North America > Southeast USA Regional > 2023 Southeast USA Regional Programming Contest > Division 1 J번

ICPC > Regionals > North America > Southeast USA Regional > 2023 Southeast USA Regional Programming Contest > Division 2 J번

  • 문제를 만든 사람: Andy Nguyen

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /