/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Wrong Answer 46ms 704.0 KiB
#3 Wrong Answer 75ms 808.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int n, k;
        cin >> n >> k;
        int ar[n];
        for (int i = 0; i < n; i++)
        {
            cin >> ar[i];
        }
        sort(ar, ar + n);
        int sum(0);
        for (int i = 0; i < k; i++)
        {
            sum += ar[i];
        }
        cout << sum << endl;
    }
}

Information

Submit By
Type
Submission
Problem
P1149 Swap and Minimize
Contest
LU IUJPC : Sylhet Division 2024 Replay Contest
Language
C++17 (G++ 13.2.0)
Submit At
2024-12-10 10:22:55
Judged At
2024-12-10 10:22:55
Judged By
Score
1
Total Time
75ms
Peak Memory
808.0 KiB