The group of Absurd Calculation Maniacs has discovered a great new way how to count. Instead of using the ordi…
分类:Kuangbin数论专题
O - GCD - Extreme (II)
题意: 给你一个n,求所有gcd(i , j)的和,其中1 <= i < j <= n。 题解: 我们假设gcd[n]表示1到n-1与n的gcd的和,那么s[n]=s[n-1]+gcd[n]; phi[…
X - The Super Powers
We all know the Super Powers of this world and how they manage to get advantages in political warfare or even …
W - Prime Time
Euler is a well-known matematician, and, among many other things, he discovered that the formula n^2 + n + 41 …
Maximum GCD
Given the N integers, you have to nd the maximum GCD (greatest common divisor) of every possible pair of these…
H - Pairs Forming LCM
Find the result of the following code: long long pairsFormLCM( int n ) { long long res = 0; for( int i = 1; i
J - Mysterious Bacteria
Dr. Mob has just discovered a Deathly Bacteria. He named it RC-01. RC-01 has a very strange reproduction syste…
S - C Looooops
A Compiler Mystery: We are given a C-language style for loop of type for (variable = A; variable != B; variabl…
U - Primes
Write a program to read in a list of integers and determine whether or not each number is prime. A number, n, …
R - 青蛙的约会
两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的…