結果

問題 No.934 Explosive energy drink
ユーザー tamatotamato
提出日時 2020-01-31 17:03:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 483 ms / 2,000 ms
コード長 706 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 94,848 KB
平均クエリ数 709.08
最終ジャッジ日時 2023-09-23 19:33:49
合計ジャッジ時間 6,882 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
87,456 KB
testcase_01 AC 331 ms
94,848 KB
testcase_02 AC 105 ms
87,888 KB
testcase_03 AC 227 ms
93,560 KB
testcase_04 AC 483 ms
94,844 KB
testcase_05 AC 103 ms
87,040 KB
testcase_06 AC 99 ms
87,096 KB
testcase_07 AC 101 ms
87,620 KB
testcase_08 AC 100 ms
86,880 KB
testcase_09 AC 102 ms
87,456 KB
testcase_10 AC 102 ms
86,968 KB
testcase_11 AC 105 ms
87,544 KB
testcase_12 AC 118 ms
92,760 KB
testcase_13 AC 120 ms
92,576 KB
testcase_14 AC 123 ms
92,952 KB
testcase_15 AC 224 ms
93,092 KB
testcase_16 AC 133 ms
92,532 KB
testcase_17 AC 161 ms
93,876 KB
testcase_18 AC 165 ms
93,228 KB
testcase_19 AC 201 ms
93,340 KB
testcase_20 AC 263 ms
93,732 KB
testcase_21 AC 266 ms
93,472 KB
testcase_22 AC 325 ms
93,812 KB
testcase_23 AC 334 ms
94,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    import sys
    input = sys.stdin.readline

    def ask(A):
        print('?', len(A))
        print(*A)
        sys.stdout.flush()

    N = int(input())
    need = [1] * N
    for i in range(N):
        q = []
        need[i] = 0
        for j in range(N):
            if need[j]:
                q.append(j+1)
        if len(q) == 1:
            need[i] = 1
            need[q[0]-1] = 1
            continue
        ask(q)
        e = int(input())
        if not e:
            need[i] = 1
    ans = []
    for i in range(N):
        if need[i]:
            ans.append(i+1)
    print('!', len(ans))
    print(*ans)
    sys.stdout.flush()
    exit()


if __name__ == '__main__':
    main()
0