Submission #431524

#TimeUsernameProblemLanguageResultExecution timeMemory
431524HazemCarnival Tickets (IOI20_tickets)C++14
11 / 100
2 ms588 KiB
#include "tickets.h" #include <vector> #include <bits/stdc++.h> #define LL long long using namespace std; vector<LL>vec; vector<vector<int>>vec1; long long find_maximum(int k, std::vector<std::vector<int>> x) { int n = x.size(); vec1 = x; for(int i=0;i<n;i++) vec.push_back(x[i][0]),vec1[i][0] = 0; sort(vec.begin(),vec.end()); LL ans = 0; for(int i=0;i<vec.size();i++) ans += abs(vec[i]-vec[vec.size()/2]); allocate_tickets(vec1); return ans; }

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:21:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |  for(int i=0;i<vec.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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...