| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1339916 | michael12 | Cup of Jamshid (IOI17_cup) | C++20 | 0 ms | 0 KiB |
#include "cup.h"
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<stack>
#include<queue>
#include<string.h>
#include<array>
#include<algorithm>
#include<cmath>
using namespace std;
const int maxn = 5e5;
int maxq = 29;
vector<int> find_cup(){
int r1 = -5e8, r2 = -5e8;
int cur = 0, cur1 = 0;
int f = ask_shahrasb(r1, r2);
for(int i = 0; i <= maxq - 1; i++){
if(f & (1 << i)){
int f2 = ask_shahrasb(r1 + (1 << i), r2);
bool is = false, is1 = false;
if(f & (1 << (i + 1))) is = true;
if(f2 & (1 << (i + 1))) is2 = true;
if(is == is1){
cur += (1 << i);
}
else{
cur1 += (1 << i);
}
}
else{
int f2 = ask_shahrasb(r1 + (1 << i), r2);
bool is = false, is1 = false;
if(f & (1 << (i + 1))) is = true;
if(f2 & (1 << (i + 1))) is2 = true;
if(is == is1){
cur += (1 << i);
cur1 += (1 << i);
}
}
}
vector<int> g = {cur, cur1};
return g;
}
// signed main() {
// ios::sync_with_stdio(false);
// cin.tie(nullptr);
// string s;
// }