# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
148139 | WhipppedCream | Cup of Jamshid (IOI17_cup) | C++17 | 3 ms | 376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cup.h"
#include <bits/stdc++.h>
using namespace std;
int ask(int a, int b)
{
return ask_shahrasb(a, b);
}
const int maxn = 28;
vector<int> find_cup() {
vector<int> result(2);
int mulx, muly;
mulx = muly = 1;
int base = ask(0, 0);
int check1 = ask((1<<29)-1, 0);
int check2 = ask(0, (1<<29)-1);
if(check1 & (1<<29)) mulx = -1;
if(check2 & (1<<29)) muly = -1;
int resx, resy;
resx = resy = 0;
//check for the case where x = 0
//printf("*%d %d\n", mulx, muly);
int temp = ask(-mulx*((1<<29)-1), 0);
if((temp&(1<<29)) == 0)
{
//x = 0
result[0] = 0;
result[1] = muly*base;
return result;
}
for(int i = maxn; i>= 0; i--)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |