結果

問題 No.253 ロウソクの長さ
ユーザー Kmcode1Kmcode1
提出日時 2015-07-25 02:42:58
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 919 bytes
コンパイル時間 650 ms
コンパイル使用メモリ 94,196 KB
実行使用メモリ 24,396 KB
平均クエリ数 49.64
最終ジャッジ日時 2023-09-23 05:11:03
合計ジャッジ時間 3,970 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
23,928 KB
testcase_01 AC 26 ms
24,024 KB
testcase_02 AC 28 ms
23,616 KB
testcase_03 AC 27 ms
23,364 KB
testcase_04 AC 26 ms
23,616 KB
testcase_05 WA -
testcase_06 AC 27 ms
24,348 KB
testcase_07 AC 27 ms
23,712 KB
testcase_08 AC 27 ms
23,508 KB
testcase_09 AC 26 ms
24,024 KB
testcase_10 AC 28 ms
24,360 KB
testcase_11 AC 27 ms
24,276 KB
testcase_12 AC 27 ms
24,276 KB
testcase_13 AC 26 ms
23,604 KB
testcase_14 AC 26 ms
24,012 KB
testcase_15 AC 28 ms
24,024 KB
testcase_16 AC 26 ms
24,396 KB
testcase_17 AC 27 ms
23,700 KB
testcase_18 AC 27 ms
23,664 KB
testcase_19 AC 25 ms
23,364 KB
testcase_20 AC 27 ms
23,532 KB
testcase_21 WA -
testcase_22 AC 26 ms
23,700 KB
testcase_23 AC 27 ms
24,396 KB
testcase_24 AC 26 ms
23,400 KB
testcase_25 AC 27 ms
24,060 KB
testcase_26 AC 28 ms
23,460 KB
testcase_27 AC 27 ms
24,240 KB
testcase_28 AC 27 ms
23,616 KB
testcase_29 AC 27 ms
24,024 KB
testcase_30 AC 27 ms
23,580 KB
testcase_31 AC 27 ms
23,364 KB
testcase_32 AC 27 ms
23,400 KB
testcase_33 AC 28 ms
24,384 KB
testcase_34 AC 25 ms
24,360 KB
testcase_35 AC 27 ms
24,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<ctime>
#include<complex>
#include<functional>
#include<climits>
#include<cassert>
#include<iterator>
#include<unordered_map>
#include<stdint.h>
using namespace std;

int main(void) {
	int i, ask = (1 << 30), ans0, ans1 = -1, y=0;
	for (i = 0; i < 30; i++) {
		printf("? %d\n", 1); fflush(stdout);
		scanf("%d", &ans0);
		if (ans0 != 1) {
			y = 2 * i + (ans0 == 0);
			break;
		}

		ask += ans1 * (1 << (29 - i));
		printf("? %d\n", ask - (2 * i + 1)); fflush(stdout);
		scanf("%d", &ans1);
		if (ans1 == 0) {
			y = ask;
			break;
		}
	}
	printf("! %d\n", y); fflush(stdout);
	return 0;
}
0