結果
| 問題 | No.3656 Game Scores and Costs |
| コンテスト | |
| ユーザー |
aaaaaaaaa
|
| 提出日時 | 2026-08-30 14:47:34 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 602 bytes |
| 記録 | |
| コンパイル時間 | 2,438 ms |
| コンパイル使用メモリ | 361,604 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-30 14:47:41 |
| 合計ジャッジ時間 | 6,462 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | TLE * 1 -- * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int n,k,x;
cin >> n >> k >> x;
vector<long long> a;
vector<long long> b;
for(int i = 0; i < n; i++){
long long z;
cin >> z;
a.push_back(z);
}
for(int i = 0; i < n; i++){
int m = min(k, i+1);
sort(a.rend()-i-1, a.rend());
long long sum = 0;
for(int j = 0; j < m; j++){
sum += a.at(j);
}
long long f = sum - x*(i+1);
b.push_back(f);
}
cout << *max_element(b.begin(), b.end()) << endl;
return 0;
}
aaaaaaaaa