結果
| 問題 | No.3471 ジャッジサーバーの負荷分散 |
| コンテスト | |
| ユーザー |
Jupiter17
|
| 提出日時 | 2026-07-29 15:38:43 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 77 ms / 2,000 ms |
| + 812µs | |
| コード長 | 431 bytes |
| 記録 | |
| コンパイル時間 | 3,805 ms |
| コンパイル使用メモリ | 356,348 KB |
| 実行使用メモリ | 7,040 KB |
| 最終ジャッジ日時 | 2026-07-29 15:38:49 |
| 合計ジャッジ時間 | 5,968 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int a, b;
cin >> a >> b;
vector<ll> v(a);
for (int i = 0; i < a; i++) {
cin >> v[i];
}
priority_queue<ll, vector<ll>, greater<ll>> pq;
for (int i = 0; i < b; i++) {
pq.push(0);
}
for (int i = 0; i < a; i++) {
ll x = pq.top();
pq.pop();
pq.push(x+v[i]);
}
for (int i = 1; i < b; i++) {
pq.pop();
}
cout << pq.top() << endl;
}
Jupiter17