Submission #961714

# Submission time Handle Problem Language Result Execution time Memory
961714 2024-04-12T11:02:22 Z Gr1sen Carnival Tickets (IOI20_tickets) C++17
0 / 100
1 ms 348 KB
#include "tickets.h"
#include <vector>
#include<iostream>
#include<algorithm>
#include<iomanip>

using namespace std;

#define ll long long
#define vi vector<int>
#define vvi vector<vi>

ll oink(vvi x) {
	//cerr << endl;
	allocate_tickets(x);
	int n = x.size();
	ll t = 0;
	vi L (n);
	for (int i = 0; i < n; i++) L[i] = x[i][0];
	sort(L.begin(), L.end());
	int a = L[n/2];
	//cerr << a << endl;
	for (auto i : L) t += abs(a-i);
	//cerr << endl;
	return t;
}

long long find_maximum(int k, vvi x) {
	int n = x.size();
	int m = x[0].size();
	if (m == 1) return oink(x);
	vvi answer;
	for (int i = 0; i < n; i++) {
		vi 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;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Ticket 0 of color 0 is played on invalid day 500507564
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Contestant returned 292273026 but the tickets gives a total value of 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Contestant returned 2 but the tickets gives a total value of 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Contestant returned 5 but the tickets gives a total value of 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Contestant returned 5 but the tickets gives a total value of 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Contestant returned 5 but the tickets gives a total value of 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Ticket 0 of color 0 is played on invalid day 500507564
2 Halted 0 ms 0 KB -