12214 | 2024-12-09 13:41:57 | Csongi | Legnagyobb téglalap | cpp17 | Forditási hiba |
#include <bits/stdc++.h>
using namespace std;
long long 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;
}
open /var/local/lib/isolate/423/box/a.out: no such file or directory
cc1plus: error: '::main' must return 'int'