結果
| 問題 | No.3471 ジャッジサーバーの負荷分散 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-03-06 23:05:59 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 56 ms / 2,000 ms |
| コード長 | 538 bytes |
| 記録 | |
| コンパイル時間 | 1,933 ms |
| コンパイル使用メモリ | 217,504 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2026-03-06 23:06:02 |
| 合計ジャッジ時間 | 2,756 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define REP(i,n) for(ll i=0;i<ll(n);i++)
int main(void){
cin.tie(nullptr); ios_base::sync_with_stdio(false);
ll i,j;
ll N,M;
cin >> N >> M;
priority_queue<ll, vector<ll>, greater<ll>> q;
REP(i,M) q.push(0);
REP(i,N){
ll t;
cin >> t;
ll x=q.top();
q.pop();
q.push(x+t);
}
ll mx=0;
while(!q.empty()){
ll x=q.top();
q.pop();
mx=max(mx,x);
}
cout << mx << endl;
return 0;
}