結果

問題 No.1187 皇帝ペンギン
ユーザー chocorusk
提出日時 2020-08-22 15:21:57
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 889 bytes
コンパイル時間 5,476 ms
コンパイル使用メモリ 155,484 KB
最終ジャッジ日時 2025-01-13 09:30:42
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 48 TLE * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
    int l=0, r=1000;
    while(r-l>1){
        int m=(l+r)/2;
        cout<<"? "<<m<<endl;
        string res; cin>>res;
        if(res=="safe"){
            l=m;
            continue;
        }
        cout<<"? "<<m-1<<endl;
        cin>>res;
        if(res=="safe") l=m-1;
        else r=m-1;
    }
    cout<<r<<endl;
    return 0;
}
0