結果

問題 No.246 質問と回答
ユーザー t8m8⛄️t8m8⛄️
提出日時 2015-08-12 16:25:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 218 ms / 2,000 ms
コード長 782 bytes
コンパイル時間 3,330 ms
コンパイル使用メモリ 75,648 KB
実行使用メモリ 72,528 KB
平均クエリ数 101.00
最終ジャッジ日時 2023-09-23 20:06:22
合計ジャッジ時間 11,556 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 213 ms
71,584 KB
testcase_01 AC 211 ms
71,984 KB
testcase_02 AC 211 ms
71,528 KB
testcase_03 AC 211 ms
71,880 KB
testcase_04 AC 208 ms
71,888 KB
testcase_05 AC 213 ms
72,380 KB
testcase_06 AC 206 ms
72,388 KB
testcase_07 AC 208 ms
72,464 KB
testcase_08 AC 209 ms
71,840 KB
testcase_09 AC 217 ms
72,060 KB
testcase_10 AC 203 ms
71,836 KB
testcase_11 AC 203 ms
71,940 KB
testcase_12 AC 209 ms
71,604 KB
testcase_13 AC 208 ms
71,972 KB
testcase_14 AC 209 ms
72,428 KB
testcase_15 AC 209 ms
71,832 KB
testcase_16 AC 212 ms
72,248 KB
testcase_17 AC 211 ms
72,192 KB
testcase_18 AC 203 ms
72,528 KB
testcase_19 AC 210 ms
72,260 KB
testcase_20 AC 209 ms
71,628 KB
testcase_21 AC 212 ms
71,412 KB
testcase_22 AC 210 ms
71,708 KB
testcase_23 AC 211 ms
71,432 KB
testcase_24 AC 213 ms
72,524 KB
testcase_25 AC 212 ms
72,116 KB
testcase_26 AC 218 ms
72,028 KB
testcase_27 AC 207 ms
70,696 KB
testcase_28 AC 209 ms
71,860 KB
testcase_29 AC 210 ms
71,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.awt.geom.*;
import java.math.*;

public class No0246 {
	
	static final Scanner in = new Scanner(System.in);
	static final PrintWriter out = new PrintWriter(System.out,false);

	static void solve() {
		int l = 1, r = 1_000_000_000;
		for (int i=0; i<100; i++) {
			int m = (l + r)/2;
			out.println("? "+m);
			out.flush();
			int x = in.nextInt();
			if (x == 1) {
				l = m;
			} else {
				r = m;
			}
		}

		out.println("! "+l);
	}

	public static void main(String[] args) {
		long start = System.currentTimeMillis();

		solve();
		out.flush();

		long end = System.currentTimeMillis();
		//trace(end-start + "ms");
		in.close();
		out.close();
	}

	static void trace(Object... o) { System.out.println(Arrays.deepToString(o));}
}
0