Submission #617309

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6173092022-08-01 10:42:30OttoTheDinoCarnival Tickets (IOI20_tickets)C++17
0 / 100
1 ms300 KiB
#include "tickets.h"
#include <bits/stdc++.h>
using namespace std;
#define rep(i,s,e) for (int i = s; i <= e; ++i)
#define fi first
#define se second
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
long long find_maximum(int k, vector<vector<int>> x) {
int n = x.size();
int m = x[0].size(), cnt[n] = {};
vector<vector<int>> answer(n, vi(m));
ii vals[n*m];
rep (i,0,n-1) rep (j,0,m-1) vals[i*m+j] = {x[i][j], i};
sort(vals, vals+n*m);
ll tot = 0;
rep (i,0,n*m-1) {
if (i<n*m/2) {
tot -= vals[i].fi;
cnt[vals[i].se]++;
}
else tot += vals[i].fi;
}
int id = 0;
rep (i,0,n-1) {
sort(x[i].begin(), x[i].end());
rep (j,0,m-1) answer[i][(id+j)%m] = x[i][j];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...