Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n, k;
cin >> n >> k;
int ar[n];
for (auto c : ar)
{
cin >> c;
}
sort(ar, ar + n);
int sum(0);
for (int i = 0; i < k; i++)
{
sum += ar[i];
}
cout << sum << endl;
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1149 Swap and Minimize
- Contest
- LU IUJPC : Sylhet Division 2024 Replay Contest
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2024-12-10 10:20:53
- Judged At
- 2024-12-10 10:20:53
- Judged By
- Score
- 0
- Total Time
- 53ms
- Peak Memory
- 560.0 KiB