Submission #230184

# Submission time Handle Problem Language Result Execution time Memory
230184 2020-05-09T02:43:06 Z AngusRitossa Cup of Jamshid (IOI17_cup) C++14
100 / 100
5 ms 384 KB
#include "cup.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> find_cup() {
	int val = -1e9;
	int xdiff = 0;
	int res = ask_shahrasb(val, val);
	for (int i = 0; i < 31; i++) {
		int r = ask_shahrasb(val+(1 << i), val);
		if (r == (res^(1 << i))) xdiff |= (1 << i);
	}
	int ydiff = res^xdiff;
	int x = val+xdiff, y = val+ydiff;
	return { x, y };
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct