/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 328.0 KiB
#2 Wrong Answer 47ms 576.0 KiB
#3 Wrong Answer 76ms 544.0 KiB

Code

#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){

   ll T; cin>>T;
   while(T--){
      ll N,K; cin>>N>>K;
      ll arr[N];
      ll sum=0;
      ll n=sizeof(arr)/sizeof(arr[0]);
      for(ll i=0;i<N;i++){
         cin>>arr[i];
      }
     sort(arr,arr+n);
      for(ll i=0;i<K;i++){
         sum+=arr[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:30:35
Judged At
2024-12-09 07:30:35
Judged By
Score
1
Total Time
76ms
Peak Memory
576.0 KiB