結果

問題 No.257 N言っちゃダメゲーム (3)
コンテスト
ユーザー lllllll88938494
提出日時 2023-05-09 03:09:26
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 142 ms / 2,000 ms
+ 2µs
コード長 266 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 63 ms
コンパイル使用メモリ 82,284 KB
実行使用メモリ 55,912 KB
平均クエリ数 3.70
最終ジャッジ日時 2026-09-29 23:17:09
合計ジャッジ時間 3,567 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_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