Submission #334104

#TimeUsernameProblemLanguageResultExecution timeMemory
334104rocks03Stations (IOI20_stations)C++14
0 / 100
933 ms1012 KiB
//#include "stations.h" #pragma GCC target("avx2") #pragma GCC optimization("O3") #pragma GCC optimization("unroll-loops") #include<bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int, int> #define pll pair<ll, ll> #define ff first #define ss second #define pb push_back #define SZ(x) ((int)(x).size()) #define all(x) x.begin(), x.end() mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int t; vector<vector<int>> g; void dfs(int v, int p, vector<int>& labels){ for(auto u : g[v]){ if(u == p) continue; dfs(u, v, labels); } labels[v] = t++; } vector<int> label(int n, int k, vector<int> u, vector<int> v){ g.resize(n); for(int i = 0; i < n; i++){ g[i].clear(); } for(int i = 0; i < n-1; i++){ g[u[i]].pb(v[i]); g[v[i]].pb(u[i]); } vector<int> labels(n); t = 0; dfs(0, -1, labels); return labels; } int find_next_station(int s, int t, vector<int> c){ for(auto x : c){ if(x >= t) return x; } return c.back(); }

Compilation message (stderr)

stations.cpp:3: warning: ignoring #pragma GCC optimization [-Wunknown-pragmas]
    3 | #pragma GCC optimization("O3")
      | 
stations.cpp:4: warning: ignoring #pragma GCC optimization [-Wunknown-pragmas]
    4 | #pragma GCC optimization("unroll-loops")
      |
#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...