Submission #571159

#TimeUsernameProblemLanguageResultExecution timeMemory
571159grtFun Tour (APIO20_fun)C++17
26 / 100
125 ms19448 KiB
//GRT_2018 #include <bits/stdc++.h> #include "fun.h" #define PB push_back #define ST first #define ND second //mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); using namespace std; using ll = long long; using pi = pair<int,int>; using vi = vector<int>; //int hoursRequired(int x, int y) { //cout << x << " " << y << endl; //int w; //cin >> w; //return w; //} set<int>aval; int furthest(int x) { int w = x, d = 0; for(int y : aval) { if(y == x) continue; int p = hoursRequired(x, y); if(p > d) d = p, w = y; } return w; } vi createFunTour(int n, int q) { for(int i = 0; i < n; ++i) aval.insert(i); int x = furthest(0); vi ans(n); for(int i = 0; i < n; ++i) { ans[i] = x; aval.erase(x); x = furthest(x); } return ans; } //int main() { //ios_base::sync_with_stdio(0); //cin.tie(0); //auto v = createFunTour(7, 1); //for(int x : v) cout << x << " "; //}
#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...