답안 #975087

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
975087 2024-05-04T12:03:51 Z marinaluca Cup of Jamshid (IOI17_cup) C++14
0 / 100
1 ms 348 KB
#include <bits/stdc++.h>
#include "cup.h"

using namespace std;
//#define int long long
#define ll long long
#define xx first
#define yy second
#define all (x) begin(x), end(x)
#define FOR (i, a, b) for (auto i = (a); i < (b); ++ i)
const int NMAX = 30;
vector <int> find_cup(){
    int mini = -1e9;
    int rez =0;
    int val = ask_shahrasb(mini, mini);
    for (int i = 0; i < NMAX + 1; ++ i){
        int ans = ask_shahrasb(mini + (1 << i), mini);
        if (mini == (val ^ (1 << i)))
            rez |= (1 << i);
    }
    int aa = val ^ rez;
    int x = mini + rez, y = mini + aa;
    return {x, y};
}

Compilation message

cup.cpp: In function 'std::vector<int> find_cup()':
cup.cpp:17:13: warning: unused variable 'ans' [-Wunused-variable]
   17 |         int ans = ask_shahrasb(mini + (1 << i), mini);
      |             ^~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB wrong cup location
2 Halted 0 ms 0 KB -