제출 #303281

#제출 시각아이디문제언어결과실행 시간메모리
303281Kevin_Zhang_TW카니발 티켓 (IOI20_tickets)C++17
11 / 100
2 ms768 KiB
#include "tickets.h" #include <vector> #include<bits/stdc++.h> #define pb emplace_back using namespace std; using ll = long long; #ifdef KEV #define DE(i, e) cerr << #i << ' ' << i << e void debug(auto L, auto R) { while (L < R) cerr << *L << " \n"[L+1==R], ++L; } #else #define DE(...) 0 void debug(...) {} #endif const int maxn = 300010; 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; ll res = 0; vector<int> v; for (int i = 0; i < n; i++) { v.pb(x[i][0]); std::vector<int> row(m); for (int j = 0; j < m; j++) { if (j < k) { row[j] = j; } else { row[j] = -1; } } answer.push_back(row); } sort(v.begin(), v.end()); allocate_tickets(answer); for (int u : v) res += abs(u - v[n/2]); return res; }
#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...