結果

問題 No.2828 Remainder Game
ユーザー miya145592miya145592
提出日時 2024-08-02 22:26:20
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 703 bytes
コンパイル時間 411 ms
コンパイル使用メモリ 82,564 KB
実行使用メモリ 88,812 KB
平均クエリ数 51.30
最終ジャッジ日時 2024-08-02 22:26:25
合計ジャッジ時間 4,630 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 95 ms
69,308 KB
testcase_16 AC 95 ms
69,792 KB
testcase_17 AC 95 ms
68,736 KB
testcase_18 AC 96 ms
70,608 KB
testcase_19 AC 100 ms
70,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(l, r, M):
    if len(ans)==5:
        return 0
    used.add((l, r))
    K = r-l
    R = []
    for i in range(l, r):
        R.append(i)
    print(M, K, flush=True)
    print(*R, flush=True)
    C = int(input())
    if C==0:
        return 0
    if K==1:
        for _ in range(C):
            ans.append(l)
        return C
    # left
    if (l, (l+r)//2) not in used:
        ret = f(l, (l+r)//2, M)
    # right
    if C-ret>0:
        if ((l+r)//2, r) not in used:
            f((l+r)//2, r, M)
    return C
import sys
input = sys.stdin.readline
N = int(input())
l = 0
r = N+1
ans = []
used = set()
# left
f(l, (l+r)//2, N+1)
# right
f((l+r)//2, r, N+1)
print(0, 1, flush=True)
print(sum(ans))
0