제출 #436115

#제출 시각아이디문제언어결과실행 시간메모리
436115AmineWeslati즐거운 행로 (APIO20_fun)C++14
26 / 100
422 ms524292 KiB
#include "fun.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int>vi; #define pb push_back #define sz(v) (int)v.size() #define all(x) begin(x),end(x) #define FOR(i,a,b) for(int i=a; i<b; i++) #define ROF(i,a,b) for(int i=b-1; i>=a; i--) //---------------------- vi createFunTour(int N, int Q) { int dist[N][N]; FOR(i,0,N) FOR(j,i,N){ if(i==j) dist[i][j]=0; else dist[i][j]=dist[j][i]=hoursRequired(i,j); } int u=0; vi vis(N,0),ans; while(1){ int v=u; FOR(i,0,N) if(!vis[i] && dist[u][i]>dist[u][v]){ v=i; } if(v==u) break; vis[v]=1; ans.pb(v); u=v; } /*for(auto x: ans) cout << x << ' '; cout << endl;*/ return ans; }
#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...