답안 #1050723

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1050723 2024-08-09T13:28:24 Z TahirAliyev 식물 비교 (IOI20_plants) C++17
컴파일 오류
0 ms 0 KB
#include "tickets.h"
#include <bits/stdc++.h>
using namespace std;

#define pii pair<int, int>
#define ll long long

ll find_maximum(int k, std::vector<std::vector<int>> x) {
	int n = x.size();
	int m = x[0].size();
	vector<vector<int>> res;
	res.resize(n);
	for(int i = 0; i < n; i++) res[i].resize(m, -1);
	vector<int> l(n, 0), r(n, m - 1);
	ll ans = 0;
	priority_queue<pii> q;
	vector<int> pre(n, k), suf(n, 0);
	for(int i = 0; i < n; i++){
		int sum = 0;
		for(int j = 0; j < k; j++){
			sum -= x[i][j];
		}
		q.push({x[i][k - 1] + x[i][m - 1], i});
	}
	for(int z = 0; z < k * n / 2; z++){
		pii a = q.top();
		ans += a.first;
		pre[a.second]--;
		suf[a.second]++;
		if(suf[a.second] == k) continue;
		q.push({x[a.second][m - suf[a.second] - 1] - x[a.second][pre[a.second]], a.second});
	}
	while(q.size()) q.pop();
	for(int r = 0; r < k; r++){
		vector<pii> v;
		for(int i = 0; i < n; i++){
			v.push_back({suf[i], i});
		}
		sort(v.begin(), v.end());
		for(int i = 0; i < n / 2; i++){
			res[v[i].second][m - v[i].first] = r;  
			suf[v[i].second]--;
		}
		for(int i = n / 2; i < n; i++){
			res[v[i].second][pre[v[i].second] - 1] = r;
			pre[v[i].second]--;
		}
	}
	allocate_tickets(res);
	return ans;
}

Compilation message

plants.cpp:1:10: fatal error: tickets.h: No such file or directory
    1 | #include "tickets.h"
      |          ^~~~~~~~~~~
compilation terminated.