結果

問題 No.934 Explosive energy drink
ユーザー mkawa2mkawa2
提出日時 2019-11-30 00:18:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 1,007 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 10,924 KB
実行使用メモリ 24,516 KB
平均クエリ数 454.42
最終ジャッジ日時 2023-09-23 19:06:04
合計ジャッジ時間 5,216 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
24,112 KB
testcase_01 AC 47 ms
23,836 KB
testcase_02 AC 37 ms
23,964 KB
testcase_03 AC 45 ms
24,180 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 AC 39 ms
24,236 KB
testcase_07 AC 38 ms
23,932 KB
testcase_08 AC 39 ms
24,484 KB
testcase_09 AC 38 ms
24,032 KB
testcase_10 AC 40 ms
23,772 KB
testcase_11 AC 41 ms
23,840 KB
testcase_12 AC 45 ms
23,760 KB
testcase_13 AC 62 ms
24,072 KB
testcase_14 AC 95 ms
23,936 KB
testcase_15 RE -
testcase_16 AC 43 ms
24,012 KB
testcase_17 AC 47 ms
24,008 KB
testcase_18 AC 141 ms
24,048 KB
testcase_19 AC 48 ms
24,412 KB
testcase_20 AC 200 ms
24,324 KB
testcase_21 AC 57 ms
23,872 KB
testcase_22 AC 91 ms
24,284 KB
testcase_23 AC 65 ms
24,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

n=int(input())
hit=[]

def q(x,y):
    lst=list(range(x,y+1))+hit
    lst.sort()
    print("?",len(lst))
    print(*lst)

def main():
    b,e=1,n
    while e>2:
        l,r=1,e
        while l+1<r:
            m=(l+r)//2
            q(b,m)
            if input()=="0":
                l=m
            else:
                e=r=m
        if e==2:break
        hit.append(r)
        e-=1
    q(1,1)
    if input()=="1":
        q(2,2)
        if input()=="1":
            1
        else:
            hit.append(1)
    else:
        q(2,2)
        if input()=="0":
            hit.append(1)
            hit.append(2)
        else:
            hit.append(2)

    hit.sort()
    print("!",len(hit))
    print(*hit)

main()
0