Submission #430566

#TimeUsernameProblemLanguageResultExecution timeMemory
430566OzyCarnival Tickets (IOI20_tickets)C++17
11 / 100
2 ms716 KiB
#include "tickets.h" #include <bits/stdc++.h> using namespace std; #define lli long long int #define rep(i,a,b) for (lli i = (a); i <= (b); i++) #define repa(i,a,b) for (lli i = (a); i >= (b); i--) #define debug(a) cout << #a << " = " << a << endl; #define debugsl(a) cout << #a << " = " << a << ", "; lli n,m,mitad,val; vector< vector<int> > res; vector<int>orden; long long find_maximum(int k, std::vector<std::vector<int>> x) { n = x.size(); m = x[0].size(); rep(i,0,n-1) orden.push_back(x[i][0]); sort(orden.begin(), orden.end()); mitad = n/2; val = orden[mitad-1]; lli suma = 0; rep(i,0,n-1) suma += abs(x[i][0] - val); res = vector<vector<int> > (n, vector<int> (m, 0)); allocate_tickets(res); return suma; }
#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...