Submission #797604

#TimeUsernameProblemLanguageResultExecution timeMemory
797604XJP12Thousands Islands (IOI22_islands)C++17
Compilation error
0 ms0 KiB
variant<bool,vector<int>> find_journey(int n, int m, vector<int> u, vector<int> v){
	bool ban=false;
	int ban1=0;
	int a=-1,b=-1,c=-1;
	for(int i=0; i<m; i++){
		if(u[i]==0){
			ban1++;
			if(a==-1){
				a=i;
			}else{
				b=i;
			}
		}else{
			ban=true;
			c=i;
		}
	}
	vector<int> x(6);
	struct ans s;
	if(ban==true && ban1>1){
		x={a,c,b,a,c,b};
		s.bani=true;
		s.v=x;
		return s.v;
	}else{
		s.bani=false;
		return s.bani;
	}
}

Compilation message (stderr)

islands.cpp:1:1: error: 'variant' does not name a type
    1 | variant<bool,vector<int>> find_journey(int n, int m, vector<int> u, vector<int> v){
      | ^~~~~~~