# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
432217 | 2021-06-18T03:40:33 Z | Amylopectin | Stations (IOI20_stations) | C++14 | 3000 ms | 2097156 KB |
#include <iostream> #include <vector> #include "stations.h" //#include "stub.cpp" using namespace std; const int mxn = 2010; vector <int> pa[mxn] = {}; int clab[mxn] = {},ru = 0; int re(int cn,int sta,int be) { int i,fn; if(sta == 0) { clab[cn] = ru; ru ++; } for(i=0; i<pa[cn].size(); i++) { fn = pa[cn][i]; if(fn == be) { continue; } re(fn,(sta+1)%2,cn); } if(sta == 1) { clab[cn] = ru; ru ++; } return 0; } vector<int> label(int n, int k, vector<int> u, vector<int> v) { int i,j; vector<int> lab(n); for(i=0; i<n-1; i++) { pa[u[i]].push_back(v[i]); pa[v[i]].push_back(u[i]); } re(0,0,-1); for (i = 0; i < n; i++) { lab[i] = clab[i]; } return lab; } int find_next_station(int s, int t, vector<int> c) { int i,j,n = c.size(); if(s == 0) { for(i=0; i<n; i++) { if(t <= c[i]) { return c[i]; } } } if(s < c[0]) { for(i=0; i<n-1; i++) { if(t <= c[i]) { return c[i]; } } return c[n-1]; } for(i=n-1; i>0; i--) { if(t >= c[i]) { return c[i]; } } return c[0]; } //int main() //{ // cout << "Hello world!" << endl; // return 0; //}
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2257 ms | 2097156 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3047 ms | 452 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1404 ms | 2097156 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 880 ms | 656 KB | Output is correct |
2 | Runtime error | 1068 ms | 2097156 KB | Execution killed with signal 9 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2334 ms | 2097156 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |