# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
60970 | kingpig9 | Cup of Jamshid (IOI17_cup) | C++11 | 4 ms | 376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "cup.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define fi first
#define se second
#define all(v) (v).begin(), (v).end()
#define fillchar(a, s) memset((a), (s), sizeof(a))
bool isdesert (int x) {
return abs(x) <= 5e8;
}
bool isdesert (int x, int y) {
return isdesert(x) && isdesert(y);
}
vector<int> find_cup() {
//find the x value first
int dbase = ask_shahrasb(5e8, 5e8);
int dx = 0;
for (int i = 0; i <= 28; i++) {
int di = ask_shahrasb(5e8 + (1 << i), 5e8) ^ dbase;
di = ((di >> i) + 1) / 2;
assert((di & (di - 1)) == 0);
if (di != 1) {
dx ^= (1 << i);
}
}
//hmm we need to find the 2^29 digit in a special way.
//could be (1 << 29)
bool isse = false;
for (int b29 : {0, 1 << 29}) {
dx ^= b29;
int x = 5e8 - dx;
int dy = ask_shahrasb(x, 5e8);
int y = 5e8 - dy;
if (isse || ask_shahrasb(x, y) == 0) {
return vector<int> {x, y};
}
dx ^= b29;
isse = true;
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |