Submission #728559

#TimeUsernameProblemLanguageResultExecution timeMemory
728559groguThousands Islands (IOI22_islands)C++17
Compilation error
0 ms0 KiB
#include "islands.h" #define dbg(x) cerr<<#x<<": "<<x<<endl #include <bits/stdc++.h> #define ll int #define pll pair<ll,ll> #include <vector> #include <variant> using namespace std; #define maxn 405 ll n,m; vector<ll> g[maxn]; ll id[maxn][maxn]; variant<bool, vector<int>> find_journey(int N, int M, vector<int> U, vector<int> V) { return n&1; n = N; m = M; for(ll i = 0;i<m;i++){ ll x = U[i],y = V[i]; x++; y++; g[x].pb(y); g[y].pb(x); id[x][y] = i; } for(ll i = 0;i<(n-1)/2;i++){ dfs() } }

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:16:13: error: could not convert '(n & 1)' from 'int' to 'std::variant<bool, std::vector<int, std::allocator<int> > >'
   16 |     return n&1;
      |            ~^~
      |             |
      |             int
islands.cpp:22:14: error: 'class std::vector<int>' has no member named 'pb'
   22 |         g[x].pb(y);
      |              ^~
islands.cpp:23:14: error: 'class std::vector<int>' has no member named 'pb'
   23 |         g[y].pb(x);
      |              ^~
islands.cpp:27:9: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
   27 |         dfs()
      |         ^~~
      |         ffs