| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 124330 | AngusRitossa | Cup of Jamshid (IOI17_cup) | C++14 | 3 ms | 376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cup.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> find_cup() {
vector<int> result;
int fir = -536870912;
int x = -536870912;
int y = 536870912;
int a = ask_shahrasb(x, y);
for (int i = 0; i < 32; i++)
{
if (a & (1 << i))
{
int newx = x+(1 << i);
if (ask_shahrasb(newx, y) == (a^(1 << i))) fir+=1<<i;
else fir-=1<<i;
}
}
int sec = 536870911;
x = 536870911;
a = ask_shahrasb(x, y);
for (int i = 0; i < 32; i++)
{
if (a & (1 << i))
{
int newx = x-(1 << i);
if (ask_shahrasb(newx, y) == (a^(1 << i))) sec-=1<<i;
else sec+=1<<i;
}
}
int ansx = (fir+sec)/2;
int ansy = 536870912 - (sec-fir)/2;
result.push_back(ansx);
result.push_back(ansy);
return result;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
