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 数学的更多相关文章

  1. HDU - 5276 YJC tricks time

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5276   Sample Input 99000 0   Sample Output 00:01:30 ...

  2. HDOJ 5276 YJC tricks time multimap

    multimap的使用 YJC tricks time Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 524288/262144 K ...

  3. 暴力 BestCoder Round #46 1001 YJC tricks time

    题目传送门 /* 暴力:模拟枚举每一个时间的度数 详细解释:http://blog.csdn.net/enjoying_science/article/details/46759085 期末考结束第一 ...

  4. hdu 5277 YJC counts stars

    hdu 5277 YJC counts stars 题意: 给出一个平面图,n个点,m条边,直线边与直线边之间不相交,求最大团的数目. 限制: 1 <= n <= 1000 思路: 因为平 ...

  5. hdu 5277 YJC counts stars 暴力

    YJC counts stars Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php? ...

  6. 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 ...

  7. HDU 5810 Balls and Boxes 数学

    Balls and Boxes 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5810 Description Mr. Chopsticks is i ...

  8. hdu 1577 WisKey的眼神 (数学几何)

    WisKey的眼神 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total S ...

  9. hdu - 3959 Board Game Dice(数学)

    这道题比赛中没做出来,赛后搞了好久才出来的,严重暴露的我薄弱的数学功底, 这道题要推公式的,,,有类似于1*a+2*a^2+3*a^3+...+n*a^n的数列求和. 最后画了一张纸才把最后的结果推出 ...

随机推荐

  1. 13、NFC技术:读写非NDEF格式的数据

    MifareUltralight数据格式 将NFC标签的存储区域分为16个页,每一个页可以存储4个字节,一个可存储64个字节(512位).页码从0开始(0至15).前4页(0至3)存储了NFC标签相关 ...

  2. jquery图片裁切+PHP文件上传

    下载地址:download.csdn.net/source/2745353

  3. 安卓 开发 The connection to adb is down, and a severe error has occured.

    The connection to adb is down, and a severe error has occured.问题解决 其原因就是其他进程占用了  ADB的端口,所以无法启动 遇到问题描 ...

  4. ansible安装及问题解决

    本文主要用来安装ansible,在进行安装的时候,也可以使用其他的版本进行安装,本文主要讲述安装ansible的步骤,还有常用问题的解决. 1.查看python版本 由此可以看到python的版本为2 ...

  5. Leetcode 225 Implement Stack using Queues

    Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. po ...

  6. 数往知来 asp.net 聊天室问题解决方案<十六>

      1:在服务端创建了一个负责监听的sokcet   //三个:采用TCP协议.              ListenSocket = new Socket(AddressFamily.InterN ...

  7. CreateThread函数&&CString::GetBuffer函数

    对这个两个常见的windows下的函数学习了一下: //最简单的创建多线程实例 #include <stdio.h> #include <windows.h> //子线程函数 ...

  8. Axure中继器基础教程(增行、删当前、标记、全部、规则行) Mark

    ---恢复内容开始--- 一.中继器的新增行 中继器所显示的列表项与中继器的数据集有关,默认情况下是一一对应的.也就是说,中继器数据集中有多少行数据,那么,列表项就有多少个. 那么,我们能不能通过新增 ...

  9. .net/c#连接sqlserver

    Webconfig代码 <configuration> <appSettings> <add key="myconnect" value=" ...

  10. 45个有新意的Photoshop教程和技巧

    图形制作者和网页设计师已经准备好迎接新的Adobe Photoshop 教程了.在大家喜欢背后有许多它的理由,诸如Adobe Photoshop很容易操作,学习起来十分简单,但最重要的一点是这款软件能 ...