# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
593827 |
2022-07-11T16:04:33 Z |
1ne |
Stations (IOI20_stations) |
C++14 |
|
3000 ms |
2097152 KB |
#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
vector<int> labels(n);
vector<vector<int>>adj(n);
for (int i = 0;i<n;++i){
adj[u[i]].push_back(v[i]);
adj[v[i]].push_back(u[i]);
}
int time = 0;
function<void(int,int)>dfs = [&](int x,int par){
labels[x] = time++;
for (auto y:adj[x]){
if (y == par)continue;
dfs(y,x);
}
};
dfs(0,-1);
return labels;
}
int find_next_station(int s, int t, std::vector<int> c) {
if ((int)c.size() == 1)return c[0];
if ((int)c.size() == 2){
if (c[0] > c[1] && c[0] <= t){
return c[0];
}
if (c[1] > c[0] && c[1] <=t){
return c[1];
}
if (c[0] <= t)return c[0];
return c[1];
}
return c[0];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
684 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3031 ms |
167716 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
584 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
886 ms |
512 KB |
Output is correct |
2 |
Correct |
678 ms |
508 KB |
Output is correct |
3 |
Incorrect |
612 ms |
416 KB |
Wrong query response. |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2384 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |