HDU 2104 hide handkerchief】的更多相关文章

题解:由题目可以知道,如果n和m的最大公约数不为1,那么总有箱子是无法遍历的,所以求一遍GCD就可以判断了. 注意点:一定要记住判断是==,在做题时又忘了. #include <cstdio> int gcd(int a,int b) { ) return(a); else return(gcd(b,(a%b))); } int main() { int n,m; ||m!=-) { ) puts("YES"); else puts("POOR Haha"…
Problem Description The Children’s Day has passed for some days .Has you remembered something happened at your childhood? I remembered I often played a game called hide handkerchief with my friends.Now I introduce the game to you. Suppose there are N…
#include <iostream> using namespace std; int gcd(int a,int b) { return (b?gcd(b,a%b):a); } int main() { int m,n; while(cin>>m>>n&&m+n!=-2) { if(gcd(m,n)==1) cout<<"YES\n"; else cout<<"POOR Haha\n";…
Problem Description The Children’s Day has passed for some days .Has you remembered something happened at your childhood? I remembered I often played a game called hide handkerchief with my friends.Now I introduce the game to you. Suppose there are N…
hide handkerchief Time Limit: 10000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3970    Accepted Submission(s): 1884 Problem Description The Children’s Day has passed for some days .Has you remembered someth…
The Children's Day has passed for some days .Has you remembered something happened at your childhood? I remembered I often played a game called hide handkerchief with my friends. Now I introduce the game to you. Suppose there are N people played the…
题目链接:http://61.187.179.132/JudgeOnline/problem.php?id=1941 题意:给出平面上n个点,找出一点p,使得距离p最近和最远的点的距离之差最小.输出这个差值. 思路: 计算出距离每个点最近的点的距离和最远点的的距离.怎么计算呢?首先我们计算每个点到其左下角的那些点的最近最远距离.只要按照x升序然后y升序,之后将y离散化.一个一个插入到树状数组中.这样的话(x2+y2)-(x1+y1)的差值就是它们的距离.对于其右下角.左上角.右上角乘以(-1,1…
思考:这种找手绢就是,在判断是否互质.用辗转相除法(用来求最大公约数:a)进行判断.r=a%b;a=b;b=r;循环限制条件:除数b=0是结束除法.如果这时被除数a=1,则表示两个互质. #include<stdio.h> int main() { int N,M; char d; while(scanf("%d%d%c",&N,&M,&d)!=EOF) { &&M==-) break; int r; ) { r=N%M; N=M;…
HDU 1000 A + B Problem  I/O HDU 1001 Sum Problem  数学 HDU 1002 A + B Problem II  高精度加法 HDU 1003 Maxsum  贪心 HDU 1004 Let the Balloon Rise  字典树,map HDU 1005 Number Sequence  求数列循环节 HDU 1007 Quoit Design  最近点对 HDU 1008 Elevator  模拟 HDU 1010 Tempter of th…
hide handkerchief Problem Description The Children's Day has passed for some days .Has you remembered something happened at your childhood? I remembered I often played a game called hide handkerchief with my friends. Now I introduce the game to you.…