# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
362259 | alextodoran | Cup of Jamshid (IOI17_cup) | C++17 | 2 ms | 364 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.
/**
____ ____ ____ ____ ____
||a |||t |||o |||d |||o ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|
**/
#include <bits/stdc++.h>
#include "cup.h"
using namespace std;
typedef long long ll;
const int BITS = 30;
int ask_shahrasb(int x, int y);
vector <int> find_cup ()
{
int d = 500000002;
int xXORy = ask_shahrasb(0 - d, 0 - d);
int x = 0, y = 0;
for(int bit = 0; bit < BITS; bit++)
{
if(ask_shahrasb((1 << bit) - d, 0 - d) == (xXORy ^ (1 << bit)))
x ^= (1 << bit);
}
y = x ^ xXORy;
x -= d;
y -= d;
vector <int> answer;
answer.push_back(x);
answer.push_back(y);
return answer;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |