Submission #603776

#TimeUsernameProblemLanguageResultExecution timeMemory
603776CyberCowCarnival Tickets (IOI20_tickets)C++17
11 / 100
3 ms596 KiB
#include "tickets.h" #include <vector> #include <cmath> using namespace std; using ll = long long; ll n; ll qaq(vector<ll> qaqa) { ll polni = 1000000000000000000LL; for (int i = 0; i < qaqa.size(); i++) { ll chsh = 0; for (int j = 0; j < qaqa.size(); j++) { chsh += abs(qaqa[i] - qaqa[j]); } polni = min(polni, chsh); } return polni; } long long find_maximum(int k, vector<vector<int>> x) { n = x.size(); vector<ll>zibil; vector<vector<int>>ans(n, vector<int>(1, 0)); for (int i = 0; i < n; i++) { zibil.push_back(x[i][0]); } allocate_tickets(ans); return qaq(zibil); }

Compilation message (stderr)

tickets.cpp: In function 'll qaq(std::vector<long long int>)':
tickets.cpp:10:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |  for (int i = 0; i < qaqa.size(); i++)
      |                  ~~^~~~~~~~~~~~~
tickets.cpp:13:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |   for (int j = 0; j < qaqa.size(); j++)
      |                   ~~^~~~~~~~~~~~~
#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...