結果
| 問題 | No.1187 皇帝ペンギン |
| コンテスト | |
| ユーザー |
akane
|
| 提出日時 | 2020-08-22 17:27:40 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 26 ms / 1,000 ms |
| コード長 | 655 bytes |
| 記録 | |
| コンパイル時間 | 1,932 ms |
| コンパイル使用メモリ | 210,636 KB |
| 実行使用メモリ | 30,296 KB |
| 平均クエリ数 | 26.00 |
| 最終ジャッジ日時 | 2026-06-12 18:32:43 |
| 合計ジャッジ時間 | 5,647 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 54 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i < (n); i++)
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(false);
int safe = 0, out=1000;
int t=25;
while(t--){
int c = (safe+out)/2;
cout << "? " << c << endl;
string s; cin >> s;
if(s=="safe"){
safe = c;
}else if(s=="out"){
if(t==0) break;
t--;
cout << "?" << c+1 << endl;
cin >> s;
if(s=="out"){
out = c;
}else{
safe = c+1;
}
}
}
cout << "! " << safe << endl;
}
akane