結果

問題 No.257 N言っちゃダメゲーム (3)
コンテスト
ユーザー lllllll88938494
提出日時 2023-05-09 03:09:26
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 266 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 273 ms
コンパイル使用メモリ 84,992 KB
実行使用メモリ 71,832 KB
平均クエリ数 3.70
最終ジャッジ日時 2026-05-20 07:28:29
合計ジャッジ時間 4,399 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n,k = map(int,input().split())
if  (n-1)%(k+1) == 0:
    print(0,flush=True)
    now=int(input())
    if now >= n:
        exit()
else:
    now = 0

while True:
    a=((n-1)-now)%(k+1)
    print(a+now,flush=True)
    now = int(input())
    if now >= n:
        break
0