Submission #117263

#TimeUsernameProblemLanguageResultExecution timeMemory
117263WongHokFong_cpp커다란 상품 (IOI17_prize)C++14
Compilation error
0 ms0 KiB
#include <iostream>
#include "prize.h"
#include <vector>
vector <int> res;
int find_best(int n)
{
	int l=0,r=n-1;
	do
	{
		int mid=(l+r)/2;
		res=ask(mid);
		if (res[1]>0) r=mid;
		else if (res[2]>0) l=mid;
		else return mid; 
	}
	while (l<r);
}

Compilation message (stderr)

prize.cpp:4:1: error: 'vector' does not name a type; did you mean 'perror'?
 vector <int> res;
 ^~~~~~
 perror
prize.cpp: In function 'int find_best(int)':
prize.cpp:11:3: error: 'res' was not declared in this scope
   res=ask(mid);
   ^~~
prize.cpp:11:3: note: suggested alternative: 'free'
   res=ask(mid);
   ^~~
   free
prize.cpp:17:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^