Wrong Answer
Code
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
ll tc;
cin>>tc;
while(tc--)
{
ll n,k;
cin>>n>>k;
vector<ll>v(n);
for(int i=0;i<n;i++)
cin>>v[i];
sort(v.begin(),v.end());
ll ans=0;
for(int i=0;i<min(n,k);i++)
ans+=v[i];
cout<<ans<<endl;
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1149 Swap and Minimize
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2024-12-11 08:31:00
- Judged At
- 2024-12-11 08:31:00
- Judged By
- Score
- 1
- Total Time
- 129ms
- Peak Memory
- 612.0 KiB