Submission #898654

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8986542024-01-05 00:20:37OAleksaFun Tour (APIO20_fun)C++14
0 / 100
1 ms348 KiB
#include "fun.h"
#include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
vector<int> createFunTour(int N, int Q) {
int n = N;
int cen = 0;
if (n == 2)
return {0, 1};
for (int i = 1;i < n;i++) {
if (attractionsBehind(cen, i) * 2 >= n)
cen = i;
}
vector<int> dis(n);
for (int i = 0;i < n;i++) {
if (i == cen)
continue;
dis[i] = hoursRequired(cen, i);
}
vector<int> p;
for (int i = 0;i < n;i++) {
if (dis[i] == 1) {
p.push_back(i);
}
}
int m = p.size();
vector<int> ch[m];
for (int i = 0;i < n;i++) {
if (i == cen)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

fun.cpp: In function 'std::vector<int> createFunTour(int, int)':
fun.cpp:37:13: warning: unused variable 'x' [-Wunused-variable]
   37 |         int x = hoursRequired(p[j], i);
      |             ^
#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...