結果

問題 No.253 ロウソクの長さ
ユーザー ぴろずぴろず
提出日時 2015-07-24 23:00:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 178 ms / 2,000 ms
コード長 523 bytes
コンパイル時間 2,004 ms
コンパイル使用メモリ 73,328 KB
実行使用メモリ 73,832 KB
平均クエリ数 21.94
最終ジャッジ日時 2023-09-23 21:00:06
合計ジャッジ時間 10,190 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 178 ms
72,240 KB
testcase_01 AC 162 ms
71,960 KB
testcase_02 AC 164 ms
72,556 KB
testcase_03 AC 159 ms
71,928 KB
testcase_04 AC 161 ms
72,088 KB
testcase_05 AC 157 ms
70,488 KB
testcase_06 AC 165 ms
72,108 KB
testcase_07 AC 170 ms
73,832 KB
testcase_08 AC 168 ms
72,108 KB
testcase_09 AC 164 ms
69,812 KB
testcase_10 AC 171 ms
72,444 KB
testcase_11 AC 167 ms
72,432 KB
testcase_12 AC 169 ms
72,076 KB
testcase_13 AC 170 ms
72,016 KB
testcase_14 AC 160 ms
72,204 KB
testcase_15 AC 166 ms
71,928 KB
testcase_16 AC 167 ms
72,292 KB
testcase_17 AC 163 ms
71,940 KB
testcase_18 AC 172 ms
71,884 KB
testcase_19 AC 165 ms
71,964 KB
testcase_20 AC 175 ms
71,536 KB
testcase_21 AC 165 ms
72,244 KB
testcase_22 AC 166 ms
72,276 KB
testcase_23 AC 175 ms
71,840 KB
testcase_24 AC 166 ms
72,444 KB
testcase_25 AC 174 ms
70,388 KB
testcase_26 AC 175 ms
72,800 KB
testcase_27 AC 175 ms
72,112 KB
testcase_28 AC 173 ms
72,288 KB
testcase_29 AC 176 ms
72,384 KB
testcase_30 AC 173 ms
72,616 KB
testcase_31 AC 176 ms
72,076 KB
testcase_32 AC 176 ms
72,100 KB
testcase_33 AC 174 ms
72,456 KB
testcase_34 AC 163 ms
71,652 KB
testcase_35 AC 176 ms
72,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no253;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int l = 10;
		int r = 1000000001;
		int t = 0;
		while(l + 1 < r) {
			int c = t == 0 ? 200 : (l + r) / 2;
//			System.out.println(t + "," + l + "," + r + "," + c);
			System.out.println("? " + (c - t));
			int x = sc.nextInt();
			if (x == 0) {
				l = c;
				break;
			}else if(x < 0) {
				r = c;
			}else{
				l = c;
			}
			t++;
		}
		System.out.println("! " + l);
	}

}
0