이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "tickets.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll nbcouleurs,nbparcouleurs,r,val;
vector<int> s;
vector<vector<int>> rep;
vector<int> un;
ll find_maximum(int nbtours, vector<vector<int>> x) {
nbcouleurs=x.size();
nbparcouleurs=x[0].size();
//cout<<nbcouleurs<<" "<<nbparcouleurs<<endl;
un.push_back(0);
for (int i=0;i<nbcouleurs;i++){
s.push_back(x[i][0]);
rep.push_back(un);
}
sort(s.begin(),s.end());
allocate_tickets(rep);
val=s[nbcouleurs/2-1]+s[nbcouleurs/2];
val/=2;
for (int i=0;i<nbcouleurs;i++){
r+=abs(val-s[i]);
}
//cout<<val<<endl;
//cout<<r<<endl;
return r;
/*int n = x.size();
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);
return 1;*/
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |