結果
| 問題 |
No.3246 80% Accuracy Calculator
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-08-22 23:57:00 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,441 bytes |
| コンパイル時間 | 3,566 ms |
| コンパイル使用メモリ | 287,172 KB |
| 実行使用メモリ | 25,972 KB |
| 平均クエリ数 | 3489.37 |
| 最終ジャッジ日時 | 2025-08-22 23:57:35 |
| 合計ジャッジ時間 | 12,789 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 34 RE * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
int x,y,z;
{
int cnt=0;
map<int,int> mp;
while(1){
cout<<"? A"<<endl;
cin>>z;
mp[z]++;
cnt++;
if(cnt>=7&&mp[z]*2>cnt){
x=z;
break;
}
}
}
{
int cnt=0;
map<int,int> mp;
while(1){
cout<<"? B"<<endl;
cin>>z;
mp[z]++;
cnt++;
if(cnt>=7&&mp[z]*2>cnt){
y=z;
break;
}
}
}
if(y==1){
cout<<"! A"<<endl;
return 0;
}
int now=1;
int k=1;
while(k*2<=y){
int cnt=0;
map<int,int> mp;
if(k==1){
cout<<"+ A A C"<<endl;
}else if(now==1){
cout<<"+ B B C"<<endl;
}else{
cout<<"+ C C B"<<endl;
}
cin>>z;
assert(z==0);
bool ok=false;
while(1){
if(now==1){
cout<<"? C"<<endl;
}else{
cout<<"? B"<<endl;
}
cin>>z;
assert(z!=-1);
mp[z]++;
cnt++;
if(mp[x*k*2]>=8){
ok=true;
break;
}else if(cnt==15){
break;
}
}
if(ok){
now=1-now;
k*=2;
}
}
while(k<y){
if(now==1)cout<<"+ A B C"<<endl;
else cout<<"+ A C B"<<endl;
cin>>z;
assert(z==0);
bool ok=false;
map<int,int> mp;
int cnt=0;
while(1){
if(now==1)cout<<"? C"<<endl;
else cout<<"? B"<<endl;
cin>>z;
assert(z!=-1);
mp[z]++;
cnt++;
if(mp[x*(k+1)]>=8){
ok=true;
break;
}else if(cnt==15){
break;
}
}
if(ok){
now=1-now;
k++;
}
}
if(now==1)cout<<"! B"<<endl;
else cout<<"! C"<<endl;
}