結果
| 問題 | No.1046 Fruits Rush |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-08 21:26:43 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 294 bytes |
| 記録 | |
| コンパイル時間 | 2,547 ms |
| コンパイル使用メモリ | 192,756 KB |
| 最終ジャッジ日時 | 2025-01-10 08:02:01 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 3 WA * 11 |
ソースコード
#include <bits/stdc++.h>
int main(){
int n, k; std::cin >> n >> k;
std::vector<int> a(n);
for(int i = 0; i < n; ++i){
std::cin >> a[i];
}
int ans = a[0];
for(int i = 1; i < k; ++i){
if(a[i] >= 0){
ans += a[i];
}
}
std::cout << ans << "\n";
return 0;
}