Submission #615269

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6152692022-07-31 08:07:48alirezasamimi100Stations (IOI20_stations)C++17
0 / 100
883 ms668 KiB
#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
const int N = 1e3 + 10;
int t=-1;
vector<int> ans,adj[N];
void dfs(int v, int p, int c){
if(!c) ans[v]=++t;
for(int u : adj[v]) if(u!=p) dfs(u,v,1-c);
if(c) ans[v]=++t;
}
vector<int> label(int n, int k, vector<int> u, vector<int> v) {
ans.resize(n);
t=-1;
for(int i=0; i<n; i++) adj[i].clear();
for(int i=0; i<(int)v.size(); i++){
adj[v[i]].pb(u[i]);
adj[u[i]].pb(v[i]);
}
dfs(0,-1,0);
return ans;
}
int find_next_station(int s, int t, vector<int> c) {
int k;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...