/ SeriousOJ /

Record Detail

Runtime Error


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 540.0 KiB
#2 Runtime Error 1ms 780.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
P1098 KuZ the Maximum spanning tree
Contest
LU IUJPC : Sylhet Division 2024
Language
C++17 (G++ 13.2.0)
Submit At
2024-12-09 09:35:49
Judged At
2024-12-09 09:35:49
Judged By
Score
0
Total Time
1ms
Peak Memory
780.0 KiB