Harry Potter and the Hide Story Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 2193    Accepted Submission(s): 530 Problem Description iSea is tired of writing the story of Harry Potter, so,…
LCM Cardinality Input: Standard Input Output: Standard Output Time Limit: 2 Seconds A pair of numbers has a unique LCM but a single number can be the LCM of more than one possible pairs. For example 12 is the LCM of (1, 12), (2, 12), (3,4) etc. For a…
Harry Potter and the Hide Story Problem Description iSea is tired of writing the story of Harry Potter, so, lucky you, solving the following problem is enough.   Input The first line contains a single integer T, indicating the number of test cases. E…
Harry Potter and the Hide Story Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2809    Accepted Submission(s): 715 Problem Description iSea is tired of writing the story of Harry Potter, so, l…
J - 数论,质因数分解 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Description Tomorrow is contest day, Are you all ready? We have been training for 45 days, and all guys must be tired.But , you are so lucky compa…
[整除] 若a被b整除,即a是b的倍数,那么记作b|a("|"是整除符号),读作"b整除a"或"a能被b整除".b叫做a的约数(或因数),a叫做b的倍数. [质因数分解] 把一个正整数数分解成几个质数的幂相乘的形式叫做质因数分解. e.g. 10=2*5 16=24 18=2*32 [唯一分解定理] 唯一分解定理(算术基本定理)可表述为:任何一个大于1的自然数 N,如果N不为质数,那么N可以唯一分解成有限个质数的乘积: N=P1a1*P2a2*P…
Pairs Forming LCM (LightOJ - 1236)[简单数论][质因数分解][算术基本定理](未完成) 标签: 入门讲座题解 数论 题目描述 Find the result of the following code: long long pairsFormLCM( int n ) { long long res = 0; for( int i = 1; i <= n; i++ ) for( int j = i; j <= n; j++ ) if( lcm(i, j) ==…
Ugly Number的质因数仅为2,3,5 将输入的数分别除以2,3,5直到不能除,看是否为1,为1的是Ugly Number,其他则不是. class Solution { public: bool isUgly(int num) { ) return false; ] ={,,}; ; i < ; ++i){ ){ num /= prime[i]; } } ; } };…
Alexandra and Prime Numbers Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1847    Accepted Submission(s): 629 Problem Description Alexandra has a little brother. He is new to programming. One…
Description Tomorrow is contest day, Are you all ready? We have been training for 45 days, and all guys must be tired.But , you are so lucky comparing with many excellent boys who have no chance to attend the Province-Final. Now, your task is relaxin…