結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー brthyyjp
提出日時 2021-04-14 00:32:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 335 ms
コンパイル使用メモリ 82,472 KB
実行使用メモリ 70,756 KB
平均クエリ数 3.70
最終ジャッジ日時 2024-07-17 03:01:45
合計ジャッジ時間 4,861 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

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