結果
| 問題 |
No.594 壊れた宝物発見機
|
| コンテスト | |
| ユーザー |
ngtkana
|
| 提出日時 | 2020-04-04 13:33:17 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 860 bytes |
| コンパイル時間 | 2,333 ms |
| コンパイル使用メモリ | 195,284 KB |
| 最終ジャッジ日時 | 2025-01-09 14:02:18 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 15 |
ソースコード
#include<bits/stdc++.h>
using lint=long long;
using real=long double;
void answer(std::vector<lint>const&a){
std::cout<<"!";
for(lint x:a)std::cout<<" "<<x;
std::cout<<std::endl;
exit(0);
}
lint query(std::vector<lint>const&a){
std::cout<<"?";
for(lint x:a)std::cout<<" "<<x;
std::cout<<std::endl;
lint x;std::cin>>x;
return x;
}
int main(){
std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
std::vector<lint>ans(3);
for(lint i=0;i<3;i++){
auto query1=[&](lint x){
ans.at(i)=x;
return query(ans);
};
lint l=0,r=100;
while(1<r-l){
lint c=(r+l)/2;
(query1(c-1)<query1(c)?r:l)=c;
}
ans.at(i)=query1(l)<query1(r)?l:r;
}
answer(ans);
}
ngtkana