結果

問題 No.513 宝探し2
ユーザー tabataba
提出日時 2017-05-18 01:17:02
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 620 bytes
コンパイル時間 800 ms
コンパイル使用メモリ 80,092 KB
実行使用メモリ 35,612 KB
最終ジャッジ日時 2023-09-24 01:16:17
合計ジャッジ時間 7,150 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <random>
#include <vector>
#include <algorithm>
#include <array>

using namespace std;

const bool TEST=false;

int manhattan(int x1,int y1,int x2,int y2){
	return abs(x1-x2)+abs(y1-y2);
}

int getcount=0;
int get(int x,int y){
	getcount++;
	if(TEST){
		return manhattan(x,y,8101919,364364);
	}
	printf("%d %d\n",x,y);
	int mh;
	int _=scanf("%d",&mh);
	return mh;
}

int main(){
	int x,y;
	int l,r;
	l=get(0,0);
	r=get(0x7fffffff,0);
	if(TEST)
		printf("%d %d\n",l,r);
	
	x=(l-(r-0x7fffffff))>>1;
	y=l-x;
	printf("%d %d\n",x,y);
	
	if(TEST){
		printf("getcount=%d\n",getcount);
	}
	return 0;
}
0