Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
void solve() {
int n; cin >> n;
vector<int> v(n);
for(auto &x : v) cin >> x;
sort(v.begin(), v.end());
int ans = 0;
for(int i = 0; i < n; i+=3) {
ans += v[i] + v[i+1] + v[i+2];
}
cout << ans << "\n";
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);cout.tie(nullptr);
int t; cin >> t;
while(t--)
solve();
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1152 Special Array
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-01-03 18:39:05
- Judged At
- 2025-01-03 18:39:05
- Judged By
- Score
- 1
- Total Time
- 14ms
- Peak Memory
- 576.0 KiB