This comes across as an interesting use-case of a std::array over a regular array: somewhere where I cannot change the syntax to work for a regular array (or so I have convinced myself).
using namespace std;
int n, c = 0; cin >> n;
array<int, 3> tri;
map<array<int, 3>, int> freq;
cin >> tri >> tri >> tri;
for (auto i : freq)
cout << &i.first << ' ' << i.second << endl;
if (i.second == 1)
cout << c;
cout << i.first << ' ' << i.second << endl;
std::array does not have an issue here is because it does not decay to a pointer unlike a raw array. So, when you use
std::array you get a copy of it in the map which is unique to the map. When you use a raw array you get a pointer to that array and you would have to dynamically allocate them to get different arrays since you copy the pointer, not the array into the map.