比赛 ?板子大赛 评测结果 AAAMMMMMMM
题目名称 最小函数值 最终得分 30
用户昵称 wzh 运行时间 3.544 s
代码语言 C++ 内存使用 93.82 MiB
提交时间 2026-01-17 12:41:32
显示代码纯文本
#include<bits/stdc++.h>
#define int long long
using namespace std;
priority_queue<int >q;
int n,m;
signed main(){
    freopen("minval.in","r",stdin);
    freopen("minval.out","w",stdout);
    cin.tie(0);
    ios::sync_with_stdio(0);
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        int a,b,c;
        cin>>a>>b>>c;
        for(int j=1;j<=m;j++){
            int y=j*j*a+j*b+c;
            q.push(-y);
        }
    }
    int k=0;
    while(++k<=m){
        cout<<-q.top()<<' ';
        q.pop();
    }
    return 0;
}