結果
| 問題 | No.1187 皇帝ペンギン |
| コンテスト | |
| ユーザー |
umezo
|
| 提出日時 | 2020-08-27 16:17:49 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 554 bytes |
| 記録 | |
| コンパイル時間 | 1,373 ms |
| コンパイル使用メモリ | 210,468 KB |
| 実行使用メモリ | 30,308 KB |
| 平均クエリ数 | 17.37 |
| 最終ジャッジ日時 | 2026-06-12 22:42:03 |
| 合計ジャッジ時間 | 5,680 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 52 WA * 2 |
ソースコード
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
#include <bits/stdc++.h>
using namespace std;
int main(){
string s;
int left=0,right=1000,mid;
while(right-left>1){
mid=(left+right)/2;
cout<<"? "<<mid<<endl;
cin>>s;
if(s=="safe"){
left=mid;
continue;
}
cout<<"? "<<mid-1<<endl;
cin>>s;
if(s=="out"){
right=mid;
continue;
}
else{
left=mid;
continue;
}
}
cout<<"! "<<max(left-1,0)<<endl;
return 0;
}
umezo