100被HACK了
  • 板块P2094 运输
  • 楼主HACKILLER
  • 当前回复0
  • 已保存回复0
  • 发布时间2025/8/30 12:36
  • 上次更新2025/8/30 19:58:29
查看原帖
100被HACK了
1053960
HACKILLER楼主2025/8/30 12:36
#include<bits/stdc++.h>

using namespace std;

struct node{
	long long x;
	bool operator < (const node& dd) const {
		return x < dd.x;
	}
};
long long a[100050],n,k;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>n>>k;
	priority_queue<node>q;
	for(int i = 1;i <= n;++i) cin>>a[i],q.push({a[i]});
	for(int i = 1;i < n;++i){
		int a1 = q.top().x; q.pop();
		int a2 = q.top().x; q.pop();
		q.push({(a1+a2)/k});
	}
	cout<<q.top().x;
	return 0;
}
2025/8/30 12:36
加载中...