hdu 5276 YJC tricks time 数学
YJC tricks time
Time Limit: 20 Sec
Memory Limit: 256 MB
题目连接
http://acm.hdu.edu.cn/showproblem.php?pid=5276
Description
YJC收到了一份神秘礼物。是一个长成这样的钟。
YJC不是时间领主所以他并不能乱搞时间,但是这个钟实在是太难认了!所以他想来耍耍你。
现在YJC给你时针和分针间的夹角,让你告诉他现在是什么时候。
你将以以下格式给出可能的时间:
HH:MM:SS
分别表示小时,分钟,秒(比如:08:30:20)在这里使用12小时制,也就是说时间范围是从00:00:00到11:59:59
另外,YJC不想要太精确的时间,所以当且仅当SS mod 10 = 0,答案才合法。
Input
多组数据,数据组数 ≤1000。
对于每组数据每行输入一个整数x表示角度,为了方便x乘了12000(这样你就不用使用浮点型读入而可以使用整数)。在这题里我们使用角度制。角度按成的劣角算。所以x不会超过 12000∗180=2160000。
Output
对于每组数据:
输出T行。T表示这组数据答案总数。
以时间递增的顺序输出答案。(如果找不到合法答案,这组数据什么都不要输出)
Sample Input
99000
0
Sample Output
00:01:30
11:58:30
00:00:00
HINT
题意
题解:
初中数学题……
代码
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
#include <stack>
typedef long long ll;
using namespace std;
//freopen("D.in","r",stdin);
//freopen("D.out","w",stdout);
#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
#define test freopen("test.txt","r",stdin)
#define maxn 1050005
#define mod 10007
#define eps 1e-9
const int inf=0x3f3f3f3f;
const ll infll = 0x3f3f3f3f3f3f3f3fLL;
inline ll read()
{
ll x=,f=;char ch=getchar();
while(ch<''||ch>''){if(ch=='-')f=-;ch=getchar();}
while(ch>=''&&ch<=''){x=x*+ch-'';ch=getchar();}
return x*f;
}
//**************************************************************************************
int kiss=*;
int main()
{
int x;
while(cin>>x)
{ for(int i=;i<;i++)
{
for(int j=;j<=;j++)
{
for(int k=;k<=;k+=)
{
int t1=**i+*j+*k;
int t2=**j+*k;
int t=(t1-t2);
while(t>=kiss)
t-=kiss;
while(t<)
t+=kiss;
if(t>kiss/)
t=kiss-t;
if(t==x)
printf("%02d:%02d:%02d\n",i,j,k);
}
}
}
}
}
hdu 5276 YJC tricks time 数学的更多相关文章
- HDU - 5276 YJC tricks time
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5276 Sample Input 99000 0 Sample Output 00:01:30 ...
- HDOJ 5276 YJC tricks time multimap
multimap的使用 YJC tricks time Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/262144 K ...
- 暴力 BestCoder Round #46 1001 YJC tricks time
题目传送门 /* 暴力:模拟枚举每一个时间的度数 详细解释:http://blog.csdn.net/enjoying_science/article/details/46759085 期末考结束第一 ...
- hdu 5277 YJC counts stars
hdu 5277 YJC counts stars 题意: 给出一个平面图,n个点,m条边,直线边与直线边之间不相交,求最大团的数目. 限制: 1 <= n <= 1000 思路: 因为平 ...
- hdu 5277 YJC counts stars 暴力
YJC counts stars Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php? ...
- 2017"百度之星"程序设计大赛 - 复赛1003&&HDU 6146 Pokémon GO【数学,递推,dp】
Pokémon GO Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- HDU 5810 Balls and Boxes 数学
Balls and Boxes 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5810 Description Mr. Chopsticks is i ...
- hdu 1577 WisKey的眼神 (数学几何)
WisKey的眼神 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total S ...
- hdu - 3959 Board Game Dice(数学)
这道题比赛中没做出来,赛后搞了好久才出来的,严重暴露的我薄弱的数学功底, 这道题要推公式的,,,有类似于1*a+2*a^2+3*a^3+...+n*a^n的数列求和. 最后画了一张纸才把最后的结果推出 ...
随机推荐
- hdu 1850 Being a Good Boy in Spring Festival(Nimm Game)
题意:Nimm Game 思路:Nimm Game #include<iostream> #include<stdio.h> using namespace std; int ...
- [转]Linux文件和目录操作命令
转自:http://www.linuxdiyf.com/bbs/thread-416176-1-1.html 一.文件操作命令1.1 查看文件 Linux下查看文件的命令有很多,下面列出的几个是几乎所 ...
- html中的div、td 、p 等容器内强制换行和不换行的实现
div.td .p 等容器内强制换行和不换行,在某些情况下还是比较实用的,下面本文整理了一些相关方面的知识,并有具体的实现方法,需要的朋友可以参考下1.强制不换行,同时以省略号结尾. 代码如下:< ...
- HTML5_布局and音视频
HTML5_布局and音视频 I.HTML5标签的改变1.文档声明HTML语法是不区分大小写的HTML5的DTD声明为:<!doctype html>确保浏览器能在HTML5的标准模式下进 ...
- git 换行符问题
git 换行符问题 在windows环境中 对于autocrlf = false 不会激发 关于换行符的处理 对于autocrlf = true 会在提交是将LF替换成CRLF 切出时时CRLF 对于 ...
- 【转】requirejs简单入门
博主今天正式工作啦,工作中用到了js模块化技术,这里转来一个入门教程,很易懂,转给同样刚入门的你们~~ 原地址:http://www.ruanyifeng.com/blog/2012/11/requi ...
- C#语言基础02
字符串:string s="ab";string s1="a\nb";//n:newline或者next的意思. string s="a\\b&quo ...
- Office2013版的破解之路
追着潮流,我还是更新了我的所有软件,2013版早就下载了,因为一直破解的问题没有装,这次终于找到必成功的办法. 1.准备工作: 下载office2013的官方版即可,官方版里不包含project和vi ...
- LeetCode Database: Consecutive Numbers
Consecutive Numbers Write a SQL query to find all numbers that appear at least three times consecuti ...
- 解决ext时间插件在谷歌下变宽的BUG
在做一个项目时候遇到EXT这么一个问题,现分享出解决问题的代码 Ext.override(Ext.menu.DateMenu, { render: function () { Ext.menu.Dat ...