Submission #117195

# Submission time Handle Problem Language Result Execution time Memory
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};
}
# Verdict Execution time Memory Grader output
1 Correct 3 ms 384 KB Output is correct