# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1015862 | aykhn | Carnival Tickets (IOI20_tickets) | C++17 | 276 ms | 57788 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "tickets.h"
#include <bits/stdc++.h>
using namespace std;
#define inf 0x3F3F3F3F3F3F3F3F
long long find_maximum(int k, vector<vector<int>> x) {
int n = x.size();
int m = x[0].size();
vector<vector<int>> answer(n, vector<int> (m, -1));
vector<long long> taken(n, 0);
vector<long long> lef(n, 0);
long long s = n * k / 2;
for (int i = 0; i < n; i++)
{
lef[i] = k - 1;
for (int j = m - 1; j >= m - k; j--)
{
if (!s) break;
if (!x[i][lef[i]]) break;
taken[i]++;
lef[i]--;
s--;
}
}
for (int i = 0; i < n; i++)
{
for (int j = m - taken[i] - 1; j >= m - k; j--)
{
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |