| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 304427 | urd05 | 카니발 티켓 (IOI20_tickets) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//#include "tickets.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
static int n;
static int m;
static int k;
static std::vector<std::vector<int>> d;
static std::vector<std::vector<int>> x;
static int called = 0;
static void check(bool cond, std::string message) {
if (!cond) {
printf("%s\n", message.c_str());
exit(0);
}
}
void allocate_tickets( std::vector<std::vector<int>> _d) {
check(!called, "allocate_tickets called more than once");
d = _d;
check((int)d.size() == n, "allocate_tickets called with parameter of wrong size");
for (int i = 0; i < n; i++) {
check((int)d[i].size() == m, "allocate_tickets called with parameter of wrong size");
}
called = 1;
}
long long dp[81][6400];
const long long INF=1e16;
long long find_maximum(int k, vector<vector<int>> v) {
int n = v.size();
int m = v[0].size();
vector<vector<int>> answer(n,vector<int>(m));
vector<int> temp;
for(int i=0;i<n;i++) {
temp.push_back(v[i][0]);
answer[i][0]=0;
for(int j=1;j<m;j++) {
answer[i][j]=-1;
}
}
sort(temp.begin(),temp.end());
long long ret=0;
for(int i=0;i<n/2;i++) {
ret-=temp[i];
}
for(int i=n/2;i<n;i++) {
ret+=temp[i];
}
allocate_tickets(answer);
return ret;
}
