Submission #526533

#TimeUsernameProblemLanguageResultExecution timeMemory
526533beksultan04Fun Tour (APIO20_fun)C++14
0 / 100
0 ms204 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[1003][1001],n,used[1001]; 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; dfs(1003,INF); 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...