結果

問題 No.253 ロウソクの長さ
ユーザー YOS G-specYOS G-spec
提出日時 2018-10-18 23:06:40
言語 JavaScript
(node v20.8.0)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 474 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 5,332 KB
実行使用メモリ 59,812 KB
平均クエリ数 21.22
最終ジャッジ日時 2023-09-24 01:59:28
合計ジャッジ時間 6,038 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
58,996 KB
testcase_01 AC 77 ms
57,996 KB
testcase_02 AC 78 ms
58,064 KB
testcase_03 AC 77 ms
58,688 KB
testcase_04 AC 78 ms
58,464 KB
testcase_05 AC 78 ms
58,600 KB
testcase_06 AC 81 ms
58,900 KB
testcase_07 AC 80 ms
58,776 KB
testcase_08 AC 81 ms
58,468 KB
testcase_09 AC 77 ms
58,464 KB
testcase_10 AC 80 ms
58,960 KB
testcase_11 AC 80 ms
58,820 KB
testcase_12 AC 80 ms
58,496 KB
testcase_13 AC 81 ms
58,968 KB
testcase_14 AC 78 ms
58,928 KB
testcase_15 AC 77 ms
58,496 KB
testcase_16 AC 77 ms
58,412 KB
testcase_17 AC 76 ms
58,616 KB
testcase_18 AC 80 ms
58,848 KB
testcase_19 AC 77 ms
59,812 KB
testcase_20 AC 81 ms
59,556 KB
testcase_21 AC 77 ms
58,092 KB
testcase_22 AC 76 ms
59,036 KB
testcase_23 AC 79 ms
59,240 KB
testcase_24 AC 75 ms
58,132 KB
testcase_25 AC 81 ms
58,984 KB
testcase_26 AC 80 ms
58,704 KB
testcase_27 AC 80 ms
58,768 KB
testcase_28 AC 81 ms
58,452 KB
testcase_29 AC 78 ms
58,636 KB
testcase_30 AC 80 ms
58,932 KB
testcase_31 AC 80 ms
58,432 KB
testcase_32 AC 79 ms
59,112 KB
testcase_33 AC 80 ms
58,752 KB
testcase_34 AC 76 ms
58,112 KB
testcase_35 AC 78 ms
58,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

const rl=require("readline").createInterface(process.stdin,process.stdout);

const g=function*(){
	var numMin=10;
	var numMax=1000000001;
	var turn=0;
	for(;;){
		var chkNum=turn==0? 100: 0|(numMin+numMax)/2;
		var chk=yield rl.question(`? ${chkNum}\n`,s=>g.next(s));
		if(chk=="1") numMin=chkNum;
		else if(chk=="-1") numMax=chkNum;
		else{
			console.log(`! ${chkNum+turn}`);
			break;
		}
		if(0<numMin) numMin--;
		numMax--;
		turn++;
	}
	process.exit();
}();
g.next();
0