# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
313985 | 2020-10-17T17:20:34 Z | dlwocks31 | 기지국 (IOI20_stations) | C++17 | 3000 ms | 2097156 KB |
#include "stations.h" #include <bits/stdc++.h> using namespace std; vector<int> adj[1000]; int lbl[1000], cnt; void dfs(int i, int p, int d) { if(d % 2 == 0) lbl[i] = cnt++; for(int a: adj[i]) { if(a == p) continue; dfs(a, i, d+1); } if(d % 2 == 1) lbl[i] = cnt++; } vector<int> label(int n, int k, vector<int> u, vector<int> v) { vector<int> labels(n); for(int i=0; i<u.size(); i++) { //printf("edge = %d, %d\n", u[i], v[i]); adj[u[i]].push_back(v[i]); adj[v[i]].push_back(u[i]); } dfs(0, -1, 0); for(int i=0; i<n; i++) { //printf("label %d = %d\n", i, lbl[i]); labels[i] = lbl[i]; } return labels; } int find_next_station(int s, int t, vector<int> c) { if(c[0] > s) { // s is out reverse(c.begin(), c.end()); } c.insert(c.begin(), s); for(int i=1; i<c.size(); i++) { if(c[i-1] <= t && t <= c[i]) { return c[i]; } } return c.back(); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1559 ms | 2097156 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3067 ms | 628 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1490 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 | 913 ms | 876 KB | Output is correct |
2 | Runtime error | 1256 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 | 2404 ms | 2097152 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |