题目大意:有两个表,每天都会慢一点时间,给出每天慢得秒数,问下一次重合的时刻。

解题思路:时刻重合也就是说整整差了一周,一周是12小时,用12小时的秒数除以两个表的相差那就是需要多少天的时间后重合,知道了需要多少天*每一天某个表走的时间(注意要减去少走的时间)即使答案,化成时间的格式即可,注意0时显示成12时。

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int m, c, h, t1, t2;
    double t3;
    long long n;
    while(~scanf("%d%d",&t1,&t2))
    {
        if(t1==t2)
        {
            printf("%d %d 12:00\n",t1,t2);
            continue;
        }
        c=abs(t1-t2);
        t3=12.0*3600.0/c;
        *-t1);
        n %=;
        m=n/;
        n%=;
        ) m++;
        h=m/;
        m%=;
        ) h=;
        printf("%d %d %02d:%02d\n",t1,t2,h,m);
    }
    ;
}

UVA10339 Watching Watches的更多相关文章

  1. Uva 10339 - Watching Watches【数论,暴力】

    题目链接:10339 - Watching Watches 题意:两个时钟,一个每天慢a秒,一个每天慢b秒,问两钟重新相遇的时刻 1圈有12 * 60 * 60秒,然后1圈 / abs(a - b), ...

  2. UVA - 10339-Watching Watches

    10339 - Watching Watches Time limit: 3.000 seconds It has been said that a watch that is stopped kee ...

  3. Zookeeper 监视(Watches) 简介(转)

    Zookeeper C API 的声明和描述在 include/zookeeper.h 中可以找到,另外大部分的 Zookeeper C API 常量.结构体声明也在 zookeeper.h 中,如果 ...

  4. Codeforces Round #219 (Div. 1) C. Watching Fireworks is Fun

    C. Watching Fireworks is Fun time limit per test 4 seconds memory limit per test 256 megabytes input ...

  5. Codeforces Round #219 (Div. 2) E. Watching Fireworks is Fun

    http://codeforces.com/contest/373/problem/E E. Watching Fireworks is Fun time limit per test 4 secon ...

  6. 6656 Watching the Kangaroo

    6656 Watching the KangarooDay by day number of Kangaroos is decreasing just liketiger, whale or lion ...

  7. Error watching file for changes: EMFILE

    运行reactnative项目时在编译过程中报错 Error watching file for changes: EMFILE 故障原因: 是升级后watchman不可用了,需要重装watchman ...

  8. Listen error 错误和 limit of inotify watches was reached

    今天在生产环境中报错rails c中报了一个错误: FATAL: Listen error: unable to monitor directories for changes. Visit http ...

  9. Containerpilot 配置文件 之 Watches

    watch是在consul进行监视的服务配置. watch轮询服务的状态,并在服务变得健康,变得不健康或者实例数量发生变化时发出事件. 请注意,watch不包括行为; watch只发出事件,以便job ...

随机推荐

  1. 类名.class, class.forName(), getClass()区别

    1:Class cl=A.class; JVM将使用类A的类装载器, 将类A装入内存(前提是:类A还没有装入内存),不对类A做类的初始化工作.返回类A的Class的对象. 2:Class cl=对象引 ...

  2. 让git忽略文件模式的改变

    使用git的过程中发现,就算文件的内容没改变,只有文件的权限改变的话,git也会检测到文件被修改了. 解决方法是配置一下: git config --global core.filemode fals ...

  3. location.reload()加载时有弹出框

    解决办法: 1.试试 window.location.href=window.location.href 2.当前页有被post数据的时候reload就会提示刷新 可以尝试重新定向页面地址 3.rel ...

  4. JSON转换类

    MXS&Vincene  ─╄OvЁ  &0000010 ─╄OvЁ  MXS&Vincene MXS&Vincene  ─╄OvЁ:今天很残酷,明天更残酷,后天很美好 ...

  5. ==,equal,hasCode(),identifyHasCode()浅析

    在java中如果我们要比较两个对象之间的关系的话有可能会用到下面的几种方法:==,equal,hasCode(),identifyHasCode(). ==用来比较对象本身是不是相同的. public ...

  6. Ubuntu 14.04 安装 JDK 7.0

    1.新建jvm文件夹-解压 # mkdir /usr/lib/jvm # tar zxvf jdk-7u79-linux-x64.gz -C /usr/lib/jvm 2.设置环境变量,在/etc/p ...

  7. Java学习网站

    黑马: http://bbs.itheima.com/forum.php 考试网站: http://www.nowcoder.com/ 牛客网 比较专业的学习技术网站: http://www.ibm. ...

  8. HDU 5787:K-wolf Number(数位DP)

    题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=5787 题意:要求相邻的K个位的数不能相同,在[L,R]区间有多少个这样的数. #inclu ...

  9. 嵌入式jetty的HTTP实现

    2    嵌入式jetty的HTTP实现 布拉君君 2.1 简单HTTP实现 2.1.1 HTTP SERVER端实现 2.1.1.1 HTTP SERVER端实现概述 在代码中嵌入一个Jetty s ...

  10. 完整学习git四git对象

    1查看git对象 git cat-file 实践 git head到底指向的是什么 ➜ gittest git:(master) find .git -name HEAD -o -name maste ...