結果
問題 |
No.1187 皇帝ペンギン
|
ユーザー |
![]() |
提出日時 | 2020-08-22 13:25:36 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 547 bytes |
コンパイル時間 | 1,532 ms |
コンパイル使用メモリ | 167,920 KB |
実行使用メモリ | 25,476 KB |
平均クエリ数 | 21.96 |
最終ジャッジ日時 | 2024-07-17 06:10:10 |
合計ジャッジ時間 | 11,516 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 54 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int tv = 0; int fv = 1000; while (fv - tv > 1){ int mid = (tv + fv) / 2; cout << "? " << mid << endl; string S1; cin >> S1; cout << "? " << mid + 1 << endl; string S2; cin >> S2; if (S1 == "out" && S2 == "out"){ fv = mid; } else { tv = mid; } } int ans = tv; while (1){ cout << "? " << ans << endl; string S; cin >> S; if (S == "out"){ ans--; } else { break; } } cout << ans << endl; }