QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#112281 | #6605. The Witchwood | zararaza | RE | 0ms | 0kb | C++17 | 418b | 2023-06-11 01:19:52 | 2023-06-11 01:19:53 |
Judging History
answer
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
ll mas[1050];
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
int n, k; cin >> n >> k;
for (int i = 0; i < n; i++) cin >> mas[i];
sort(mas, mas + n, greater<ll>());
ll s = 0; for (int i = 0; i < k; i++) s += mas[i];
cout << s << endl;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Dangerous Syscalls
input:
5 2 9 8 10 2 4