# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
553356 | FatihSolak | Fun Tour (APIO20_fun) | C++17 | 141 ms | 20640 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 "fun.h"
#include <bits/stdc++.h>
#define N 505
using namespace std;
bool used[N];
vector<int> createFunTour(int n, int q){
vector<pair<int,pair<int,int>>> v;
for(int i = 0;i<n;i++){
for(int j = 0;j<n;j++){
v.push_back({hoursRequired(i,j),{i,j}});
}
}
sort(v.rbegin(),v.rend());
vector<int> ret;
ret.push_back(v[0].second.first);
ret.push_back(v[0].second.second);
used[v[0].second.first] = 1;
used[v[0].second.second] = 1;
for(int i = 1;i<v.size();i++){
if(!used[v[i].second.first] && ret.back() == v[i].second.second){
used[v[i].second.first] = 1;
ret.push_back(v[i].second.first);
i = 0;
}
}
return ret;
}
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... |