Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

随便水水就过了……

Posted by buaabarty at 2011-11-09 12:53:25 on Problem 3604
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main(){
    int T, n; scanf("%d", &T);
    while (T--){
        scanf("%d", &n);
        int i = 2, ans = 1;
        do{
            if (i * i > n) { ans *= 9; break; }
            int cnt = 0;
            while ((n % i) == 0) cnt++, n /= i;
            if (cnt) ans *= (cnt + 2) * (cnt + 2) * (cnt + 1) * (cnt + 1) / 4;
            i++;
        }while (n > 1);
        printf("%d\n", ans);
    }
    return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator