結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
23,364 KB
testcase_01 AC 27 ms
23,820 KB
testcase_02 AC 28 ms
23,628 KB
testcase_03 AC 27 ms
24,084 KB
testcase_04 AC 27 ms
23,268 KB
testcase_05 WA -
testcase_06 AC 27 ms
23,424 KB
testcase_07 AC 28 ms
23,928 KB
testcase_08 AC 26 ms
23,268 KB
testcase_09 AC 26 ms
24,216 KB
testcase_10 AC 28 ms
24,204 KB
testcase_11 AC 28 ms
24,084 KB
testcase_12 AC 27 ms
24,072 KB
testcase_13 AC 27 ms
23,808 KB
testcase_14 AC 26 ms
23,508 KB
testcase_15 AC 27 ms
23,988 KB
testcase_16 AC 26 ms
23,256 KB
testcase_17 AC 26 ms
23,436 KB
testcase_18 AC 28 ms
23,268 KB
testcase_19 AC 26 ms
23,724 KB
testcase_20 AC 27 ms
24,144 KB
testcase_21 WA -
testcase_22 AC 26 ms
23,544 KB
testcase_23 AC 28 ms
24,024 KB
testcase_24 AC 28 ms
24,000 KB
testcase_25 AC 28 ms
24,144 KB
testcase_26 AC 27 ms
23,268 KB
testcase_27 AC 28 ms
23,604 KB
testcase_28 AC 28 ms
23,820 KB
testcase_29 AC 28 ms
23,364 KB
testcase_30 AC 28 ms
23,400 KB
testcase_31 AC 27 ms
24,228 KB
testcase_32 AC 28 ms
23,364 KB
testcase_33 AC 26 ms
23,364 KB
testcase_34 AC 26 ms
23,928 KB
testcase_35 AC 27 ms
24,156 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));
		int k = ask - (k*i + 1);
		k = 0;
		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