제출 #431880

#제출 시각아이디문제언어결과실행 시간메모리
431880Pbezz카니발 티켓 (IOI20_tickets)C++14
0 / 100
1 ms296 KiB
#include "tickets.h" #include <vector> #include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back typedef pair<ll,ll> pii; const ll MAXN = 2e5+5; long long find_maximum(int k, std::vector<std::vector<int>> x) { int n = x.size(),ans=0,i; int m = x[0].size(); std::vector<std::vector<int>> answer; for (int i = 0; i < n; i++) { 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); } allocate_tickets(answer); vector<int>p; for(i=0;i<n;i++){ p.pb(x[i][0]); } sort(p.begin(),p.end()); for(i=0;i<n;i++){ ans+=abs(p[i]-p[n/2]); } 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...