結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー lllllll88938494
提出日時 2023-05-09 03:09:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 266 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 82,424 KB
実行使用メモリ 70,596 KB
平均クエリ数 3.70
最終ジャッジ日時 2024-11-25 17:24:41
合計ジャッジ時間 4,395 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

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