Submission #797657

#TimeUsernameProblemLanguageResultExecution timeMemory
797657OspleiThousands 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 struct nodo{ int v, id; }; variant <bool, vector <int>> find_journey(int N, int M, vector <int> U, vector <int> V){ vector <int> ans; if (N<=400){ vector <nodo> grafo[N+5]; for (int i=0; i<M; i++) { grafo[U[i]].pb({V[i], i}); } if (cont0>=2 && cont1>=1){ ans.pb(grafo[0][0].id); ans.pb(grafo[grafo[0][0].v][0].id); ans.pb(grafo[0][1].id); ans.pb(grafo[grafo[0][1].v][0].id); ans.pb(grafo[grafo[0][0].v][0].id); ans.pb(grafo[0][0].id); ans.pb(grafo[grafo[0][1].v][0].id); ans.pb(grafo[0][1].id); return ans; } else return false; } else return false; }

Compilation message (stderr)

islands.cpp: In function 'std::variant<bool, std::vector<int, std::allocator<int> > > find_journey(int, int, std::vector<int>, std::vector<int>)':
islands.cpp:38:7: error: 'cont0' was not declared in this scope
   38 |   if (cont0>=2 && cont1>=1){
      |       ^~~~~
islands.cpp:38:19: error: 'cont1' was not declared in this scope
   38 |   if (cont0>=2 && cont1>=1){
      |                   ^~~~~
islands.cpp:28:15: warning: control reaches end of non-void function [-Wreturn-type]
   28 |  vector <int> ans;
      |               ^~~