Submission #592168

#TimeUsernameProblemLanguageResultExecution timeMemory
592168PiejanVDCStations (IOI20_stations)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "stations.h" using namespace std; vector<int>label(int n, int k, vectro<int>u, vector<int>v) { vector<int>adj[n]; for(int i = 0 ; i < (int)u.size() ; i++) { adj[u[i]].push_back(v[i]); adj[v[i]].push_back(u[i]); } int start; for(int i = 0 ; i < n ; i++) { if((int)adj[i].size() == 1) start = i; } vector<int>l(n); vectro<bool>vis(n, 0); for(int i = 0 ; i < n ; i++) { vis[start] = 1; l[start] = i; for(auto z : adj[start]) if(!vis[z]) start = z; } return l; } int find_next_station(int s, int t, vector<int>c) { if(s < t) return c[1]; return c[0]; }

Compilation message (stderr)

stations.cpp:5:32: error: 'vectro' has not been declared
    5 | vector<int>label(int n, int k, vectro<int>u, vector<int>v) {
      |                                ^~~~~~
stations.cpp:5:38: error: expected ',' or '...' before '<' token
    5 | vector<int>label(int n, int k, vectro<int>u, vector<int>v) {
      |                                      ^
stations.cpp: In function 'std::vector<int> label(int, int, int)':
stations.cpp:8:30: error: 'u' was not declared in this scope
    8 |     for(int i = 0 ; i < (int)u.size() ; i++) {
      |                              ^
stations.cpp:9:29: error: 'v' was not declared in this scope
    9 |         adj[u[i]].push_back(v[i]);
      |                             ^
stations.cpp:22:5: error: 'vectro' was not declared in this scope
   22 |     vectro<bool>vis(n, 0);
      |     ^~~~~~
stations.cpp:22:12: error: expected primary-expression before 'bool'
   22 |     vectro<bool>vis(n, 0);
      |            ^~~~
stations.cpp:25:9: error: 'vis' was not declared in this scope
   25 |         vis[start] = 1;
      |         ^~~