結果
| 問題 | No.3496 協力カード当て |
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2026-04-16 00:49:36 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 164 ms / 2,000 ms |
| コード長 | 1,573 bytes |
| 記録 | |
| コンパイル時間 | 449 ms |
| コンパイル使用メモリ | 84,992 KB |
| 実行使用メモリ | 72,616 KB |
| スコア | 87 |
| 平均クエリ数 | 45.62 |
| 最終ジャッジ日時 | 2026-04-16 00:49:47 |
| 合計ジャッジ時間 | 6,369 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
| 純コード判定しない問題か言語 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 |
ソースコード
# 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(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):
ask(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):
assert wait()=="WAIT"
x,k = get()
cnt_other[i] = x-1
ask(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()
convexineq