Submission #1202971

#TimeUsernameProblemLanguageResultExecution timeMemory
1202971notmeCarnival Tickets (IOI20_tickets)C++20
0 / 100
0 ms328 KiB
#include "tickets.h"
#include <bits/stdc++.h>
#include <vector>
#define pb push_back
using namespace std;
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;
    long long b;
    vector < long long > g;
    for (int i = 0; i < n; ++ i)
        g.pb(1LL * x[i][0]);
    sort(g.begin(), g.end());
    long long half1 = g[n/2];
    for (int i = 0; i < n; i++)
    {
        std::vector<int> row(m);
        for (int j = 0; j < m; j++)
        {
            row[j] = 1;
            /*if (j < k)
            {
            	row[j] = j;
            }
            else
            {
            	row[j] = -1;
            }*/
        }
        answer.push_back(row);
    }
    allocate_tickets(answer);
    long long ans = 0;
    for (auto x: g)
        ans += 1LL * (x - half1);
    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...