Submission #1080236

#TimeUsernameProblemLanguageResultExecution timeMemory
1080236Sir_Ahmed_ImranStations (IOI20_stations)C++17
0 / 100
1588 ms2097152 KiB
///~~~LOTA~~~/// //#include "mushrooms.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define append push_back #define add insert #define nl '\n' #define ff first #define ss second #define pii pair<int,int> #define pll pair<ll,ll> #define all(x) (x).begin(),(x).end() #define L0TA ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define terminator main #define N 1000 int m; int e[N]; vector<int> l; vector<int> a[N]; void dfs(int v,int u){ l[v]=m; m++; for(auto& i:a[v]) if(i!=u) dfs(i,v); } vector<int> label(int n,int k,vector<int> u,vector<int> v){ for(int i=m=0;i<n;i++){ a[v[i]].append(u[i]); a[u[i]].append(v[i]); l.append(i); e[v[i]]++; e[u[i]]++; } for(int i=0;i<n;i++){ if(e[i]>1) continue; dfs(i,-1); } return(l); } int find_next_station(int s,int t,vector<int> c){ return s-(s>t)+(t>s); }
#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...