摘要:
Problem: A + B is a problem used to test one's basic knowledge for competitive programming. Here is yet another boring variation of it. You have two i 阅读全文
摘要:
Description Given two positive integers a and b, we can easily calculate the greatest common divisor (GCD) and the least common multiple (LCM) of a an 阅读全文
摘要:
最简单直观简单的素数判定方法就是试除法。对于判断数n是否是素数,我们从2开始一直到sqrt(n)。如果找到一个因子则判断n不是素数,否则是素数。代码如下: bool isPrime( long long n ) { for(long long i = 2; i*i <= n; i++) { if(n 阅读全文
摘要:
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given a and b. Input Input consists of several 阅读全文