Submission #1339917

#TimeUsernameProblemLanguageResultExecution timeMemory
1339917michael12Cup of Jamshid (IOI17_cup)C++20
0 / 100
1 ms344 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))) is1 = 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))) is1 = 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;
    


    
// }
#Verdict Execution timeMemoryGrader output
Fetching results...