12215 | 2024-12-09 13:42:25 | Csongi | Legnagyobb téglalap | cpp17 | Wrong answer 0/100 | 83ms | 6616 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());
if (v.size() > 0 && m[v.size()-1] > 3)
{
cout << v[v.size()-1] * v[v.size()-1] << endl;
}
else
{
if (v.size() > 1)
{
cout << v[v.size()-1] * v[v.size()-2] << endl;
}
else
{
cout << "0" << endl;
}
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 1ms | 320 KiB | ||||
2 | Accepted | 1ms | 320 KiB | ||||
3 | Wrong answer | 1ms | 320 KiB | ||||
subtask2 | 0/10 | ||||||
4 | Wrong answer | 1ms | 320 KiB | ||||
5 | Accepted | 1ms | 320 KiB | ||||
6 | Accepted | 1ms | 320 KiB | ||||
7 | Accepted | 1ms | 320 KiB | ||||
8 | Accepted | 1ms | 320 KiB | ||||
subtask3 | 0/10 | ||||||
9 | Wrong answer | 1ms | 320 KiB | ||||
10 | Wrong answer | 1ms | 320 KiB | ||||
11 | Wrong answer | 1ms | 508 KiB | ||||
12 | Wrong answer | 1ms | 320 KiB | ||||
13 | Wrong answer | 8ms | 428 KiB | ||||
14 | Accepted | 8ms | 424 KiB | ||||
subtask4 | 0/15 | ||||||
15 | Accepted | 1ms | 320 KiB | ||||
16 | Accepted | 1ms | 320 KiB | ||||
17 | Accepted | 1ms | 320 KiB | ||||
18 | Accepted | 1ms | 320 KiB | ||||
19 | Accepted | 1ms | 372 KiB | ||||
20 | Wrong answer | 1ms | 320 KiB | ||||
21 | Accepted | 1ms | 320 KiB | ||||
22 | Accepted | 1ms | 320 KiB | ||||
23 | Wrong answer | 1ms | 320 KiB | ||||
24 | Accepted | 1ms | 320 KiB | ||||
subtask5 | 0/20 | ||||||
25 | Wrong answer | 2ms | 320 KiB | ||||
26 | Accepted | 3ms | 568 KiB | ||||
27 | Accepted | 3ms | 568 KiB | ||||
28 | Wrong answer | 4ms | 568 KiB | ||||
29 | Accepted | 3ms | 568 KiB | ||||
30 | Wrong answer | 3ms | 568 KiB | ||||
31 | Accepted | 3ms | 532 KiB | ||||
32 | Accepted | 2ms | 472 KiB | ||||
subtask6 | 0/15 | ||||||
33 | Accepted | 1ms | 320 KiB | ||||
34 | Accepted | 59ms | 5024 KiB | ||||
35 | Accepted | 70ms | 6616 KiB | ||||
36 | Wrong answer | 68ms | 6488 KiB | ||||
37 | Accepted | 65ms | 6536 KiB | ||||
38 | Wrong answer | 65ms | 6612 KiB | ||||
39 | Accepted | 64ms | 6456 KiB | ||||
40 | Wrong answer | 2ms | 428 KiB | ||||
41 | Accepted | 39ms | 1812 KiB | ||||
subtask7 | 0/30 | ||||||
42 | Accepted | 32ms | 660 KiB | ||||
43 | Accepted | 79ms | 6212 KiB | ||||
44 | Accepted | 72ms | 6496 KiB | ||||
45 | Wrong answer | 72ms | 6456 KiB | ||||
46 | Accepted | 83ms | 6616 KiB | ||||
47 | Wrong answer | 75ms | 6560 KiB | ||||
48 | Accepted | 75ms | 6456 KiB | ||||
49 | Accepted | 75ms | 6456 KiB | ||||
50 | Wrong answer | 46ms | 1848 KiB | ||||
51 | Wrong answer | 50ms | 2228 KiB |