Submission #961717

#TimeUsernameProblemLanguageResultExecution timeMemory
961717Gr1senCarnival Tickets (IOI20_tickets)C++17
11 / 100
1 ms860 KiB
#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; int n = x.size(); vvi Ans(n, {0}); allocate_tickets(Ans); 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 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...