제출 #553356

#제출 시각아이디문제언어결과실행 시간메모리
553356FatihSolak즐거운 행로 (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; }

컴파일 시 표준 에러 (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...