Cod sursa(job #2512653)
| Utilizator | Data | 21 decembrie 2019 12:50:54 | |
|---|---|---|---|
| Problema | Suma si numarul divizorilor | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.49 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("ssnd.in");
ofstream fout("ssnd.out");
int v[1000001];
int c[1000001];
int main()
{
int t;
fin >> t;
for(int i = 1; i <= 1000001; i++){
for(int j = i; j <= 1000001; j += i){
v[j] += i;
c[j]++;
}
}
for(int i = 1; i <= t; i++){
int n;
fin >> n;
fout << c[n] << " " << v[n] << "\n";
}
return 0;
}
