제출 #429985

#제출 시각아이디문제언어결과실행 시간메모리
429985Sundavar즐거운 행로 (APIO20_fun)C++14
26 / 100
332 ms524292 KiB
#include "fun.h" #include <bits/stdc++.h> using namespace std; typedef pair<int,int> pii; vector<int> createFunTour(int N, int Q) { if(N <= 500){ vector<vector<int> > t(N, vector<int>(N)); pii start = {-1, 0}; for(int i = 0; i < N; i++) for(int j = 0; j < N; j++) t[i][j] = hoursRequired(i,j), start = max(start, {t[i][j], i}); vector<bool> alive(N, true); int poz = start.second; vector<int> ans(N, 0); for(int x = 0; x < N; x++){ ans[x] = poz; alive[poz] = false; pii best = {-1, 0}; for(int i = 0; i < N; i++) if(alive[i]) best = max(best, {t[poz][i], i}); poz = best.second; } return ans; } }

컴파일 시 표준 에러 (stderr) 메시지

fun.cpp: In function 'std::vector<int> createFunTour(int, int)':
fun.cpp:25:1: warning: control reaches end of non-void function [-Wreturn-type]
   25 | }
      | ^
#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...