Submission #797590

#TimeUsernameProblemLanguageResultExecution timeMemory
797590OspleiThousands Islands (IOI22_islands)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
 
using namespace std;
 
typedef pair<int,int> ii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii; 
typedef vector<vii> wgraf;
typedef pair<int,ii> edge;
typedef vector <ll> vl;
typedef pair <ll, ll> LL;
typedef vector <LL> vll;
 
#define UNVISITED 0
#define VISITED 1
#define pb push_back
#define F first
#define S second

union(bool, int[]) find_journey(int N, int M, int[] U, int[] V){
	
	vector <int> ans;
	
	if (N==2){
		if ((U[0]>=2 && V[1]>=1) || (V[0]>=2 && U[1]>=1)) {
			
			
			ans.pb(1);
			ans.pb(0);
			ans.pb(1);
			ans.pb(0);
			ans.pb(1);
			ans.pb(0);

			return {true, ans};

		} else return {false, ans};
	} else return {true, ans};
}

Compilation message (stderr)

islands.cpp:22:6: error: expected identifier before '(' token
   22 | union(bool, int[]) find_journey(int N, int M, int[] U, int[] V){
      |      ^
islands.cpp:22:7: error: expected unqualified-id before 'bool'
   22 | union(bool, int[]) find_journey(int N, int M, int[] U, int[] V){
      |       ^~~~
islands.cpp:22:7: error: expected ')' before 'bool'
   22 | union(bool, int[]) find_journey(int N, int M, int[] U, int[] V){
      |      ~^~~~
      |       )