結果

問題 No.934 Explosive energy drink
ユーザー mkawa2mkawa2
提出日時 2021-03-30 11:37:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 446 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 10,808 KB
実行使用メモリ 24,488 KB
平均クエリ数 472.75
最終ジャッジ日時 2023-09-24 10:18:37
合計ジャッジ時間 4,315 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
24,048 KB
testcase_01 AC 42 ms
24,268 KB
testcase_02 AC 35 ms
23,664 KB
testcase_03 AC 42 ms
23,540 KB
testcase_04 RE -
testcase_05 AC 37 ms
24,024 KB
testcase_06 AC 36 ms
24,084 KB
testcase_07 AC 37 ms
24,012 KB
testcase_08 AC 37 ms
23,832 KB
testcase_09 AC 38 ms
24,384 KB
testcase_10 AC 38 ms
23,880 KB
testcase_11 AC 38 ms
23,640 KB
testcase_12 AC 45 ms
24,276 KB
testcase_13 AC 62 ms
23,568 KB
testcase_14 AC 100 ms
24,372 KB
testcase_15 RE -
testcase_16 AC 37 ms
23,832 KB
testcase_17 AC 44 ms
23,616 KB
testcase_18 AC 158 ms
24,424 KB
testcase_19 AC 46 ms
23,480 KB
testcase_20 AC 213 ms
24,036 KB
testcase_21 AC 56 ms
24,172 KB
testcase_22 AC 94 ms
24,320 KB
testcase_23 AC 63 ms
24,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def ask(aa):
    if len(aa)==1:return 0
    if len(aa)==n:return 1
    print("?", len(aa), flush=True)
    print(*aa, flush=True)
    return int(input())

n = int(input())
ans = []
r = n
while 1:
    l = 0
    while l+1 < r:
        m = (l+r)//2
        aa = list(range(1, m+1))+ans[::-1]
        if ask(aa): r = m
        else: l = m
    ans.append(r)
    if ask(ans[::-1]): break

print("!", len(ans), flush=True)
print(*ans[::-1], flush=True)
0