func_code_string: #include <bits/stdc++.h>   #pragma GCC optimize( Ofast )   #pragma GCC optimize( unroll-loops )   #pragma GCC target( sse2 )   using namespace std;   template <typename Arg1>   void __f(const char* name, Arg1&& arg1) {     cout << name <<   :   << arg1 <<   n ;   }   template <typename Arg1, typename... Args>   void __f(const char* names, Arg1&& arg1, Args&&... args) {     const char* comma = strchr(names + 1,  , );     cout.write(names, comma - names) <<   :   << arg1 <<   |  ;     __f(comma + 1, args...);   }   void solution() {     int n;     cin >> n;     vector<long long> arr(n);     map<long long, long long> cnt;     map<long long, long long> freq;     for (int i = 0; i < n; i++) cin >> arr[i];     long long ans = 1;     for (int i = 1; i < n + 1; i++) {       cnt[arr[i - 1]]++;       freq[cnt[arr[i - 1]]]++;       long long x = cnt[arr[i - 1]];       long long y = freq[cnt[arr[i - 1]]];       if (x * y == i && i < n)         ans = i + 1;       else if (x * y == i - 1)         ans = i;     }     cout << ans <<   n ;   }   signed main() {     ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     long long t = 1;     for (int i = 1; i < t + 1; i++) {       solution();     }   }   