結果

問題 No.934 Explosive energy drink
ユーザー 💕💖💞💕💖💞
提出日時 2020-01-07 16:52:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 807 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 10,972 KB
実行使用メモリ 25,416 KB
平均クエリ数 711.08
最終ジャッジ日時 2023-09-23 19:24:55
合計ジャッジ時間 5,874 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 256 ms
25,416 KB
testcase_02 AC 40 ms
24,744 KB
testcase_03 AC 141 ms
25,364 KB
testcase_04 AC 411 ms
25,004 KB
testcase_05 AC 40 ms
25,016 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 41 ms
24,768 KB
testcase_10 AC 40 ms
24,708 KB
testcase_11 AC 43 ms
25,276 KB
testcase_12 AC 45 ms
24,920 KB
testcase_13 AC 48 ms
25,132 KB
testcase_14 AC 48 ms
25,356 KB
testcase_15 AC 143 ms
25,012 KB
testcase_16 AC 55 ms
25,228 KB
testcase_17 AC 76 ms
25,236 KB
testcase_18 AC 78 ms
25,252 KB
testcase_19 AC 118 ms
24,936 KB
testcase_20 AC 184 ms
24,880 KB
testcase_21 AC 181 ms
25,096 KB
testcase_22 AC 261 ms
25,000 KB
testcase_23 AC 261 ms
25,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import os
from itertools import combinations
import random
import copy
n = int(input())
x = list(range(1,n+1))

def check(x, ch):
    if ch is not None:
        x.remove(ch)
    print(f'? {len(x)}')
    print(' '.join(map(str, x)))

    result = input()
    if result == '1':
        return True
    else:
        return False

buff = set()
def trier(x):
    if len(buff) == n:
        return None

    for ch in copy.copy(x):
        if ch not in buff:
            '''チェック'''
            if check(copy.copy(x), ch):
                x.remove(ch)
                buff.add(ch)
            else:
                buff.add(ch)

ans = None
if check(x, None):
    ans = x
while True:
    ret = trier(x)
    if ret is None:
        ans = x
        break

print(f'! {len(ans)}')
print(' '.join(map(str,ans)))
0