結果
問題 |
No.3246 80% Accuracy Calculator
|
ユーザー |
![]() |
提出日時 | 2025-08-22 22:50:45 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,272 bytes |
コンパイル時間 | 4,443 ms |
コンパイル使用メモリ | 257,724 KB |
実行使用メモリ | 25,972 KB |
平均クエリ数 | 1749.00 |
最終ジャッジ日時 | 2025-08-22 22:50:58 |
合計ジャッジ時間 | 10,048 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 WA * 2 RE * 10 |
コンパイルメッセージ
main.cpp: In function ‘int query(char)’: main.cpp:26:1: warning: control reaches end of non-void function [-Wreturn-type] 26 | } | ^
ソースコード
#include <stdio.h> #include <atcoder/all> #include <bits/stdc++.h> using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000005 #define Inf64 1000000000000000001LL int query(char c){ map<int,int> mp; rep(i,6){ cout<<"? "<<c<<endl; int res; cin>>res; assert(res!=-1); mp[res]++; } int ma = 0; for(auto a:mp){ ma = max(ma,a.second); } for(auto a:mp){ if(ma==a.second)return a.first; } } int add(char a,char b,char c){ cout<<"+ "<<a<<' '<<b<<' '<<c<<endl; int z; cin>>z; assert(z!=-1); return z; } int main(){ int x = query('A'); int y = query('B'); int curx = x; while(true){ add('A','A','B'); if(query('B')==curx*2)break; } curx *= 2; char cx,ans,trash; int cans = 0; if(y%2==1){ ans = 'A'; trash = 'C'; cx = 'B'; cans = x; } else{ ans = 'C'; cx = 'B'; trash = 'A'; } y /= 2; while(y!=0){ if(y%2==1){ cans += curx; while(true){ // cout<<"fuga"<<curx<<endl; add(cx,ans,trash); if(query(trash)==cans)break; } swap(trash,ans); } y /= 2; while(true){ //cout<<"hoge"<<curx<<endl; add(cx,cx,trash); if(query(trash)==curx*2)break; } swap(cx,trash); curx *= 2; } cout<<"! "<<ans<<endl; }