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"
#define FOR(i,l,r) for(int i=(l); i<=(r); ++i)
#define REP(i,l,r) for(int i=(l); i<(r); ++i)
#define FORD(i,r,l) for(int i=(r); i>=(l); --i)
#define REPD(i,r,l) for(int i=(r)-1; i>=(l); --i)
using namespace std;
const int maxN = 1e5 + 5;
int n, isans[maxN];
vector<int> Ans;
vector<int> sub12() {
int u = 0;
REP(i, 0, n) {
int maxi = -1, unext = -1;
REP(j, 0, n) if (!isans[j]) {
int tmp = hoursRequired(u, j);
if (tmp > maxi) maxi = tmp, unext = j;
}
u = unext;
Ans.push_back(u);
isans[u] = 1;
}
return Ans;
}
vector<int> createFunTour(int N, int Q) {
n = N;
if (n <= 500) return sub12();
int H = hoursRequired(0, N - 1);
int A = attractionsBehind(0, N - 1);
return vector<int>(N);
}
Compilation message (stderr)
fun.cpp: In function 'std::vector<int> createFunTour(int, int)':
fun.cpp:30:9: warning: unused variable 'H' [-Wunused-variable]
30 | int H = hoursRequired(0, N - 1);
| ^
fun.cpp:31:9: warning: unused variable 'A' [-Wunused-variable]
31 | int A = attractionsBehind(0, N - 1);
| ^
# | 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... |