結果
問題 |
No.1187 皇帝ペンギン
|
ユーザー |
|
提出日時 | 2020-08-22 15:34:02 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 37 ms / 1,000 ms |
コード長 | 487 bytes |
コンパイル時間 | 2,499 ms |
コンパイル使用メモリ | 192,812 KB |
最終ジャッジ日時 | 2025-01-13 09:41:49 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 54 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < (int)n; i++) using ll = long long; int main(){ int l = 0, r = 1000; string s; while(r-l > 1) { int m = (l + r) / 2; cout << "? " << m << endl; fflush(stdout); cin >> s; if(s == "safe") l = m; else { cout << "? " << m+1 << endl; fflush(stdout); cin >> s; if(s == "safe") l = m+1; else r = m; } } cout << "! " << l << endl; return 0; }