hdu5276 YJC tricks time(水题)

2023-10-13 11:10
文章标签 水题 time tricks yjc hdu5276

本文主要是介绍hdu5276 YJC tricks time(水题),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

思路:水题


#include<bits/stdc++.h>
using namespace std;
const int mod = 360*12000;
int main()
{int t;while(scanf("%d",&t)!=EOF){for(int i = 0;i<12;i++)for(int j = 0;j<=59;j++)for(int k = 0;k<=50;k+=10){int t1 = 30*12000*i+6000*j+100*k;int t2 = 12000*6*j+1200*k;int tt = (t1-t2);while(tt>=mod)tt-=mod;while(tt<0)tt+=mod;if(tt>mod/2)tt = mod-tt;if(tt==t)printf("%02d:%02d:%02d\n",i,j,k);}}
}


Description

YJC received a mysterious present. It's a clock and it looks like this. 



YJC is not a timelord so he can't trick time but the clock is so hard to read. So he'd like to trick you. 

Now YJC gives you the angle between the hour hand and the minute hand, you'll tell him what time it is now. 

You'll give him the possible time in the format: 

HH:MM:SS

HH represents hour, MM represents minute, SS represents second. 
(For example,  08:30:20

We use twelve hour system, which means the time range is from  00:00:00  to  11:59:59

Also, YJC doesn't want to be too accurate, one answer is considered acceptable if and only if SS mod 10 = 0 .

Input

Multiple tests.There will be no more than  1000  cases in one test. 
for each case: 

One integer  x  indicating the angle, for convenience,  x  has been multiplied by  12000 . (So you can read it as integer not float) In this case we use degree as the unit of the angle, and it's an inferior angle. Therefore,  x  will not exceed 12000*180=2160000 .

Output

For each case: 

T  lines.  T  represents the total number of answers of this case. 

Output the possible answers in ascending order. (If you cannot find a legal answer, don't output anything in this case)

Sample Input

    
99000 0

Sample Output

    
00:01:30 11:58:30 00:00:00


这篇关于hdu5276 YJC tricks time(水题)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/202773

相关文章

python中time模块的常用方法及应用详解

《python中time模块的常用方法及应用详解》在Python开发中,时间处理是绕不开的刚需场景,从性能计时到定时任务,从日志记录到数据同步,时间模块始终是开发者最得力的工具之一,本文将通过真实案例... 目录一、时间基石:time.time()典型场景:程序性能分析进阶技巧:结合上下文管理器实现自动计时

MySQL中时区参数time_zone解读

《MySQL中时区参数time_zone解读》MySQL时区参数time_zone用于控制系统函数和字段的DEFAULTCURRENT_TIMESTAMP属性,修改时区可能会影响timestamp类型... 目录前言1.时区参数影响2.如何设置3.字段类型选择总结前言mysql 时区参数 time_zon

Python 标准库time时间的访问和转换问题小结

《Python标准库time时间的访问和转换问题小结》time模块为Python提供了处理时间和日期的多种功能,适用于多种与时间相关的场景,包括获取当前时间、格式化时间、暂停程序执行、计算程序运行时... 目录模块介绍使用场景主要类主要函数 - time()- sleep()- localtime()- g

如何使用 Bash 脚本中的time命令来统计命令执行时间(中英双语)

《如何使用Bash脚本中的time命令来统计命令执行时间(中英双语)》本文介绍了如何在Bash脚本中使用`time`命令来测量命令执行时间,包括`real`、`user`和`sys`三个时间指标,... 使用 Bash 脚本中的 time 命令来统计命令执行时间在日常的开发和运维过程中,性能监控和优化是不

uva 10055 uva 10071 uva 10300(水题两三道)

情歌两三首,水题两三道。 好久没敲代码了为暑假大作战热热身。 uva 10055 Hashmat the Brave Warrior 求俩数相减。 两个debug的地方,一个是longlong,一个是输入顺序。 代码: #include<stdio.h>int main(){long long a, b;//debugwhile(scanf("%lld%lld", &

linux 下Time_wait过多问题解决

转自:http://blog.csdn.net/jaylong35/article/details/6605077 问题起因: 自己开发了一个服务器和客户端,通过短连接的方式来进行通讯,由于过于频繁的创建连接,导致系统连接数量被占用,不能及时释放。看了一下18888,当时吓到了。 现象: 1、外部机器不能正常连接SSH 2、内向外不能够正常的ping通过,域名也不能正常解析。

python内置模块datetime.time类详细介绍

​​​​​​​Python的datetime模块是一个强大的日期和时间处理库,它提供了多个类来处理日期和时间。主要包括几个功能类datetime.date、datetime.time、datetime.datetime、datetime.timedelta,datetime.timezone等。 ----------动动小手,非常感谢各位的点赞收藏和关注。----------- 使用datet

Codeforces Round #182 (Div. 2)A(水题)

题目链接:http://codeforces.com/contest/302/problem/A 解题思路: 只要通过重新排列使区间内和为0即是1,否则是0. 完整代码: #include <algorithm>#include <iostream>#include <cstring>#include <complex>#include <cstdio>#inc

2015多校联合训练第一场Tricks Device(hdu5294)

题意:给一个无向图,给起点s,终点t,求最少拆掉几条边使得s到不了t,最多拆几条边使得s能到t 思路: 先跑一边最短路,记录最短路中最短的边数,总边数-最短边数就是第二个答案 第一个答案就是在最短路里面求最小割,也就是求最大流,然后根据最短路在建个新图,权为1,跑一边网络流 模板题,以后就用这套模板了 #include <iostream>#include <cstdio>#incl

HDU 2064 汉诺塔III(水题)

题目: http://acm.hdu.edu.cn/showproblem.php?pid=2064 题目大意: 有三根杆,求把n个圆盘从左边移到右边,最少需要移动圆盘的次数。移动规则为大盘不能放在小盘上,比原始的汉诺塔题改变的地方是,只能通过中间的杆往左右两边的杆移动。 心得: 此题心得在题外,不在题内,初看此题,尼玛吓了一跳,好像很难的样子,手贱百度了一下,只注意到俩字“水题”,赶紧