結果

問題 No.1187 皇帝ペンギン
ユーザー shiomusubi496
提出日時 2020-08-22 19:45:47
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 25 ms / 1,000 ms
コード長 351 bytes
コンパイル時間 1,614 ms
コンパイル使用メモリ 167,196 KB
実行使用メモリ 25,324 KB
平均クエリ数 20.96
最終ジャッジ日時 2024-07-17 06:38:23
合計ジャッジ時間 5,664 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 54
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
    int ok=0,ng=1001;
    while(ng-ok>1){
        int n=(ok+ng)/2;
        string S,T;
        cout<<"? "<<n<<endl;
        cin>>S;
        cout<<"? "<<n+1<<endl;
        cin>>T;
        if(S=="out" && T=="out")ng=n;
        else ok=n;
    }
    cout<<"! "<<ok<<endl;
}
0