結果
| 問題 |
No.1187 皇帝ペンギン
|
| コンテスト | |
| ユーザー |
matsu7874
|
| 提出日時 | 2020-08-22 14:39:42 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 55 ms / 1,000 ms |
| コード長 | 391 bytes |
| コンパイル時間 | 83 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 27,480 KB |
| 平均クエリ数 | 16.02 |
| 最終ジャッジ日時 | 2024-07-17 06:20:34 |
| 合計ジャッジ時間 | 5,735 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 54 |
ソースコード
def is_safe(n):
print(f'? {n}', flush=True)
return input() == 'safe'
def main():
out = 10**3
safe = 0
while safe + 1 < out:
q = (safe + out)//2
if is_safe(q):
safe = q
elif q+1 < out and is_safe(q+1):
safe = q+1
else:
out = q
print(f'! {safe}', flush=True)
if __name__ == "__main__":
main()
matsu7874