# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
362259 | alextodoran | Cup of Jamshid (IOI17_cup) | C++17 | 2 ms | 364 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/**
____ ____ ____ ____ ____
||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... |