Submission #718096

# Submission time Handle Problem Language Result Execution time Memory
718096 2023-04-03T10:15:16 Z Jarif_Rahman The Big Prize (IOI17_prize) C++17
0 / 100
69 ms 276 KB
#include "prize.h"
#include <bits/stdc++.h>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;

vector<vector<int>> asked;
vector<int> Ask(int i){
    if(asked[i].empty()) asked[i] = ask(i);
    return asked[i];
}

int find_best(int n){
    int p = 0;
    while(1){
        auto cur = ask(p);
        if(cur[0]+cur[1] == 0) return p;
        int a = p+1, b = n-1;
        while(a < b){
            int md = (a+b)/2;
            auto v = ask(md);
            if(v[0]+v[1] != cur[0]+cur[1]) b = md;
            else if(v[0] != v[1]) b = md-1;
            else a = md+1;
        }
        p = a;
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 43 ms 276 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 69 ms 208 KB Incorrect
2 Halted 0 ms 0 KB -