結果

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

ソースコード

diff #
raw source code

p,n,m=map(int,input().split())
C=[0]+[0]*n
A=list(map(int,input().split()))
AA=A[:]
B=[]
A.sort()
if 1 in A:
    A=A[1:]
AC=[0]+[0]*m
for i in A:
    AC[i]+=1
Q=[]
for i in range(m+1):
    if AC[i]!=0:
        Q.append((AC[i],i))
Q.sort()
QQ=[]
pre=1
for I in Q:
    while I[0]!=pre:
        pre+=1
        QQ.append((0,1))
    QQ.append(I)
q=0
fin=0
while True:
    turn=input()
    if turn=="TURN":
        if q<len(QQ):
            print(QQ[q][1])
            q+=1
            res,a,b=input().split()
            Ans[a]=b
        else:
            BC=[]
            c=0
            for i in B:
                if i==1:
                    c+=1
                else:
                    for j in range(c):
                        BC.append(i)
            while len(BC)<n:
                BC.append(1)
            G=[]
            for i in range(m+1):
                q=Ans[i]-AA.count(i)-BC.count(i)
                for j in range(q):
                    G.append(i)
            while len(G)<n:
                G.append(m)
            print("GUESSED",*G)
            res,a,b=input().split()
            if b==1:
                fin+=1
            if fin==2:
                exit()
                
                
            
            
    else:
        res,a,b=input().split()
        if res=="COUNT":
            Ans[a]=b
            B.append(a)
        if res=="GUESSED":
            if b==1:
                fin+=1
            if fin==2:
                exit()
            
    
0