Submission #1060872

# Submission time Handle Problem Language Result Execution time Memory
1060872 2024-08-16T03:52:19 Z onbert The Big Prize (IOI17_prize) C++17
Compilation error
0 ms 0 KB
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;

int find_best(int n) {
    int l = 0, r = n-1;
    while (l<r) {
        int mid = (l+r)/2;
        vector<int> val = ask(mid);
        if (val[0] + val[1]==n-1) return mid;
        if (val[0] < i) r = mid-1;
        else l = mid+1;
    }
    return l;
}

Compilation message

prize.cpp: In function 'int find_best(int)':
prize.cpp:11:22: error: 'i' was not declared in this scope
   11 |         if (val[0] < i) r = mid-1;
      |                      ^