結果

問題 No.3496 協力カード当て
コンテスト
ユーザー convexineq
提出日時 2026-04-16 00:34:38
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
RE  
実行時間 -
コード長 1,600 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 326 ms
コンパイル使用メモリ 85,376 KB
実行使用メモリ 85,672 KB
スコア 0
平均クエリ数 35.12
最終ジャッジ日時 2026-04-16 00:34:45
合計ジャッジ時間 5,522 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# T = int(readline())
# for _ in range(T):
#     ans = solve()
#     print(ans)

#n = int(readline())
#a = [int(i) for i in readline().split()]
#ab = [[int(i) for i in readline().split()] for _ in range()]
#S = readline().strip()
#b = [readline().strip() for _ in range()]

import sys
readline = sys.stdin.readline


def ask(i,x):
    assert input()=="TURN"
    if x == 0: x = m
    print(f"ASK {x}",flush=1)

def get():
    _,x,k = input().split()
    if _ == "COUNT":
        tot[int(x)] = int(k)
    return int(x),int(k)

def guess():
    r = []
    for v in range(1,m+1):
        for _ in range(tot[v] - cnt_jibun[v] - cnt_other[v]):
            r.append(v)
    input()
    print("GUESS",*r,flush=1)
    input()

def wait():
    return input()

m = 2

idx,n,m = map(int,input().split())
C = list(map(int,input().split()))

cnt_jibun = [0]*(m+1) # 自分の枚数
cnt_other = [0]*(m+1)
tot = [-1]*(m+1) # 判明枚数

for v in C: cnt_jibun[v] += 1

if idx == 1:
    for i in range(1,m+1):
        ask(i,cnt_jibun[i]+1)
        x,k = get()

        assert wait()=="WAIT"
        x,k = get()
        cnt_other[i] = x-1
else:
    for i in range(1,m+1):
        assert wait()=="WAIT"
        x,k = get()
        cnt_other[i] = x-1

        ask(i,cnt_jibun[i]+1)
        x,k = get()
cnt_other[m] = n-sum(cnt_other)

if idx == 2:
    wait()    
    x,k = get()
while 1:
    for i in range(1,m+1):
        if tot[i] == -1:
            ask(i)
            x,k = get()

            wait()
            x,k = get()
            break
    else:
        guess()
        wait()
        exit()



















0