답안 #117195

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
117195 2019-06-15T09:38:58 Z tjd229 Cup of Jamshid (IOI17_cup) C++14
100 / 100
3 ms 384 KB
#include "cup.h"
const int s = -1e9;
std::vector<int> find_cup() {
	int x = s, y = s;
	int diff = ask_shahrasb(x, y);
	int common = 0;
	int b = 1;
	int px = 0, py = 0;
	for (int i = 0; i < 31; ++i,b+=b) {
		int d = ask_shahrasb(x + b, y);
		if (diff&b) {
			if (diff -b==d) px += b;
			else py += b;
		}
		else if (diff + b == d) common += b;
	}
	x += px + common;
	y += py + common;
	return{x,y};
}
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 384 KB Output is correct