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<