結果
| 問題 | No.3683 サーバー代がもったいない! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-05 14:23:03 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 409 bytes |
| 記録 | |
| コンパイル時間 | 2,725 ms |
| コンパイル使用メモリ | 361,160 KB |
| 実行使用メモリ | 9,792 KB |
| 最終ジャッジ日時 | 2026-09-05 14:23:32 |
| 合計ジャッジ時間 | 5,945 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 WA * 21 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll n,k;
cin >> n >> k;
vector<ll> a(n);
for(int i = 0;i < n;i++){
cin >> a.at(i);
}
sort(a.begin(),a.end());
reverse(a.begin(),a.end());
ll ans = 0;
for(int i = 0;i < k;i++){
if(i * 2 >= n){
cout << "Impossible" << endl;
return 0;
}
ans += a.at(i * 2);
}
cout << ans << endl;
}