/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Wrong Answer 39ms 532.0 KiB
#3 Wrong Answer 40ms 544.0 KiB

Code

//sadias
#include <bits/stdc++.h>
using namespace std;

int main(){

  int t; cin >> t;
  int n;
  while(t--){
    cin >> n;
    int arr[n];
    for(int i = 0; i < n; i++)
        cin >> arr[i];
    sort(arr, arr+n);
    int sum = 0;
    for(int i = 0;  ; i+=3){
      if(i >= n)
        break;
      sum += arr[i]*arr[i+1]*arr[i+2];
      
    }
    cout << sum << '\n';
  }


  return 0;
}

Information

Submit By
Type
Submission
Problem
P1152 Special Array
Contest
Happy New Year 2025
Language
C++17 (G++ 13.2.0)
Submit At
2025-01-02 15:16:16
Judged At
2025-01-02 15:16:16
Judged By
Score
1
Total Time
40ms
Peak Memory
544.0 KiB