Submission #1051395

#TimeUsernameProblemLanguageResultExecution timeMemory
1051395pccCarnival Tickets (IOI20_tickets)C++17
11 / 100
1 ms860 KiB
#include "tickets.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;

#define ll long long

/*
	int n = x.size();
	int m = x[0].size();
	std::vector<std::vector<int>> answer;
	for (int i = 0; i < n; i++) {
		std::vector<int> row(m);
		for (int j = 0; j < m; j++) {
			if (j < k) {
				row[j] = j;
			} else {
				row[j] = -1;
			}
		}
		answer.push_back(row);
	}
	allocate_tickets(answer);
	return 1;
*/

long long find_maximum(int k, std::vector<std::vector<int>> x) {
	int N = x.size();
	vector<ll> v;
	for(int i = 0;i<N;i++)v.push_back(x[i][0]);
	sort(v.begin(),v.end());
	ll ans = 0;
	for(int i = 0;i+i<N;i++){
		ans += v[i+N/2]-v[i];
	}
	vector<vector<int>> ansv;
	for(int i = 0;i<N;i++)ansv.push_back({0});
	allocate_tickets(ansv);
	return ans;
}
#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...