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"
#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 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... |