結果

問題 No.253 ロウソクの長さ
ユーザー 👑 kmjpkmjp
提出日時 2015-07-24 22:54:02
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 1,196 bytes
コンパイル時間 1,180 ms
コンパイル使用メモリ 145,428 KB
実行使用メモリ 24,456 KB
平均クエリ数 11.97
最終ジャッジ日時 2023-09-23 04:57:50
合計ジャッジ時間 9,467 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 26 ms
23,856 KB
testcase_02 AC 24 ms
23,424 KB
testcase_03 AC 25 ms
24,060 KB
testcase_04 AC 26 ms
23,412 KB
testcase_05 AC 27 ms
23,940 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 26 ms
23,592 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 AC 25 ms
23,772 KB
testcase_15 RE -
testcase_16 AC 26 ms
23,412 KB
testcase_17 RE -
testcase_18 RE -
testcase_19 AC 26 ms
23,460 KB
testcase_20 RE -
testcase_21 AC 28 ms
23,592 KB
testcase_22 AC 26 ms
24,060 KB
testcase_23 RE -
testcase_24 AC 27 ms
23,688 KB
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 AC 25 ms
23,184 KB
testcase_35 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<to;x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int ask(int Y){
	cout << "? " << Y << endl;
	int res;
	cin >> res;
	return res;
}

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	x=ask(80);
	
	if(x==0) {
		cout << "! " << 80 << endl;
		return;
	}
	if(x<0) {
		for(i=2;i<=100;i++) {
			x=ask(0);
			if(x==0) {
				cout << "! " << i-1 << endl;
				return;
			}
		}
		assert(0);
	}
	assert(0);
/*	
	int L=10,R=10000000009;
	int num=0;
	while(1) {
		int M=(L+R)/2;
		x=ask(M);
		if(x==0) {
			if(M==0) L=R=M;
			else {
				L=R=M-1;
				num++;
			}
			break;
		}
	}
	cout << "! " << L+num << endl;
*/
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}
0