Submission #1041169

# Submission time Handle Problem Language Result Execution time Memory
1041169 2024-08-01T16:37:53 Z 7again Cup of Jamshid (IOI17_cup) C++17
100 / 100
1 ms 348 KB
#include "cup.h"
#include <bits/stdc++.h>
using namespace std ;
vector<int> find_cup() {
    vector<int> result(2);

    int INF = -1e9 ;
    int a = 0 , xr = ask_shahrasb(INF , INF) ;
    for(int i = 0 ; i < 31 ; i++)
    {
        int R = (1<<i) ;
        int Z = ask_shahrasb(INF+R , INF) ;
        if(Z == (xr^R))
            a += R ;
    }

    int b = (xr^a) ;
    result[0] = a + INF ;
    result[1] = b + INF ;
    return result ;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct