Submission #1058271

#TimeUsernameProblemLanguageResultExecution timeMemory
1058271nvujicaThousands Islands (IOI22_islands)C++17
Compilation error
0 ms0 KiB
#include "islands.h" #include <variant> #include <vector> using namespace std; const int maxn = 1e5 + 10; pair<int, int> adj[maxn]; map<pair<int, int> , int> mp; variant<bool, std::vector<int>> find_journey(int n, int m, vector<int> u, vector<int> v)( for(int i = 0; i < m; i++){ mp[{u[i], v[i]}] = i; } if(n == 2) return 0; return {mp[{0, 1}], mp[{1, 0}], mp[{0, 2}], mp[{2, 0}], mp[{0, 1}], mp[{1, 0}], mp[{0, 2}], mp[{2, 0}]}; }

Compilation message (stderr)

islands.cpp:11:1: error: 'map' does not name a type
   11 | map<pair<int, int> , int> mp;
      | ^~~
islands.cpp:13:89: error: initializer provided for function
   13 | variant<bool, std::vector<int>> find_journey(int n, int m, vector<int> u, vector<int> v)(
      |                                                                                         ^
islands.cpp:14:17: error: 'i' does not name a type
   14 |  for(int i = 0; i < m; i++){
      |                 ^
islands.cpp:14:24: error: 'i' does not name a type
   14 |  for(int i = 0; i < m; i++){
      |                        ^
islands.cpp:18:2: error: expected unqualified-id before 'if'
   18 |  if(n == 2) return 0;
      |  ^~
islands.cpp:20:2: error: expected unqualified-id before 'return'
   20 |  return {mp[{0, 1}], mp[{1, 0}], mp[{0, 2}], mp[{2, 0}], mp[{0, 1}], mp[{1, 0}], mp[{0, 2}], mp[{2, 0}]};
      |  ^~~~~~
islands.cpp:21:1: error: expected declaration before '}' token
   21 | }
      | ^