Submission #526526

#TimeUsernameProblemLanguageResultExecution timeMemory
526526beksultan04Fun Tour (APIO20_fun)C++14
Compilation error
0 ms0 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[1001][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(0,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){
      |         ~~~~~~~~~~~^~~~
/usr/bin/ld: /tmp/ccOl8aWw.o: in function `hoursRequired(int, int)':
grader.cpp:(.text+0x2d0): multiple definition of `hoursRequired(int, int)'; /tmp/ccC3vBMw.o:fun.cpp:(.text+0x2d0): first defined here
/usr/bin/ld: /tmp/ccOl8aWw.o: in function `attractionsBehind(int, int)':
grader.cpp:(.text+0x3d0): multiple definition of `attractionsBehind(int, int)'; /tmp/ccC3vBMw.o:fun.cpp:(.text+0x3d0): first defined here
/usr/bin/ld: /tmp/ccOl8aWw.o: in function `my_assert(bool)':
grader.cpp:(.text+0x580): multiple definition of `my_assert(bool)'; /tmp/ccC3vBMw.o:fun.cpp:(.text+0x580): first defined here
/usr/bin/ld: /tmp/ccOl8aWw.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccC3vBMw.o:fun.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status