제출 #800617

#제출 시각아이디문제언어결과실행 시간메모리
800617APROHACK카니발 티켓 (IOI20_tickets)C++17
11 / 100
1 ms724 KiB
#include "tickets.h" #include <bits/stdc++.h> #define ll long long #define ff first #define ss second #define pb push_back using namespace std; int n, m, K; long long find_maximum(int k, std::vector<std::vector<int>> x) { n = x.size(); m = x[0].size(); K = k; std::vector<std::vector<int>> answer; vector<int>row; for(int i = 0 ; i < m ; i ++)row.pb(-1); for(int i = 0 ; i < n ; i ++)answer.pb(row); ll ans = 0; for(int r = 0 ; r < k ; r ++){ vector<ll>acum; for(int i = 0 ; i < n ; i ++){ answer[i][r] = r; acum.pb(x[i][r]); } sort(acum.begin(), acum.end()); for(int i = 0, j = n-1; i < j; i ++, j--){\ ans += acum[j] - acum[i]; } } 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...