# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
47478 | sampriti | Cup of Jamshid (IOI17_cup) | C++17 | 3 ms | 376 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "cup.h"
#include <algorithm>
using namespace std;
vector<int> find_cup() {
int diff = ask_shahrasb(5e8, 5e8);
int ans = 0;
for(int i = 0; i <= 28; i++) {
if(ask_shahrasb(5e8 + (1 << i), 5e8) != (diff ^ (1 << i))) {
ans += 1 << i;
}
}
int x_1 = 5e8 - ans;
int y_1 = 5e8 - (ans ^ diff);
ans += 1 << 29;
int x_2 = 5e8 - ans;
int y_2 = 5e8 - (ans ^ diff);
int test_x = -100, test_y = -100 + (1 << 29); // some random numbers
if((abs(test_x - x_1) ^ abs(test_y - y_1)) == ask_shahrasb(test_x, test_y)) {
return {x_1, y_1};
}
else {
return {x_2, y_2};
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |