結果

問題 No.253 ロウソクの長さ
ユーザー YOS G-specYOS G-spec
提出日時 2018-10-18 23:09:16
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 452 bytes
コンパイル時間 1,407 ms
コンパイル使用メモリ 84,232 KB
実行使用メモリ 24,420 KB
平均クエリ数 21.22
最終ジャッジ日時 2023-09-03 21:13:23
合計ジャッジ時間 4,366 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
23,772 KB
testcase_01 AC 25 ms
23,460 KB
testcase_02 AC 25 ms
23,820 KB
testcase_03 AC 26 ms
24,396 KB
testcase_04 AC 25 ms
23,352 KB
testcase_05 AC 25 ms
23,520 KB
testcase_06 AC 26 ms
23,988 KB
testcase_07 AC 25 ms
23,340 KB
testcase_08 AC 26 ms
23,604 KB
testcase_09 AC 24 ms
23,616 KB
testcase_10 AC 26 ms
23,616 KB
testcase_11 AC 25 ms
23,376 KB
testcase_12 AC 26 ms
23,820 KB
testcase_13 AC 27 ms
23,616 KB
testcase_14 AC 25 ms
23,988 KB
testcase_15 AC 25 ms
24,192 KB
testcase_16 AC 25 ms
23,988 KB
testcase_17 AC 26 ms
23,304 KB
testcase_18 AC 26 ms
23,304 KB
testcase_19 AC 25 ms
23,820 KB
testcase_20 AC 26 ms
23,988 KB
testcase_21 AC 26 ms
23,988 KB
testcase_22 AC 25 ms
23,832 KB
testcase_23 AC 26 ms
23,748 KB
testcase_24 AC 25 ms
23,460 KB
testcase_25 AC 27 ms
23,460 KB
testcase_26 AC 26 ms
23,964 KB
testcase_27 AC 25 ms
24,420 KB
testcase_28 AC 26 ms
23,640 KB
testcase_29 AC 26 ms
24,360 KB
testcase_30 AC 25 ms
23,976 KB
testcase_31 AC 26 ms
23,328 KB
testcase_32 AC 27 ms
23,580 KB
testcase_33 AC 26 ms
23,304 KB
testcase_34 AC 26 ms
24,132 KB
testcase_35 AC 27 ms
24,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio;
import std.string;
import std.conv;

void main(){
	auto numMin=10;
	auto numMax=1000000001;
	auto turn=0;
	for(;;){
		int chkNum=turn==0? 100: (numMin+numMax)/2;
		writeln(text("? ",chkNum));
		stdout.flush();
		auto chk=readln().strip();
		if(chk=="1") numMin=chkNum;
		else if(chk=="-1") numMax=chkNum;
		else{
			writeln(text("! ",chkNum+turn));
			stdout.flush();
			break;
		}
		if(0<numMin) numMin--;
		numMax--;
		turn++;
	}
}
0