122172024-12-09 13:48:50CsongiLegnagyobb téglalapcpp17Wrong answer 0/10075ms6640 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    long long n; cin >> n;
    map<long long, long long> m;
    vector<long long> v(0);
    for (long long i = 0; i < n; i++)
    {
        long long be; cin >> be;
        m[be]++;
        if (m[be] == 2)
        {
            v.push_back(be);
        }
    }
    
    sort(v.begin(), v.end()); reverse(v.begin(), v.end());
    if (v.size() > 0 && m[0] >= 4)
    {
        cout << v[0] * v[0] << endl;
    }
    else
    {
        if (v.size() >= 2)
        {
            cout << v[0] * v[1] << endl;
        }
        else
        {
            cout << "0" << endl;
        }
    } 
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms320 KiB
2Accepted1ms508 KiB
3Wrong answer1ms320 KiB
subtask20/10
4Wrong answer1ms320 KiB
5Accepted1ms320 KiB
6Accepted1ms320 KiB
7Accepted1ms320 KiB
8Accepted1ms320 KiB
subtask30/10
9Accepted1ms320 KiB
10Accepted1ms320 KiB
11Wrong answer1ms500 KiB
12Accepted1ms320 KiB
13Wrong answer8ms320 KiB
14Wrong answer8ms320 KiB
subtask40/15
15Accepted1ms320 KiB
16Accepted1ms320 KiB
17Accepted1ms320 KiB
18Accepted1ms320 KiB
19Accepted1ms320 KiB
20Wrong answer1ms500 KiB
21Accepted1ms320 KiB
22Accepted1ms548 KiB
23Wrong answer1ms508 KiB
24Accepted1ms320 KiB
subtask50/20
25Accepted1ms320 KiB
26Accepted3ms568 KiB
27Accepted3ms568 KiB
28Wrong answer3ms568 KiB
29Accepted4ms556 KiB
30Wrong answer3ms492 KiB
31Accepted3ms704 KiB
32Accepted2ms320 KiB
subtask60/15
33Accepted1ms320 KiB
34Accepted59ms5004 KiB
35Accepted68ms6488 KiB
36Wrong answer68ms6544 KiB
37Accepted68ms6640 KiB
38Wrong answer65ms6456 KiB
39Accepted65ms6624 KiB
40Wrong answer2ms320 KiB
41Accepted37ms1664 KiB
subtask70/30
42Wrong answer32ms764 KiB
43Accepted72ms6200 KiB
44Accepted71ms6448 KiB
45Wrong answer72ms6456 KiB
46Accepted75ms6456 KiB
47Wrong answer75ms6484 KiB
48Accepted71ms6456 KiB
49Accepted71ms6456 KiB
50Accepted46ms1728 KiB
51Accepted50ms2532 KiB