Problem Description
Give a time.(hh:mm:ss),you should answer the angle between any two of the minute.hour.second hand
Notice that the answer must be not more 180 and not less than 0
Inpu...
分类:
其他好文 时间:
2015-08-13 23:46:29
阅读次数:
196
Clock
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 377 Accepted Submission(s): 200
Problem Description
Give a time.(hh:mm:ss)...
分类:
其他好文 时间:
2015-08-13 23:42:32
阅读次数:
161
题目地址:HDU 5387
题意:给你一个格式为hh:mm:ss的时间,问时针与分针、时针与秒针、分针与秒针之间夹角的度数是多少,若夹角度数不是整数,则输出A/B最简分数形式。
思路:每秒钟,分针走是0.1°,时针走(1/120)°;每分钟,时针走0.5°。所以对于时针的角度来说总共走动了h*30+m*0.5+s/120,对于分针的角度来说总共走掉了m*6+s*0.1,对于秒针来说,总共走动了s...
分类:
其他好文 时间:
2015-08-13 22:23:37
阅读次数:
145
题目传送门 1 /* 2 模拟:这题没啥好说的,把指针转成角度处理就行了,有两个注意点:结果化简且在0~180内;小时13点以后和1以后是一样的(24小时) 3 模拟题伤不起!计算公式在代码内(格式:hh/120, mm/120, ss/120) 4 */ 5 /******...
分类:
其他好文 时间:
2015-08-13 21:57:11
阅读次数:
171
题意:
给你一个格式为hh:mm:ss的时间,问:该时间时针与分针、时针与秒针、分针与秒针之间夹角的度数是多少。
若夹角度数不是整数,则输出最简分数形式A/B,即A与B互质。
解析:
先计算出总的秒数 S=hh?3600+mm?60+ssS = hh * 3600 + mm * 60 + ss
因为秒钟每秒走1°,
所以当前时间,秒钟与12点的度数为 S%360S...
分类:
其他好文 时间:
2015-08-13 20:15:29
阅读次数:
136
初写接口的代码要精简,就要注意以下几点:1.接口的输入数据格式判断是否满足要求;应使用Try Catch判断输入的格式是否正确,不正确应进行相应的提醒。2.输入数据格式的转换:.输入数据的格式要转换为最适合算法处理的格式,比如,输入的字符串类型为"yyyy/MM/dd HH:mm:ss",此为时间格...
分类:
其他好文 时间:
2015-08-13 20:01:12
阅读次数:
100
代码:
#include
#include
#include
#include
using namespace std;
int f(int a)
{
return a>0?a:(-a);
}
int gcd(int a,int b)
{
return b>0?gcd(b,a%b):a;
}
int main()
{
int t;
int hh,mm,ss;...
分类:
其他好文 时间:
2015-08-13 18:01:28
阅读次数:
96
记录下模板。刚学了一下,看了别人的一份模板,自己打了一下,以后就用这个吧 1 #include 2 #include 3 char s[1000005],ss[10005]; 4 int next[10005],ans; 5 void getNext(int len){ 6 int i ...
分类:
其他好文 时间:
2015-08-13 06:22:38
阅读次数:
120
/** * 插入oracle TimeStamp类型 */ public void insertTimeStamp(){ try { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); String m...
分类:
其他好文 时间:
2015-08-13 01:09:50
阅读次数:
135
SQL Server迁移助手(SSMA)团队开发了针对MySQL的迁移助手Microsoft SQL Server Migration Assistant 2008 for MySQL。微软同时发布了其他三个迁移助手: SSMA for Access, SSMA for Oracle, and SS...
分类:
数据库 时间:
2015-08-12 23:12:02
阅读次数:
281