/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Wrong Answer 50ms 824.0 KiB
#3 Wrong Answer 75ms 548.0 KiB

Code

#include<bits/stdc++.h>
#include<vector>
#define ll long long
using namespace std;
int main(){
ll t,n,k;
cin>>t;

ll sum=0;
while(t--)
{
    cin>>n>>k;
    vector<ll>a(n);

    for(ll i=0; i<n; i++)
    {
        cin>>a[i];
    }
  sort(a.begin(),a.end());

     for(ll i=0; i<k;i++)
     {
         sum+=a[i];
     }
     cout<<sum<<endl;
    sum=0;
}
return 0;
}

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 07:47:37
Judged At
2024-12-09 07:47:37
Judged By
Score
1
Total Time
75ms
Peak Memory
824.0 KiB