12217 | 2024-12-09 13:48:50 | Csongi | Legnagyobb téglalap | cpp17 | Wrong answer 0/100 | 75ms | 6640 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;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 1ms | 320 KiB | ||||
2 | Accepted | 1ms | 508 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 | Accepted | 1ms | 320 KiB | ||||
10 | Accepted | 1ms | 320 KiB | ||||
11 | Wrong answer | 1ms | 500 KiB | ||||
12 | Accepted | 1ms | 320 KiB | ||||
13 | Wrong answer | 8ms | 320 KiB | ||||
14 | Wrong answer | 8ms | 320 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 | 320 KiB | ||||
20 | Wrong answer | 1ms | 500 KiB | ||||
21 | Accepted | 1ms | 320 KiB | ||||
22 | Accepted | 1ms | 548 KiB | ||||
23 | Wrong answer | 1ms | 508 KiB | ||||
24 | Accepted | 1ms | 320 KiB | ||||
subtask5 | 0/20 | ||||||
25 | Accepted | 1ms | 320 KiB | ||||
26 | Accepted | 3ms | 568 KiB | ||||
27 | Accepted | 3ms | 568 KiB | ||||
28 | Wrong answer | 3ms | 568 KiB | ||||
29 | Accepted | 4ms | 556 KiB | ||||
30 | Wrong answer | 3ms | 492 KiB | ||||
31 | Accepted | 3ms | 704 KiB | ||||
32 | Accepted | 2ms | 320 KiB | ||||
subtask6 | 0/15 | ||||||
33 | Accepted | 1ms | 320 KiB | ||||
34 | Accepted | 59ms | 5004 KiB | ||||
35 | Accepted | 68ms | 6488 KiB | ||||
36 | Wrong answer | 68ms | 6544 KiB | ||||
37 | Accepted | 68ms | 6640 KiB | ||||
38 | Wrong answer | 65ms | 6456 KiB | ||||
39 | Accepted | 65ms | 6624 KiB | ||||
40 | Wrong answer | 2ms | 320 KiB | ||||
41 | Accepted | 37ms | 1664 KiB | ||||
subtask7 | 0/30 | ||||||
42 | Wrong answer | 32ms | 764 KiB | ||||
43 | Accepted | 72ms | 6200 KiB | ||||
44 | Accepted | 71ms | 6448 KiB | ||||
45 | Wrong answer | 72ms | 6456 KiB | ||||
46 | Accepted | 75ms | 6456 KiB | ||||
47 | Wrong answer | 75ms | 6484 KiB | ||||
48 | Accepted | 71ms | 6456 KiB | ||||
49 | Accepted | 71ms | 6456 KiB | ||||
50 | Accepted | 46ms | 1728 KiB | ||||
51 | Accepted | 50ms | 2532 KiB |