結果

問題 No.514 宝探し3
ユーザー 👑 kmjpkmjp
提出日時 2017-05-05 22:26:35
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 911 bytes
コンパイル時間 1,042 ms
コンパイル使用メモリ 145,252 KB
実行使用メモリ 24,324 KB
平均クエリ数 2.75
最終ジャッジ日時 2023-09-23 13:16:20
合計ジャッジ時間 2,200 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
23,868 KB
testcase_01 AC 22 ms
23,556 KB
testcase_02 AC 23 ms
24,324 KB
testcase_03 AC 22 ms
23,616 KB
testcase_04 AC 25 ms
23,640 KB
testcase_05 AC 23 ms
24,060 KB
testcase_06 AC 23 ms
23,412 KB
testcase_07 AC 24 ms
23,436 KB
testcase_08 AC 25 ms
23,640 KB
testcase_09 AC 22 ms
23,676 KB
testcase_10 AC 23 ms
23,676 KB
testcase_11 AC 22 ms
24,240 KB
権限があれば一括ダウンロードができます

ソースコード

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 x,int y) {
	int ret;
	cout<<x<<" "<<y<<endl;
	cin>>ret;
	if(ret==0) exit(0);
	
	return ret;
}

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	int A=ask(0,0);
	int B=ask(0,1000000000);
	int X=(A+B-1000000000)/2;
	int Y=A-X;
	
	ask(X,Y);
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	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