結果
| 問題 |
No.1187 皇帝ペンギン
|
| コンテスト | |
| ユーザー |
umezo
|
| 提出日時 | 2020-08-22 14:32:06 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 637 bytes |
| コンパイル時間 | 11,276 ms |
| コンパイル使用メモリ | 252,884 KB |
| 最終ジャッジ日時 | 2025-01-13 08:45:13 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 47 WA * 6 TLE * 1 |
ソースコード
#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() {
int cnt=1;
int l=0,r=1001;
string s;
cout<<"?"<<1<<endl;
cin>>s;
if(s=="out"){
cout<<"!"<<0<<endl;
return 0;
}
while(r-l>1){
int m=(l+r)/2;
cout<<"?"<<m<<endl;
cin>>s;
cnt++;
if(s=="safe") l=m;
else r=m;
}
int n=r;
int i=1;
while(cnt<=25){
cout<<"?"<<n-i<<endl;
cin>>s;
cnt++;
if(s=="safe"){
cout<<"!"<<n-i<<endl;
return 0;
}
}
cout<<"!"<<n-i-1<<endl;
return 0;
}
umezo