結果
| 問題 | 
                            No.1187 皇帝ペンギン
                             | 
                    
| コンテスト | |
| ユーザー | 
                             umezo
                         | 
                    
| 提出日時 | 2020-08-22 14:28:12 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 541 bytes | 
| コンパイル時間 | 2,190 ms | 
| コンパイル使用メモリ | 192,948 KB | 
| 最終ジャッジ日時 | 2025-01-13 08:41:46 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 47 WA * 7 | 
ソースコード
#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() {
  int cnt=0;
  int l=0,r=1000;
  string s;
  while(r-l>1){
    int m=(l+r)/2;
    cout<<"?"<<m<<endl;
    cin>>s;
    cnt++;
    if(s=="safe") l=m;
    else r=m;
  }
  int n=r;
  
  int i=1;
  while(cnt<=25){
    cout<<"?"<<n-i<<endl;
    cin>>s;
    cnt++;
    if(s=="safe"){
      cout<<"!"<<n-i<<endl;
      return 0;
    }
  }
  cout<<"!"<<n-i-1<<endl;
  return 0;
}
            
            
            
        
            
umezo