結果

問題 No.1187 皇帝ペンギン
コンテスト
ユーザー CleyL
提出日時 2022-02-16 00:23:32
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 446 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 413 ms
コンパイル使用メモリ 76,500 KB
実行使用メモリ 28,988 KB
平均クエリ数 18.00
最終ジャッジ日時 2026-03-18 17:41:00
合計ジャッジ時間 8,322 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 54
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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