제출 #1358623

#제출 시각아이디문제언어결과실행 시간메모리
1358623KasymK즐거운 행로 (APIO20_fun)C++20
26 / 100
13 ms1352 KiB
#include "bits/stdc++.h"
#include "fun.h"
using namespace std;
#define ff first
#define ss second    
#define all(v) v.begin(), v.end()
#define ll long long
#define pb push_back
#define pii pair<int, int>
#define pli pair<ll, int>
#define pll pair<ll, ll>
#define tr(i, c) for(auto i = c.begin(); i != c.end(); ++i)
#define wr puts("----------------")
#define mm make_pair
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
int dist[505][505];
bool chk[505];

vector<int> createFunTour(int N, int Q){
  int mx=0,st=0;
    for(int i = 0; i < N; ++i)
        for(int j = 0; j < N; ++j){
            dist[i][j]=hoursRequired(i,j);
            if(umax(mx, dist[i][j]))
                st=i;
        }
    vector<int> ans;
    ans.pb(st);
    chk[st]=1;
    for(int i = 1; i < N; ++i){
        mx=0;
        for(int j = 0; j < N; ++j){
            if(chk[j])
                continue;
            if(dist[ans.back()][j]>mx)
                mx=dist[ans.back()][j], st=j;
        }
        ans.pb(st), chk[st]=1;
    }
    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...