# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
91300 | Aydarov03 | K blocks (IZhO14_blocks) | C++14 | 3 ms | 608 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define int long long
using namespace std;
int a[100005];
int ans;
main()
{
int n , k;
cin >> n >> k;
for(int i = 1; i <= n; i++)
scanf("%d" , &a[i]);
sort( a + 1 , a + 1 + n );
ans = a[n];
for(int i = 1; i < k; i++)
ans += a[i];
cout << ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |