結果

問題 No.1187 皇帝ペンギン
ユーザー 👑 CleyL
提出日時 2022-02-16 00:23:32
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 446 bytes
コンパイル時間 456 ms
コンパイル使用メモリ 64,016 KB
実行使用メモリ 25,964 KB
平均クエリ数 18.00
最終ジャッジ日時 2024-06-29 07:10:18
合計ジャッジ時間 10,368 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 54
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
    int mn = 0;
    int mx = 1001;
    while(mx-mn > 1){
        int ce = (mn+mx)/2;
        cout << ce << endl;
        string s;cin>>s;
        if(s == "safe"){
            mn = ce;
        }else{
            cout << ce+1 << endl;
            cin>>s;
            if(s == "safe"){
                mn = ce+1;
            }else{
                mx = ce;
            }
        }
        
    }
}
0