Submission #1051395

# Submission time Handle Problem Language Result Execution time Memory
1051395 2024-08-10T05:53:38 Z pcc Carnival Tickets (IOI20_tickets) C++17
11 / 100
1 ms 860 KB
#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 time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 860 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB WA in grader: allocate_tickets called with parameter of wrong size
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB WA in grader: allocate_tickets called with parameter of wrong size
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB WA in grader: allocate_tickets called with parameter of wrong size
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB WA in grader: allocate_tickets called with parameter of wrong size
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB WA in grader: allocate_tickets called with parameter of wrong size
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 860 KB Output is correct
7 Incorrect 0 ms 348 KB WA in grader: allocate_tickets called with parameter of wrong size
8 Halted 0 ms 0 KB -