제출 #1072619

#제출 시각아이디문제언어결과실행 시간메모리
1072619pasin30055즐거운 행로 (APIO20_fun)C++14
26 / 100
8 ms2396 KiB
#include "fun.h" #include <vector> #define MAXN 505 int a[MAXN][MAXN]; bool isused[MAXN]; std::vector<int> createFunTour(int N, int Q) { std::vector<int> V; if (Q >= N * (N - 1) / 2) { for (int i = 0 ; i < N ; i ++) { isused[i] = 0; for (int j = i + 1 ; j < N ; j ++) { a[i][j] = a[j][i] = hoursRequired(i, j); } } V.push_back(0); for (int i = 1 ; i <= N ; i ++) { int mj = -1; for (int j = 0 ; j < N ; j ++) { if (!isused[j]) { if (mj == -1 || a[V[i - 1]][mj] < a[V[i - 1]][j]) mj = j; } } V.push_back(mj); isused[mj] = 1; } V.erase(V.begin()); } return V; }
#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...