# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
320484 | 2020-11-08T20:44:20 Z | Ambok | 기지국 (IOI20_stations) | C++14 | 3000 ms | 2097156 KB |
#include <stations.h> #include <bits/stdc++.h> using namespace std; int coun=0; vector < vector <int> > vec(1000); vector <int> L(1000); void dfs (int x, int y, int h) { if (h%2==0) L[x]=coun; coun++; for (int i=0; i<vec[x].size(); i++) { if (vec[x][i]==y) continue; dfs(vec[x][i], x, h+1); } if (h%2==1) L[x]=coun; h--; coun++; } vector <int> label(int n, int k, vector <int> u, vector <int> v) { int s, h, i; L.resize(n); vec.resize(n); for (i=0; i<n-1; i++) { vec[u[i]].push_back(v[i]); vec[v[i]].push_back(u[i]); } L[0]=0; coun=0; dfs (0, -1, 0); return L; } int find_next_station(int s, int t, vector <int>c) { int n=c.size(), i; int in[n+1], out[n+1]; if (s>c[n-1]) { in[n]=c[1]-1; out[n]=s; for (i=0; i<n; i++) in[i]=c[i]; for (i=1; i<n; i++) { out[i]=in[i+1]-1; } if (t>in[n] && t<out[n]) { for (i=1; i<n; i++) { if (t>=in[i] && t<=out[i]) return c[i]; } } else return c[0]; } else { in[n]=s; out[n]=c[n-2]+1; for (i=0; i<n; i++) out[i]=c[i]; in[0]=s+1; for (i=1; i<n; i++) { in[i]=out[i-1]+1; } if (t>in[n] && t<out[n]) { for (i=0; i<n-1; i++) { if (t>=in[i] && t<=out[i]) return c[i]; } } else return c[n-1]; } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 492 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3032 ms | 1880 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1474 ms | 2097152 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 884 ms | 864 KB | Output is correct |
2 | Runtime error | 1227 ms | 2097156 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 2743 ms | 2097156 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |