Submission #526552

#TimeUsernameProblemLanguageResultExecution timeMemory
526552beksultan04Fun Tour (APIO20_fun)C++14
10 / 100
2074 ms2252 KiB
#include "fun.h" //#include "grader.cpp" #include <bits/stdc++.h> #define ret return #define fr first #define sc second #define pb push_back #define endi puts(""); #define NO puts("NO"); #define OK puts("OK"); using namespace std; const int INF = 1e5+12; bool asa,ll=0; int dis[1103][1001],n,used[1201]; vector <int> ans; void dfs(int x,int dl){ if (ll == 1)ret ; if (ans.size() == n){ ll = 1; ret ; } for (int i=0;i<n;++i){ if (x == i || used[i])continue; if (!dis[x][i]){ dis[x][i] = hoursRequired(x,i); dis[i][x] = dis[x][i]; } if (dl >= dis[x][i]){ used[i] = 1; ans.pb(i); dfs(i,dis[x][i]); if (ll == 1)ret ; ans.pop_back(); used[i] = 0; } } } vector<int> createFunTour(int N, int Q) { n = N; for (int i = 0;i < n;++i){ ans.pb(i); used[i] = 1; dfs(i,1000000); if (ll == 1)break; used[i] = 0; ans.pop_back(); } ret ans; }

Compilation message (stderr)

fun.cpp: In function 'void dfs(int, int)':
fun.cpp:20:20: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |     if (ans.size() == n){
      |         ~~~~~~~~~~~^~~~
#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...