Submission #41847

# Submission time Handle Problem Language Result Execution time Memory
41847 2018-02-21T15:12:26 Z rahasia The Big Prize (IOI17_prize) C++14
Compilation error
0 ms 0 KB
#include "prize.h"
#include<bits/stdc++.h>
using namespace std;
int l,r,c,ma,b[202020];
vector<int> d[202020];
int find_best(int n) {
	for(int i = 0; i < n; i++) {
		if(b[i]==0)
		{
			b[i]=1;
			std::vector<int> d[i] = ask(i);
		}
		res=d[i];
		if(res[0] + res[1] == 0)
			return i;
		l=i+1;
		r=n-1;
		while(l<=r)
		{
			c=(l+r)/2;
			if(b[c]==0)
			{
				b[c]=1;
				d[c]=ask(c);
			}
			vector<int> hv=d[c];
			if(hv==res)
			{
				i=c;
				l=c+1;
			}
			else
				r=c-1;
		}
	}
	return 0;
}

Compilation message

prize.cpp: In function 'int find_best(int)':
prize.cpp:13:3: error: 'res' was not declared in this scope
   res=d[i];
   ^