답안 #1091664

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1091664 2024-09-21T18:12:30 Z alex2407 K개의 묶음 (IZhO14_blocks) C++17
0 / 100
1 ms 1112 KB
#include <iostream>
#include <algorithm>
#include <iomanip>

using namespace std;

int main() {
    int a[110000], k, n;
    double sum = 0;
    cin >> n >> k;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    sort(a, a + n);
    for (int i = 0; i < k - 1; i++) {
        sum += a[i];
    }
    sum += a[n - 1];
    cout << fixed << setprecision(0) << sum << endl;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 856 KB Output is correct
2 Correct 1 ms 860 KB Output is correct
3 Correct 0 ms 860 KB Output is correct
4 Correct 0 ms 860 KB Output is correct
5 Correct 1 ms 860 KB Output is correct
6 Correct 0 ms 860 KB Output is correct
7 Incorrect 0 ms 860 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 860 KB Output is correct
2 Correct 1 ms 860 KB Output is correct
3 Correct 1 ms 860 KB Output is correct
4 Correct 1 ms 1112 KB Output is correct
5 Correct 1 ms 856 KB Output is correct
6 Correct 1 ms 860 KB Output is correct
7 Incorrect 1 ms 860 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 856 KB Output is correct
2 Correct 1 ms 860 KB Output is correct
3 Correct 0 ms 860 KB Output is correct
4 Correct 0 ms 860 KB Output is correct
5 Correct 1 ms 860 KB Output is correct
6 Correct 0 ms 860 KB Output is correct
7 Incorrect 0 ms 860 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 856 KB Output is correct
2 Correct 1 ms 860 KB Output is correct
3 Correct 0 ms 860 KB Output is correct
4 Correct 0 ms 860 KB Output is correct
5 Correct 1 ms 860 KB Output is correct
6 Correct 0 ms 860 KB Output is correct
7 Incorrect 0 ms 860 KB Output isn't correct
8 Halted 0 ms 0 KB -