Submission #600501

#TimeUsernameProblemLanguageResultExecution timeMemory
600501UncoolAnonCarnival Tickets (IOI20_tickets)C++14
11 / 100
1 ms724 KiB
#include <bits/stdc++.h> #include "tickets.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); allocate_tickets(vanswer); return answer; }

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:18:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |  for(int i=0;i<kek.size();i++)
      |              ~^~~~~~~~~~~
tickets.cpp:19:31: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   19 |   answer+=kek[i]*(kek.size()/2>i?-1:1); allocate_tickets(vanswer);
      |                   ~~~~~~~~~~~~^~
tickets.cpp:18:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   18 |  for(int i=0;i<kek.size();i++)
      |  ^~~
tickets.cpp:19:41: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   19 |   answer+=kek[i]*(kek.size()/2>i?-1:1); allocate_tickets(vanswer);
      |                                         ^~~~~~~~~~~~~~~~
#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...