88082024-01-31 11:02:16CWMLegnagyobb téglalapcpp17Compilation error
#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
#include <queue>
#include <set>
#include <map>

using namespace std;
using ll = long long;

signed main()
{
	{
		ios_base::sync_with_stdio(0);
		cin.tie(0);
		cout.tie(0);
	}

	map<ll, int> count;
	vector<ll> sides;
	ll size;
	cin >> size;
	for (int i = 0; i < size; i++)
	{
		ll next;
		cin >> next;
		if (++count[next] >= 2)
		{
			sides.push_back(next);
		}
	}

	sort(sides.begin(), sides.end());
	reverse(sides.begin(), sides.end());

	if (sides.size() > 0 && count[sides[0]] >= 4)
	{
		cout << (ll)pow(sides[0], 2) << "\n";
	}
	else
	{
		cout << ((sides.size() >= 2) ? sides[0] * sides[1] : 0) << "\n";
	}
}
Compilation error
exit status 1
main.cpp: In function 'int main()':
main.cpp:39:29: error: 'pow' was not declared in this scope
   39 |                 cout << (ll)pow(sides[0], 2) << "\n";
      |                             ^~~
Exited with error status 1