# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1002232 | gyg | Cup of Jamshid (IOI17_cup) | C++17 | 1 ms | 344 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cup.h"
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
const int INF = 1e9, MAX = 5e8;
vector<int> find_cup() {
int k = ask_shahrasb(-INF, -INF);
int x = 0;
for (int i = 0; i <= 28; i++) {
int resp = ask_shahrasb(-INF + (1 << i), -INF);
if (resp != (k ^ (1 << i))) continue;
x ^= (1 << i);
}
for (pii bits : {make_pair(0, 0), make_pair(0, 1)}) {
int new_x = x | (bits.first << 30) | (bits.second << 29);
if (-INF + new_x < -MAX || -INF + new_x > MAX) continue;
int new_y = ask_shahrasb(-INF + new_x, -INF);
if (-INF + new_y < -MAX || -INF + new_y > MAX) continue;
// cout << -INF + new_x << " " << -INF + new_y << endl;
if ((new_x ^ new_y) != k) continue;
// cout << "ANSWER " << -INF + new_x << " " << -INF + new_y << endl;
return {-INF + new_x, -INF + new_y};
}
x |= (1 << 30);
int y = x ^ k;
// cout << "ANSWER " << -INF + x << " " << -INF + y << endl;
return {-INF + x, -INF + y};
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |