Submission #553356

#TimeUsernameProblemLanguageResultExecution timeMemory
553356FatihSolakFun Tour (APIO20_fun)C++17
26 / 100
141 ms20640 KiB
#include "fun.h" #include <bits/stdc++.h> #define N 505 using namespace std; bool used[N]; vector<int> createFunTour(int n, int q){ vector<pair<int,pair<int,int>>> v; for(int i = 0;i<n;i++){ for(int j = 0;j<n;j++){ v.push_back({hoursRequired(i,j),{i,j}}); } } sort(v.rbegin(),v.rend()); vector<int> ret; ret.push_back(v[0].second.first); ret.push_back(v[0].second.second); used[v[0].second.first] = 1; used[v[0].second.second] = 1; for(int i = 1;i<v.size();i++){ if(!used[v[i].second.first] && ret.back() == v[i].second.second){ used[v[i].second.first] = 1; ret.push_back(v[i].second.first); i = 0; } } return ret; }

Compilation message (stderr)

fun.cpp: In function 'std::vector<int> createFunTour(int, int)':
fun.cpp:19:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, std::pair<int, int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |  for(int i = 1;i<v.size();i++){
      |                ~^~~~~~~~~
#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...