Submission #230185

# Submission time Handle Problem Language Result Execution time Memory
230185 2020-05-09T02:45:08 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 = -5e8-1;
	int xdiff = 0;
	int res = ask_shahrasb(val, val);
	for (int i = 0; i < 30; 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