結果
問題 |
No.1187 皇帝ペンギン
|
ユーザー |
![]() |
提出日時 | 2020-08-27 16:17:49 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 554 bytes |
コンパイル時間 | 2,370 ms |
コンパイル使用メモリ | 192,808 KB |
最終ジャッジ日時 | 2025-01-13 15:19:49 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; }