# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
413202 | 2021-05-28T11:07:52 Z | losmi247 | Stations (IOI20_stations) | C++14 | 3000 ms | 1644980 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1005; int deg[N]; vector <int> g[N]; vector <int> label(int n,int k,vector <int> u,vector <int> v){ for(int i = 0; i < n-1; i++){ deg[u[i]]++, deg[v[i]]++; g[u[i]].push_back(v[i]); g[v[i]].push_back(u[i]); } bool prvi = 1; for(int i = 0; i < n; i++) if(deg[i] > 2) prvi = 0; if(prvi){ int cnt = 0; vector <int> l(n); queue <pair<int,int>> q; for(int i = 0; i < n; i++){ if(deg[i] == 1){ q.push({i,0}); break; } } while(!q.empty()){ int u = q.front().first,par = q.front().second; l[u] = cnt++; q.pop(); for(auto v : g[u]){ if(v == par) continue; q.push({v,u}); } } return l; } } int find_next_station(int s,int t,vector <int> c){ if(s < t){ return s+1; } else{ return s-1; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3061 ms | 625824 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3133 ms | 1644980 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3034 ms | 316 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 320 KB | Invalid labels (duplicates values). scenario=1, label=0 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3045 ms | 36408 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |