From 9e28b0004ce30a1d67a209117abb387d69663988 Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Thu, 28 Nov 2024 11:48:20 +0800 Subject: [PATCH] update --- src/11/c4/P1190.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/11/c4/P1190.cpp diff --git a/src/11/c4/P1190.cpp b/src/11/c4/P1190.cpp new file mode 100644 index 0000000..dfb7dab --- /dev/null +++ b/src/11/c4/P1190.cpp @@ -0,0 +1,32 @@ +#include +#include +#include +#include +#include +using namespace std; +using ll = int64_t; + +ll n,m; +priority_queue,greater<>> list_pq; + +int main(){ + ios::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr); + cin>>n>>m; + for(ll i{1};i<=m;i++){ + list_pq.emplace(0); + } + while(n--){ + ll tmp; + cin>>tmp; + ll front{list_pq.top()}; + list_pq.pop(); + front+=tmp; + list_pq.emplace(front); + } + ll ans{}; + while(list_pq.size()){ + ans=list_pq.top(); + list_pq.pop(); + } + cout<