Submission #300410

#TimeUsernameProblemLanguageResultExecution timeMemory
30041020160161simoneCarnival Tickets (IOI20_tickets)C++14
11 / 100
2 ms768 KiB
#include "tickets.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; int n,m; const ll N=1.5e3+10,INF=1e18; ll t[N]; long long find_maximum(int k, std::vector<std::vector<int> > x) { n = x.size(); m = x[0].size(); vector<std::vector<int> > ans; for (int i = 0; i < n; i++) { vector<int> row; for (int j = 0; j < m; j++) row.push_back(0); ans.push_back(row); } if(m==1){ for(int i=0;i<n;i++) ans[i][0]=0; allocate_tickets(ans); ll s=0; for(int i=0;i<n;i++) t[i]=x[i][0]; sort(t,t+n); for(int i=0;i<n/2;i++) s-=t[i]; for(int i=n/2;i<n;i++) s+=t[i]; return s; } return 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...