結果
問題 |
No.246 質問と回答
|
ユーザー |
![]() |
提出日時 | 2016-10-23 17:05:07 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 671 bytes |
コンパイル時間 | 2,200 ms |
コンパイル使用メモリ | 85,716 KB |
実行使用メモリ | 72,980 KB |
平均クエリ数 | 59.10 |
最終ジャッジ日時 | 2024-07-16 11:17:22 |
合計ジャッジ時間 | 10,628 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 30 |
ソースコード
import java.util.*; import java.math.*; import java.text.*; public class Main { private static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws Exception { int ans = 500000000; int s = 1; int e = 1000000000; while (true) { System.out.println("? " + ans); System.out.flush(); int ret = sc.nextInt(); if (ret == 1) { s = ans; } else { e = ans-1; } ans = (s+e)/2; if (s == e-1) { System.out.println("! " + e); } } } }