题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1209

注意:1、时钟到12要变为0

2、注意比较角度相同的情况

#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
struct Node{
int hh,mm,tim;
double jd;
};
Node du[];
bool cmp(Node a,Node b)
{
return a.jd<b.jd;
//else return a.tim<b.tim;
}
int main(void)
{
int hh,mm,tim;
double ans;
int t,i;
scanf("%d",&t);
while(t--)
{
for(i=;i<;i++)
{
scanf("%d:%d",&hh,&mm);
du[i].hh=hh;du[i].mm=mm;
du[i].tim=hh*+mm;
if(hh>=) hh-=;
du[i].jd=fabs(hh*+mm*0.5-mm*);
if(du[i].jd>=) du[i].jd=(-du[i].jd);
}
sort(du,du+,cmp);
//for(i=0;i<5;i++)
printf("%02d:%02d\n",du[].hh,du[].mm);
//printf("\n");
}
return ;
}

hdu-1209(细节题)的更多相关文章

  1. HDU 1209

    http://acm.hdu.edu.cn/showproblem.php?pid=1209 水题,按五个时针分针成的锐角从小到大排序,角度相同时间从早到晚,输出中间的那个 时针一小时走30度,一分钟 ...

  2. Codeforces Round #392 (Div. 2)-758D. Ability To Convert(贪心,细节题)

    D. Ability To Convert time limit per test 1 second Cmemory limit per test 256 megabytes input standa ...

  3. 【线段树 细节题】bzoj1067: [SCOI2007]降雨量

    主要还是细节分析:线段树作为工具 Description 我们常常会说这样的话:“X年是自Y年以来降雨量最多的”.它的含义是X年的降雨量不超过Y年,且对于任意Y<Z<X,Z年的降雨量严格小 ...

  4. HDU-1042-N!(Java大法好 &amp;&amp; HDU大数水题)

    N! Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Total Subm ...

  5. 【转载】 HDU 动态规划46题【只提供思路与状态转移方程】

    1.Robberies 连接 :http://acm.hdu.edu.cn/showproblem.php?pid=2955      背包;第一次做的时候把概率当做背包(放大100000倍化为整数) ...

  6. HDU 自动刷题机 Auto AC (轻轻松松进入HDU首页)

    前言: 在写这篇文章之前,首先感谢给我思路以及帮助过我的学长们 以下4篇博客都是学长原创,其中有很多有用的,值得学习的东西,希望能够帮到大家! 1.手把手教你用C++ 写ACM自动刷题神器(冲入HDU ...

  7. zoj 3745 Salary Increasing(坑爹的细节题!)

    题目 注意题目中的,引用绝望的乐园中的进一步解释如下: 这是一道浙大月赛的题,一如既往的坑爹,好好一道水题,被搞成一道坑题!!! //注意:r(i) < l(i+1) !细节啊细节! #incl ...

  8. hdu 5326(基础题) work

    http://acm.hdu.edu.cn/showproblem.php?pid=5326 一道水题,题目大意是在公司里,给出n个员工和目标人数m,然后下面的n-1行是表示员工a管理b,问在这些员工 ...

  9. hdu 5162(水题)

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5162 题解:看了半天以为测试用例写错了.这题玩文字游戏.它问的是当前第i名是原数组中的第几个. #i ...

随机推荐

  1. Yii2 基础学习

    <?php //url创建 echo Url::to(''); // same controller, different action // /index.php?r=management/d ...

  2. gevent 实现io自动切换,gevent.join([]), gevent.spawn, 爬虫多并发的实现

    gevent 是一个第三方库,可以很容易的实现遇到io(文件传输)操作时,程序自动跳转到下一个程序 例一: 用gevent.sleep()  来模拟io操作 import gevent def foo ...

  3. Tocmat 启动错误 Port 8005 required by tomcat v7.0 server at localhost is already in use

    1: netstat -ano!findstr 8005 2: taskkill /pid 6476 /f

  4. AS3 注意点

    当主类new 一个主影片来放内容的时候.在gc此swf时,一定要检查此主影片是否存在,如 private function initStart() { //trace("RightMenu类 ...

  5. Haskell语言学习笔记(44)Lens(2)

    自定义 Lens 和 Isos -- Some of the examples in this chapter require a few GHC extensions: -- TemplateHas ...

  6. Spring Boot 连接池

    配置方法 基于当前的1.5.2.RELEASE的Spring Boot. 依照官方文档,如果增加了如下依赖的配置,或者类路径中存在spring-boot-starter-jdbc的jar,那么已默认启 ...

  7. Subquery typo with using in(转)

    Subquery typo with using in Do you use the following syntax?   SELECT * FROM TABLE WHERE COLUMN IN ( ...

  8. 在c#下用 WCF编写restful

    1.添加WCF服务库 2.在global里面注册路由 RouteTable.Routes.Add(new ServiceRoute("api", new WebServiceHos ...

  9. springboot引入springSecurity无法post提交表单

    参考https://blog.csdn.net/shawearn1027/article/details/71119587 表单中添加<input type="hidden" ...

  10. e.g.-basic-Si

    ! Band structure of silicon. The points listed after plot1d below are the ! vertices joined in the b ...