結果

問題 No.934 Explosive energy drink
ユーザー mkawa2mkawa2
提出日時 2019-11-30 01:00:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 661 ms / 2,000 ms
コード長 871 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 10,912 KB
実行使用メモリ 24,792 KB
平均クエリ数 649.00
最終ジャッジ日時 2023-09-23 19:07:10
合計ジャッジ時間 5,587 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
24,784 KB
testcase_01 AC 279 ms
24,308 KB
testcase_02 AC 44 ms
24,204 KB
testcase_03 AC 99 ms
24,392 KB
testcase_04 AC 661 ms
24,640 KB
testcase_05 AC 43 ms
24,704 KB
testcase_06 AC 43 ms
24,380 KB
testcase_07 AC 43 ms
24,208 KB
testcase_08 AC 43 ms
24,356 KB
testcase_09 AC 44 ms
24,664 KB
testcase_10 AC 44 ms
24,380 KB
testcase_11 AC 45 ms
24,304 KB
testcase_12 AC 46 ms
24,664 KB
testcase_13 AC 51 ms
24,792 KB
testcase_14 AC 53 ms
24,692 KB
testcase_15 AC 210 ms
24,732 KB
testcase_16 AC 57 ms
24,316 KB
testcase_17 AC 67 ms
24,652 KB
testcase_18 AC 99 ms
24,472 KB
testcase_19 AC 140 ms
24,488 KB
testcase_20 AC 259 ms
24,504 KB
testcase_21 AC 235 ms
24,792 KB
testcase_22 AC 363 ms
24,512 KB
testcase_23 AC 373 ms
24,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
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=deque()

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

def main():
    l=0
    r=n+1
    while l + 1 < r:
        m = (l + r) // 2
        q(m)
        if input() == "0":
            l = m
        else:
            if m==2:
                print("!",2)
                print(1,2)
                exit()
            r = m
    hit.append(r)
    for x in range(r-1,0,-1):
        q(x-1)
        if input()=="0":
            hit.appendleft(x)
    print("!",len(hit))
    print(*hit)

main()
0