제출 #60970

#제출 시각아이디문제언어결과실행 시간메모리
60970kingpig9Cup of Jamshid (IOI17_cup)C++11
0 / 100
4 ms376 KiB
#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) 메시지

cup.cpp: In function 'std::vector<int> find_cup()':
cup.cpp:53:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...