/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 328.0 KiB
#2 Wrong Answer 16ms 608.0 KiB
#3 Wrong Answer 25ms 540.0 KiB

Code

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define yes cout << "Yes" << "\n";
#define no cout << "No" << "\n";
#define fri(a,b) for(ll i = a; i<b; i++) 
#define frj(a,b) for(ll j = a; j <b; j++)
#define frk(a,b) for(ll k = a; k <b; k++) 
#define rfri(a,b) for(ll i = a; i>=b; i--)

using namespace std;
int main()
{
    ios_base:: sync_with_stdio(false);
    cin.tie(NULL);

    ll T = 1;
    cin >> T;
    while(T--)
    {
        ll n,k;
        cin >> n >> k ;
        ll a[n];
        fri(0,n) cin >> a[i];
        sort(a,a+n);
        ll sum = 0;
        fri(0,k)
        {
            sum += a[i];
        }
        cout << sum << "\n";
    }
}

Information

Submit By
Type
Submission
Problem
P1149 Swap and Minimize
Contest
LU IUJPC : Sylhet Division 2024
Language
C++17 (G++ 13.2.0)
Submit At
2024-12-09 04:51:52
Judged At
2024-12-09 04:51:52
Judged By
Score
1
Total Time
25ms
Peak Memory
608.0 KiB