제출 #478548

#제출 시각아이디문제언어결과실행 시간메모리
478548khoabright카니발 티켓 (IOI20_tickets)C++17
11 / 100
1 ms588 KiB
#include "tickets.h" #include <bits/stdc++.h> using namespace std; //#define int int64_t #define ff first #define ss second #define pii pair<int, int> #define all(x) x.begin(), x.end() #define rep(i, a, b) for (int i = (int)a; i <= (int)b; ++i) #define rep1(i, a, b) for (int i = (int)a; i >= (int)b; --i) #define mp make_pair #define vii vector<vector<int>> #define ll long long const int N = 2e5 + 5; //void allocate_tickets(vii a); ll find_maximum(int k, vii a) { int n = a.size(); vector<int> v(n); rep(i, 0, n - 1) v[i] = a[i][0]; sort(all(v)); int bound = v[n / 2]; int64_t prize = 0; rep(i, 0, n - 1) prize += abs(v[i] - bound); rep(i, 0, n - 1) a[i][0] = 0; allocate_tickets(a); return prize; }
#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...