Title Link: http://acm.timus.ru/problem.aspx?space=1&num=1049
Title Description:
The title of the topic is given 10 numbers, then the sum of the 10 numbers of the corresponding number of all positive factors N of the number of single digits.
Then directly to the 10 number of qualitative factor decomposition can be. (Note%10)
1#include <cstdio>2#include <iostream>3#include <cstring>4 using namespacestd;5 6 Const intMAXM =10005 ;7 intval[Ten], PRIMS[MAXM];8 9 voidsolve () {Tenmemset (Prims,0,sizeof(Prims)); One A for(inti =0; I <Ten; i++ ){ - for(intj =2; J <= Val[i]; J + + ){ - if(Val[i] = =1) Break ; the while(Val[i]% J = =0 ){ -prims[j]++ ; -Val[i]/=J; - } + } - } + intres =1 ; A for(inti =0; i < MAXM; i++) Res *= (prims[i]+1) %Ten) %Ten ; at -cout << Res%Ten<<Endl; - } - - intMain () { - ////freopen ("1234.txt", "R", stdin); in for(inti =0; I <Ten; i++) Cin >>Val[i]; - solve (); to return 0 ; +}
Timus 1049 Brave Balloonists