結果

問題 No.355 数当てゲーム(2)
ユーザー rlangevin
提出日時 2023-06-15 12:31:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 620 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 82,564 KB
実行使用メモリ 71,248 KB
平均クエリ数 36.96
最終ジャッジ日時 2024-06-23 13:18:12
合計ジャッジ時間 6,783 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 52
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import *
from itertools import *

def check(L):
    print(*L)
    sys.stdout.flush()
    x, y = map(int, input().split())
    if [x, y] == [4, 0]:
        exit()
    return x, y

x, y = check([0, 1, 2, 3])
default = x + y

L = [0, 1, 2, 3]
ans = set()

for i in range(4):
    D = defaultdict(list)
    ma = 0
    for j in range(4, 10):
        L[i] = j
        x, y = check(L)
        D[x + y].append(j)
        ma = max(ma, x + y)
        L[i] = i
    if ma == default + 1:
        for v in D[ma]:
            ans.add(v)
    else:
        ans.add(i)

for t in permutations(ans):
    check(t)
0