#include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;
int countDivisors(int num) {
int count = 0;
for (int i = 1; i <= num; i++) {
if (num % i == 0) {
count++;
}
}
return count;
}
int main() {
int N;
cin >> N;
unordered_map<int, int> classMap;
for (int i = 0; i < N; i++) {
int num;
cin >> num;
int divisors = countDivisors(num);
classMap[divisors]++;
}
cout << classMap.size() << endl;
for (auto it = classMap.begin(); it != classMap.end(); it++) {
cout << it->first << " " << it->second << endl;
}
return 0;
}
Đúng 3
Bình luận (0)