Submission #660090

#TimeUsernameProblemLanguageResultExecution timeMemory
660090aryan12Carnival Tickets (IOI20_tickets)C++17
11 / 100
1 ms724 KiB
#include "tickets.h" #include <vector> #include <bits/stdc++.h> using namespace std; long long find_maximum(int k, vector<vector<int> > x) { long long n = x.size(), m = x[0].size(); vector<vector<int> > ans(n, vector<int> (m, 0)); if(k == 1) { vector<long long> res; for(long long i = 0; i < x.size(); i++) { res.push_back(x[i][0]); } sort(res.begin(), res.end()); long long idx = n / 2; long long final_ans = 0; for(long long i = 0; i < n; i++) { final_ans += abs(res[idx] - res[i]); } allocate_tickets(ans); return final_ans; } return -1; }

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:13:26: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |   for(long long i = 0; i < x.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...