結果
| 問題 |
No.3246 80% Accuracy Calculator
|
| コンテスト | |
| ユーザー |
AngrySadEight
|
| 提出日時 | 2025-07-26 17:57:19 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,485 bytes |
| コンパイル時間 | 731 ms |
| コンパイル使用メモリ | 83,112 KB |
| 実行使用メモリ | 26,356 KB |
| 平均クエリ数 | 7551.42 |
| 最終ジャッジ日時 | 2025-07-27 02:49:53 |
| 合計ジャッジ時間 | 16,560 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 RE * 36 |
ソースコード
#include <cassert>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
using ll = long long;
ll get_most(char reg, ll times) {
map<ll, ll> mp;
for (ll i = 0; i < times; i++) {
cout << "? " << reg << endl;
ll val;
cin >> val;
assert(val != -1);
mp[val]++;
}
ll max_times = 0;
ll max_val = -1;
for (auto it = mp.begin(); it != mp.end(); it++) {
if (max_times < it->second) {
max_times = it->second;
max_val = it->first;
}
}
return max_val;
}
int main() {
ll x = get_most('A', 30);
ll y = get_most('B', 30);
ll now = 2;
for (ll i = 0; i < y; i++) {
if (now == 2) {
while (true) {
cout << "+ A C B" << endl;
ll z;
cin >> z;
assert(z == 0);
ll val = get_most('B', 7);
if (val == i * x + x) {
break;
}
}
now = 1;
} else {
while (true) {
cout << "+ A B C" << endl;
ll z;
cin >> z;
assert(z == 0);
ll val = get_most('C', 7);
if (val == i * x + x) {
break;
}
}
now = 2;
}
}
if (now == 1) {
cout << "! B" << endl;
} else {
cout << "! C" << endl;
}
}
AngrySadEight