제출 #421226

#제출 시각아이디문제언어결과실행 시간메모리
421226PyqeCup of Jamshid (IOI17_cup)C++14
0 / 100
2 ms204 KiB
#include <bits/stdc++.h>
#include "cup.h"

using namespace std;

long long ma=1e9;

vector<int> find_cup()
{
	long long i,ii,mk=ask_shahrasb(-ma/2,-ma/2),mk2,mk3,e;
	vector<int> v={0,0};
	
	for(i=0;1ll<<i<=ma/2;i++)
	{
		mk2=ask_shahrasb(-ma/2-(1ll<<i),-ma/2);
		mk3=mk^mk2;
		e=mk3>>i+1&1;
		v[0]|=e<<i;
		v[1]|=((mk>>i&1)^e)<<i;
	}
	mk2=ask_shahrasb(-ma/2+1,-ma/2);
	mk3=ask_shahrasb(-ma/2+1+(1ll<<29),-ma/2);
	e=!((mk2^mk3)&(1ll<<29)-1);
	v[0]|=e<<29;
	v[1]|=((mk>>i&1)^e)<<29;
	for(ii=0;ii<2;ii++)
	{
		v[ii]-=ma/2;
	}
	return v;
}

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

cup.cpp: In function 'std::vector<int> find_cup()':
cup.cpp:17:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   17 |   e=mk3>>i+1&1;
      |          ~^~
cup.cpp:23:25: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
   23 |  e=!((mk2^mk3)&(1ll<<29)-1);
      |                ~~~~~~~~~^~
#Verdict Execution timeMemoryGrader output
Fetching results...