結果

問題 No.3246 80% Accuracy Calculator
ユーザー Koi
提出日時 2025-08-22 23:18:45
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 838 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 82,336 KB
実行使用メモリ 95,928 KB
平均クエリ数 7720.47
最終ジャッジ日時 2025-08-22 23:19:09
合計ジャッジ時間 22,701 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 RE * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
def ask(cnt, var):
    best_cnt = 0
    result = -1
    Cnts = defaultdict(int)
    for i in range(cnt):
        print("?", var)
        x = int(input())
        Cnts[x] += 1
        if(Cnts[x] > best_cnt):
            best_cnt = Cnts[x]
            result = x
    return result

x = ask(7, "A")
y = ask(7, "B")
A = x
B = y
C = 0
for i in range(y):
    while True:
        if(i % 2 == 0):
            print("+", "A", "C", "B")
            z = int(input())
            assert(z == 0)
            result = ask(7, "B")
            if(result == x * (i + 1)):
                break
        else:
            print("+", "A", "B", "C")
            z = int(input())
            assert(z == 0)
            result = ask(7, "C")
            if(result == x * (i + 1)):
                break
print("!", "CB"[y % 2])
0