fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define int long long
  4. void sol(){
  5. int n;
  6. cin >> n;
  7. int a[n], ans = 0;
  8. map<int, int> m;
  9. for(int &i:a) cin >> i, m[i]++;
  10. for(int i = 1; i < 1000001; i++) ans += m[i * i] * m[i * i * i];
  11. cout << ans << '\n';
  12. return;
  13. }
  14. signed main(){
  15. ios_base::sync_with_stdio(false);
  16. cin.tie(NULL);
  17. cout.tie(NULL);
  18. int t = 1;
  19. //cin >> t;
  20. while(t--){
  21. sol();
  22. }
  23. return 0;
  24. }
Success #stdin #stdout 0.7s 128660KB
stdin
Standard input is empty
stdout
0