题目链接:pid=2054" target="_blank">http://acm.hdu.edu.cn/showproblem.php?pid=2054 Problem Description Give you two numbers A and B, if A is equal to B, you should print "YES", or print "NO". Input each test case contain…
问题: 考虑问题不周到.没有考虑到可能是小数并且存在 1.0=1.01=1的情况. 本题使用了BigDecimal类,此类适用于高精度的数此时攻克了小数和01=1的问题, 该类比較方式中n.equal(m)比較精度,而n.compareTo(m)==0仅仅比較数值适用于该题. A == B ? Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s…
又见GCD Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 9207 Accepted Submission(s): 3782 Problem Description 有三个正整数a,b,c(0<a,b,c<10^6),其中c不等于b.若a和c的最大公约数为b,现已知a和b,求满足条件的最小的c. Input 第一行输入一个…
Problem Description Give you two numbers A and B, if A is equal to B, you should print "YES", or print "NO". Input each test case contains two numbers A and B. Output for each case, if A is equal to B, you should print "YES&qu…
Problem Description Give you two numbers A and B, if A is equal to B, you should print "YES", or print "NO". Input each test case contains two numbers A and B. Output for each case, if A is equal to B, you should print "YES&qu…
King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember history, King plans to play losephus problem in the parade gap.He calls n(1≤n≤5000) soldiers, counterclockwise in a circle, in label 1,2,3...n. The firs…