제출 #905285

#제출 시각아이디문제언어결과실행 시간메모리
905285rainboyCup of Jamshid (IOI17_cup)C++17
100 / 100
1 ms348 KiB
#include "cup.h"

using namespace std;

typedef vector<int> vi;

const int X = 1000000000, L = 30;

vi find_cup() {
	int d = ask_shahrasb(-X, -X), x = -X;
	for (int l = 0; l < L; l++)
		if ((ask_shahrasb(-X + (1 << l), -X) ^ d) == (1 << l))
			x += (1 << l);
	if (x < -X / 2)
		x += 1 << L;
	int y = (d ^ x + X) - X;
	return { x, y };
}

컴파일 시 표준 에러 (stderr) 메시지

cup.cpp: In function 'vi find_cup()':
cup.cpp:16:17: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
   16 |  int y = (d ^ x + X) - X;
      |               ~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...