Submission #1352057

#TimeUsernameProblemLanguageResultExecution timeMemory
1352057KALARRY커다란 상품 (IOI17_prize)C++20
Compilation error
0 ms0 KiB
//chockolateman

#include<bits/stdc++.h>
// #include "prize.h"

using namespace std;

int search(int start,int end)
{
    vector<int> temp;
    for(int i = 0 ; i <= end ; i++)
    {
        temp = ask(i);
        if(temp[0]==0 && temp[1]==0)
            return i;
    }
    if(start > end)
        return -1;
    int mid = (start + end)/2;
    temp = ask(mid);
    // vector<int> temp = ask(mid);
    if(temp[0]==0 && temp[1]==0)
        return mid;
    return max(search(start,mid-1),search(mid+1,end));
}

int find_best(int n) {
	return search(0,n-1);
}

Compilation message (stderr)

prize.cpp: In function 'int search(int, int)':
prize.cpp:13:16: error: 'ask' was not declared in this scope
   13 |         temp = ask(i);
      |                ^~~
prize.cpp:20:12: error: 'ask' was not declared in this scope
   20 |     temp = ask(mid);
      |            ^~~