# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
72559 | funcsr | Cup of Jamshid (IOI17_cup) | C++17 | 4 ms | 376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cup.h"
#include <iostream>
using namespace std;
#define rep(i, n) for (int i=0; i<(n); i++)
long long query(int x, int y) {
return ask_shahrasb(x-1e9, y-5e8);
}
std::vector<int> find_cup() {
long long g = query(0, 0);
long long x = 0;
rep(k, 30) if (((query((1LL<<k), 0)>>(k+1))&1) == ((g>>(k+1))&1)) x |= 1<<k;
if ((x-1e9) > 5e8 || (x-1e9) < -5e8) x^= 1LL<<30;
long long y = x^g;
x -= 1e9;
y -= 5e8;
//cout<<"("<<x<<","<<y<<")\n";
return {(int)x, (int)y};
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |