Submission #600498

#TimeUsernameProblemLanguageResultExecution timeMemory
600498UncoolAnonCarnival Tickets (IOI20_tickets)C++14
0 / 100
1 ms340 KiB
#include <bits/stdc++.h> #define ll long long using namespace std; ll find_maximum(int k,vector<vector<int>> a){ ll answer=0; int n=a.size(),m=a[0].size(); vector<int> kek ; for(int i=0;i<n;++i) for(int j=0;j<m;j++) kek.push_back(a[i][j]); auto vanswer=a; for(auto&x:vanswer) for(int&y:x) y=0; sort(kek.begin(),kek.end()); for(int i=0;i<kek.size();i++) answer+=kek[i]*(kek.size()/2>i?-1:1); return answer; }

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:16:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |  for(int i=0;i<kek.size();i++)
      |              ~^~~~~~~~~~~
tickets.cpp:17:31: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   17 |   answer+=kek[i]*(kek.size()/2>i?-1:1);
      |                   ~~~~~~~~~~~~^~
#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...