HDU--1006】的更多相关文章

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1006 题目大意:钟表有时.分.秒3根指针.当任意两根指针间夹角大于等于n°时,就说他们是happy的,问一天有百分之多少时间是happy的. 关键思想:两根指针两根指针地考虑,从重合到重合中有且仅有一段连续时间这两根指针是happy的.共有3种组合(时分.分秒.时秒),所以若以时间为横轴,夹角为纵轴,图像为三个连续三角形.另y大于等于n,得到的图像求符合区间的长度. 代码如下: //多个连续三角区域…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1006 Tick and Tick Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 22203    Accepted Submission(s): 5877 Problem Description The three hands of the…
一開始思考的时候认为好难的题目,由于感觉非常多情况.不知道从何入手. 想通了就不难了. 能够转化为一个利用速度建立不等式.然后解不等式的问题. 建立速度,路程,时间的模型例如以下: /*************************************************************************** * * * 秒钟的速度s=6°/s,分针是1/10°/s,时针是1/120°/s * * 所以相对速度s_m=59/10°/s,s_h=719/120°/s,m_h…
Problem Description The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value contains two or more digits, those digits a…
Tick and Tick Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10194    Accepted Submission(s): 2859 Problem Description The three hands of the clock are rotating every second and meeting each ot…
题意是说求出在一天中时针.分针.秒针之间距离均在 D 度以上的时间占比. 由于三针始终都在转动,所以要分别求出各个针之间的相对角速度,分别求出三针满足角度差的首次时间,再分别求出不满足角度差的最终时间,取这三个时间段的交集,也就是首次时间的最大值和最终时间的最小值之间的部分,要注意剪枝,去掉多余的部分,否则会超时的, 本人的代码也是借鉴了别人写出来的.代码如下: #include <bits/stdc++.h> using namespace std; ;//时针分针相对角速度hm = m -…
Problem Description The three hands of the clock are rotating every second and meeting each other many times everyday. Finally, they get bored of this and each of them would like to stay away from the other two. A hand is happy if it is at least D de…
Tick and Tick Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 16707    Accepted Submission(s): 4083 Problem Description The three hands of the clock are rotating every second and meeting each ot…
Tick and Tick Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 19764    Accepted Submission(s): 5164 Problem Description The three hands of the clock are rotating every second and meeting each ot…
Tick and Tick Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 20120    Accepted Submission(s): 5262 Problem Description The three hands of the clock are rotating every second and meeting each ot…