제출 #399991

#제출 시각아이디문제언어결과실행 시간메모리
399991faresbasbs카니발 티켓 (IOI20_tickets)C++14
25 / 100
789 ms88224 KiB
#include <bits/stdc++.h> #include "tickets.h" using namespace std; int n,m,l[1501],r[1501]; long long find_maximum(int k, vector<vector<int>> x){ n = x.size() , m = x[0].size(); vector<pair<long long,long long>> v,vals; for(int i = 0 ; i < n ; i += 1){ l[i] = 0 , r[i] = m-1; vals.push_back({0,i}); for(int j = 0 ; j < m ; j += 1){ vals[i].first += x[i][j]; v.push_back({x[i][j],i}); } } sort(v.begin(),v.end()); vector<vector<int>> ans(n,vector<int>(m,-1)); long long ret = 0; for(int i = 0 ; i < k ; i += 1){ sort(vals.begin(),vals.end()); for(int j = 0 ; j < n ; j += 1){ } for(int j = 0 ; j < n/2 ; j += 1){ int p = vals[j].second; ret -= x[p][l[p]]; ans[p][l[p]] = i; l[p] += 1; } for(int j = n/2 ; j < n ; j += 1){ int p = vals[j].second; ret += x[p][r[p]]; ans[p][r[p]] = i; r[p] -= 1; vals[j].first -= 1; } } allocate_tickets(ans); return ret; }
#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...