/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 528.0 KiB
#2 Wrong Answer 13ms 576.0 KiB
#3 Wrong Answer 14ms 532.0 KiB

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