Submission #337531

# Submission time Handle Problem Language Result Execution time Memory
337531 2020-12-21T04:12:36 Z kutbilim_one K blocks (IZhO14_blocks) C++14
0 / 100
200 ms 77676 KB
/** kutbilim.one **/
#include <bits/stdc++.h>

using namespace std;

#define all(x) x.begin(),x.end()
#define int long long
#define endl '\n'

ifstream in("test.txt"); 
#define cin in

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int n, k;
    cin >> n >> k;

    vector<int> a(n);
    for(int i = 0; i < n; i++){
  		cin >> a[i];  	
    }

    sort(all(a), greater<int>());

    int res = a[0];
    for(int i = n-k+1; i < n; i++){
    	res += a[i];
    }

    cout << res;
        
    return 0;
}
# Verdict Execution time Memory Grader output
1 Runtime error 199 ms 77548 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 200 ms 77676 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 199 ms 77548 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 199 ms 77548 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -