結果
| 問題 |
No.3246 80% Accuracy Calculator
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-08-22 23:35:32 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,778 bytes |
| コンパイル時間 | 1,843 ms |
| コンパイル使用メモリ | 201,524 KB |
| 実行使用メモリ | 26,356 KB |
| 平均クエリ数 | 366.91 |
| 最終ジャッジ日時 | 2025-08-22 23:36:24 |
| 合計ジャッジ時間 | 5,726 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 WA * 35 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
//#define DEBUG
int X = 2, Y = 3, Z = 0;
vector<int> A = {2, 3, 0};
unsigned long long xor64() {
static unsigned long long x
= (unsigned long long)(chrono::duration_cast<chrono::nanoseconds>(
chrono::high_resolution_clock::now().time_since_epoch()).count())
* 10150724397891781847ULL;
x ^= x << 7;
return x ^= x >> 9;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
constexpr int r = 19;
array<int, r> tmp;
auto ask1 = [&](char c){
for(int i = 0; i < r; i++){
cout << "? " << c << endl;
#ifndef DEBUG
cin >> tmp[i];
#else
tmp[i] = xor64() % 10 < 8 ? A[c - 'A'] : xor64() % 1000;
#endif
}
sort(tmp.begin(), tmp.end());
pair<int,int> mx;
for(int i = 0; i < r; ){
int p = i;
while(i < r && tmp[i] == tmp[p]) i++;
mx = max(mx, make_pair(i - p, tmp[p]));
}
return mx.second;
};
auto ask2 = [&](char c0, char c1, char c2){
int res;
cout << "+ " << c0 << " " << c1 << " " << c2 << endl;
#ifndef DEBUG
cin >> res;
assert(res == 0);
#else
A[c2 - 'A'] = xor64() % 10 < 8 ? A[c0 - 'A'] + A[c1 - 'A'] : xor64() % 1000;
#endif
};
int x = ask1('A');
int y = ask1('B');
int v = 0;
char c0 = 'A', c1 = 'B', c2 = 'C';
while(y){
if(y & 1){
v += x;
do{
ask2(c0, c2, c1);
}while(ask1(c1) != v);
swap(c1, c2);
}
do{
ask2(c0, c0, c1);
}while(ask1(c1) != 2 * x);
x += x;
swap(c0, c1);
y /= 2;
}
cout << "! C" << endl;
}