結果

問題 No.3496 協力カード当て
コンテスト
ユーザー titia
提出日時 2026-04-15 03:19:55
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
RE  
実行時間 -
コード長 1,253 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 657 ms
コンパイル使用メモリ 20,956 KB
実行使用メモリ 40,792 KB
スコア 41
平均クエリ数 45.81
最終ジャッジ日時 2026-04-15 03:20:02
合計ジャッジ時間 6,872 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7 WA * 6 RE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input = sys.stdin.readline
from collections import Counter

LIST=[]
C=Counter()


com,N,M=list(map(int,input().split()))
A=list(map(int,input().split()))

ind=0
while True:
    S=input().strip()

    if S=="TURN":
        if ind<N:
            print("ASK",A[ind],flush=True)
            ind+=1
        else:
            break
    elif S=="WAIT":
        pass

    ret=input().split()
    if ret[0]=="COUNT":
        x,y=int(ret[1]),int(ret[2])
        C[x]=y

        if S=="WAIT":
            LIST.append(x)

while True:
    if S=="TURN":
        flag=0
        for i in range(1,M+1):
            if i in C:
                pass
            else:
                flag=1
                print("ASK",i,flush=True)
                break

        if flag==0:
            ANS=[]
            C1=Counter(A)
            C2=Counter(LIST)

            for i in range(1,M+1):
                x=C[i]-C1[i]-C2[i]

                ANS+=[i]*x

            print("GUESS",*ANS,flush=True)
                
                
    elif S=="WAIT":
        pass
    else:
        if S[0]=="E":
            break

    ret=input().split()

    if ret[0]=="COUNT":
        x,y=int(ret[1]),int(ret[2])
        C[x]=y

    S=input().strip()
    
        
        
    
0