Submission #302722

# Submission time Handle Problem Language Result Execution time Memory
302722 2020-09-19T05:19:25 Z galca Carnival Tickets (IOI20_tickets) C++14
11 / 100
2 ms 768 KB
#include "tickets.h"
#include <vector>
#include <algorithm>   

long long find_maximum(int k, std::vector<std::vector<int>> x) {
	int n = x.size();
	int m = x[0].size();
	std::vector<std::vector<int>> answer;
	std::vector<int> tickets;

	for (int i = 0; i < n; i++) {
		std::vector<int> row(m);
		tickets.push_back(x[i][0]);

		for (int j = 0; j < m; j++) {
			row[j] = 0;
		}
		answer.push_back(row);
	}

	std::sort(tickets.begin(), tickets.end());
	long long res = 0;
	for (int i = 0; i < n / 2; i++) {
		res += (tickets[n - i - 1] - tickets[i]);
	}
	allocate_tickets(answer);

	return res;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 0 ms 256 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 2 ms 768 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB There is multiple tickets of color 0 on day 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB There is multiple tickets of color 0 on day 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB There is multiple tickets of color 0 on day 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB There is multiple tickets of color 0 on day 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB There is multiple tickets of color 0 on day 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 0 ms 256 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 2 ms 768 KB Output is correct
7 Incorrect 0 ms 384 KB There is multiple tickets of color 0 on day 0
8 Halted 0 ms 0 KB -