結果
| 問題 | No.1046 Fruits Rush |
| コンテスト | |
| ユーザー |
ldsyb
|
| 提出日時 | 2026-09-12 00:31:55 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 482 bytes |
| 記録 | |
| コンパイル時間 | 4,255 ms |
| コンパイル使用メモリ | 381,028 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-09-12 00:32:18 |
| 合計ジャッジ時間 | 5,921 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 WA * 3 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using namespace chrono;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
int main() {
int64_t n, k;
cin >> n >> k;
vector<int64_t> as(n);
for (auto &&a : as) {
cin >> a;
}
ranges::sort(as);
ranges::reverse(as);
int64_t ans = 0;
for (int64_t i = 0; i < k; i++) {
ans += max<int64_t>(0, as[i]);
}
cout << ans << endl;
return 0;
}
ldsyb