/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Wrong Answer 56ms 548.0 KiB
#3 Wrong Answer 54ms 532.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;
int main()
{

    int t;
    cin>>t;
    for(int i =0; i<t; i++)
    {
        vector<int>v;
        int a;
        cin>>a;
        for(int j =0; j<a; j++)
        {
            int ss;
            cin>>ss;
            v.push_back(ss);
        }
        int maxx = 0;
        for(int k = 0; k<v.size(); k++)
        {
            for(int l = k+1; l<v.size(); l++)
            {
                if(v[l] == v[k])
                {
                    continue;
                }else
                {
                    for(int m = l+1; m<v.size(); m++)
                    {
                        if(v[k] != v[l] && v[k]!= v[m] && v[l]!=v[m] && v[l]!= v[k])
                        {
                            maxx = max(maxx, (v[k]*v[l]*v[m]));
                        }else
                        {
                            continue;
                        }
                    }
                }
            }
        }
        cout<<maxx<<endl;

    }
    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:31:23
Judged At
2025-01-02 15:31:23
Judged By
Score
1
Total Time
56ms
Peak Memory
548.0 KiB