# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
432222 | 2021-06-18T04:15:19 Z | Amylopectin | Stations (IOI20_stations) | C++14 | 917 ms | 904 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,f,t; vector<int> lab(n); ru = 0; for(i=0; i<=n; i++) { pa[i].clear(); } for(i=0; i<n-1; i++) { f = u[i]; t = v[i]; pa[f].push_back(t); pa[t].push_back(f); } 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]; } } return c[n-1]; } 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 | Incorrect | 515 ms | 904 KB | Wrong query response. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 444 ms | 660 KB | Wrong query response. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 568 ms | 776 KB | Wrong query response. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 917 ms | 656 KB | Output is correct |
2 | Correct | 666 ms | 672 KB | Output is correct |
3 | Incorrect | 615 ms | 668 KB | Wrong query response. |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 536 ms | 800 KB | Wrong query response. |
2 | Halted | 0 ms | 0 KB | - |