답안 #230184

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
230184 2020-05-09T02:43:06 Z AngusRitossa Cup of Jamshid (IOI17_cup) C++14
100 / 100
5 ms 384 KB
#include "cup.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> find_cup() {
	int val = -1e9;
	int xdiff = 0;
	int res = ask_shahrasb(val, val);
	for (int i = 0; i < 31; i++) {
		int r = ask_shahrasb(val+(1 << i), val);
		if (r == (res^(1 << i))) xdiff |= (1 << i);
	}
	int ydiff = res^xdiff;
	int x = val+xdiff, y = val+ydiff;
	return { x, y };
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Output is correct