Submission #298465

# Submission time Handle Problem Language Result Execution time Memory
298465 2020-09-12T23:12:29 Z medk The Big Prize (IOI17_prize) C++14
20 / 100
72 ms 384 KB
#include <bits/stdc++.h>
#include "prize.h"

#define ll long long
#define pb push_back
#define x first
#define y second
#define sz(u) (int)(u.size())
#define all(u) u.begin(),u.end()

using namespace std;

vector<int> tmp;

int find_best(int N){
    int ptr=0;
    int curL=1, curR=1;
    while(1){
        tmp=ask(ptr);
        if(tmp[0]+tmp[1]==0) break;
        curL=tmp[0];
        curR=tmp[1];
        int l=0,r=N-1;
        while(l<r){
            int md=(l+r+1)/2;
            tmp=ask(md);
            if(tmp[0]!=curL || tmp[1]!=curR) r=md-1;
            else l=md;
        }
        ptr=l+1;
    }
    return ptr;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 1 ms 256 KB Output is correct
6 Correct 0 ms 256 KB Output is correct
7 Correct 1 ms 256 KB Output is correct
8 Correct 1 ms 256 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
10 Correct 1 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 1 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 1 ms 256 KB Output is correct
8 Correct 1 ms 256 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
10 Correct 1 ms 256 KB Output is correct
11 Incorrect 72 ms 256 KB Incorrect
12 Halted 0 ms 0 KB -