Submission #433364

#TimeUsernameProblemLanguageResultExecution timeMemory
433364OttoTheDinoCarnival Tickets (IOI20_tickets)C++17
0 / 100
1 ms204 KiB
#include "tickets.h" #include <bits/stdc++.h> using namespace std; #define rep(i,s,e) for (int i = s; i <= e; ++i) #define rrep(i,s,e) for (int i = s; i >= e; --i) #define pb push_back #define pf push_front #define fi first #define se second #define all(a) a.begin(), a.end() typedef long long ll; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<int> vi; typedef vector<double> vd; typedef vector<string> vs; typedef vector<char> vc; typedef vector<ll> vll; ll find_maximum(int k, vector<vi> x) { int n = x.size(); int m = x[0].size(); ll ans = 0; vector<vector<int>> answer(n, vector<int>(m, -1)); rep (i,0,m-1) { vi one_set; if (i<k) { rep (j,0,n-1) { one_set.pb(x[j][i]); answer[j][i] = x[j][i]; } sort(all(one_set)); rep (j,0,n-1) ans += abs(one_set[j]-one_set[n/2]); } else rep (j,0,n-1) answer[j][i] = -1; } allocate_tickets(answer); 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...