# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
240939 | brcode | Izlet (COI19_izlet) | C++14 | 731 ms | 72568 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
const int MAXN =5e3+5;
int dist[MAXN][MAXN];
vector<int> v1[MAXN];
int cnt[MAXN];
int col[MAXN];
vector<pair<int,int>> edges;
bool visited[MAXN];
int p[MAXN];
int n;
int nxt;
int sz[MAXN];
void colour(int a,int b,int c){
if(cnt[col[b]] == 0 && dist[a][b] == dist[a][c]){
col[a] = col[b];
}
if(c!=-1){
cnt[col[b]]++;
}
for(int x:v1[b]){
if((!visited[x])||x==c){
continue;
}
colour(a,x,b);
}
if(c!=-1){
cnt[col[b]]--;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |