Time limit per test
2 seconds
Memory limit per test
256 megabytes
Input
Standard Input
Output
Standard output
Let's denoteD(N) As the number of divisors of a positive integerN.
You are given three IntegersA,BAndC.
Your task is to calculate the following sum:
Find the sum modulo 1073741824 (1, 230 ).
Input
The first line contains three space-separated IntegersA,BAndC(1 digit ≤ DigitA, Bytes,B, Bytes,CLimit ≤ limit 100 ).
Output
Print a single integer-the required sum modulo 1073741824 (230 ).
Sample test (s) Input
2 2 2
Output
20
Input
5 6 7
Output
1520
Note
For the first example.
- D(1 · 1 · 1) bytes = bytesD(1) Priority = Priority 1;
- D(1 · 1 · 2) bytes = bytesD(2) Limit = Limit 2;
- D(1 · 2 · 1) bytes = bytesD(2) Limit = Limit 2;
- D(1 · 2 · 2) bytes = bytesD(4) Outputs = outputs 3;
- D(2 · 1 · 1) bytes = bytesD(2) Limit = Limit 2;
- D(2 · 1 · 2) bytes = bytesD(4) Outputs = outputs 3;
- D(2 · 2 · 1) bytes = bytesD(4) Outputs = outputs 3;
- D(2 · 2 · 2) bytes = bytesD(8) Limit = Limit 4.
So the result is 1 second + second 2 second + second 2 second + second 3 second + second 2 second + second 3 second + second 4 second = Second 20.
Problem description: This is to calculate the number of a number factor, create a table to find the number of each number factor, and add
#include <iostream>#include <cstdio>#include <cstdlib>#include <cmath>#include <cstring>#include <string>#include<set>#include <algorithm>using namespace std;int x[1000003];int main(){int a,b,c;int i,j,k,s=0;scanf("%d %d %d",&a,&b,&c);for(i=2;i<=1000002;++i){for( j=i;j<=1000002;j+=i) {++x[j];}}for(i=1;i<=a;++i) {for(j=1;j<=b;++j) {for( k=1;k<=c;++k){s=(s+1+x[i*j*k])%1073741824;}}}printf("%d\n",s);return 0;}