5902 vector<unsigned int> a(n);
5903 vector<vector<pair<unsigned int, unsigned int>>> factors(n);
5904 map<vector<pair<unsigned int, unsigned int>>,
unsigned int> factor_status_count;
5905 for(
int i = 0; i < n; i++) {
5907 for(
unsigned int factor = 2; factor * factor <= a[i]; factor++) {
5908 if(a[i] % factor != 0U) {
5911 unsigned int count = 0;
5912 while(a[i] % factor == 0) {
5918 factors[i].emplace_back(factor, count);
5922 factors[i].emplace_back(a[i], 1);
5925 unsigned long long ans = 0;
5926 for(
unsigned int i = 0; i < n; i++) {
5927 vector<pair<unsigned int, unsigned int>> factor_status;
5928 for(
auto [factor, count]: factors[i]) {
5929 factor_status.emplace_back(factor, k - count);
5931 ans += factor_status_count[factor_status];
5932 ++factor_status_count[factors[i]];