题目链接:Codeforces 236B Easy Number Challenge
B. Easy Number Challenge
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output
Let’s denote d(n) as the number of divisors of a positive integer n. You are given three integers a, b and c. Your task is to calculate the following sum:
Find the sum modulo 1073741824 (230).
Input
The first line contains three space-separated integers a, b and c (1?≤?a,?b,?c?≤?100).
Output
Print a single integer — the required sum modulo 1073741824 (230).
Examples
input
2 2 2
output
20
input
5 6 7
output
1520
Note
For the first example.
d(1·1·1)?=?d(1)?=?1;
d(1·1·2)?=?d(2)?=?2;
d(1·2·1)?=?d(2)?=?2;
d(1·2·2)?=?d(4)?=?3;
d(2·1·1)?=?d(2)?=?2;
d(2·1·2)?=?d(4)?=?3;
d(2·2·1)?=?d(4)?=?3;
d(2·2·2)?=?d(8)?=?4.
So the result is 1?+?2?+?2?+?3?+?2?+?3?+?3?+?4?=?20.
预处理因子和就可以了。
【数学|Codeforces 236B Easy Number Challenge 【因子和】】AC代码:
#include
#include
#include
#include
#include
推荐阅读
- AIoT(人工智能+物联网)|程序员的数学【线性代数基础】
- codeforces B. Young Explorers
- codeforces C. Mere Array
- codeforces D. Omkar and Bed Wars
- codeforces C. Omkar and Waterslide
- codeforces B. Omkar and Infinity Clock
- codeforces B. Ternary Sequence
- topcoder|Topcoder SRM 661 Div1 Easy: MissingLCM
- HDU 5184 Brackets (卡特兰数)
- 题库-CF|【Codeforces Round 370 (Div 2) E】【线段树 等比数列 区间合并】Memory and Casinos 赌场区间[l,r] l进r先出的概率