# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
590068 | almothana05 | Stations (IOI20_stations) | C++14 | 902 ms | 724 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 "stations.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
vector<int> gr[2000] , num , de ;
int vis[2000];
int pl = -1;
void dfs(int x , int cmp){
de.push_back(x);
vis[x] = 1;
// cout << x << ' ' << cmp << "\n";
pl++;
if(cmp == 0){
num[x] = pl;
}
// cout << 1 << ' ';
for(int i = 0 ; i< gr[x].size() ; i++){
int kind = gr[x][i];
if(vis[kind] == 0){
dfs(kind , cmp ^ 1);
}
}
pl++;
// assert(pl > 0);
if(cmp == 1){
num[x] = pl;
}
while(num[x] == -1);
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |