HDU 5276 YJC Tricks time Math

Source: Internet
Author: User

YJC Tricks Time

Time Limit:20 Sec

Memory limit:256 MB

Topic Connection

http://acm.hdu.edu.cn/showproblem.php?pid=5276

Description

YJC received a mysterious gift. It's a clock that grows like this.


YJC is not a Time Lord so he can not make time, but this clock is too difficult to recognize! So he wanted to play with you.

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

You will give the possible time in the following format:
HH:MM:SS
The hours, minutes, seconds (for example: 08:30:20) are used here for 12 hours, meaning the time range is from 00:00:00 to 11:59:59

In addition, YJC does not want to be too precise in time, so when and only if SS mod 10 = 0, the answer is legal.

Input

Multiple sets of data, number of data groups ≤1000.
For each set of data enter an integer x for the angle, in order to facilitate X by 12000 (so that you do not use floating-point reading and can use an integer). In this problem we use the angle system. The angle is calculated as the inferior angle. So x does not exceed 12000∗180=2160000.

Output

For each group of data:
Output T line. T represents the total number of answers to this set of data.
Output the answer in the order of time increments. (If no legal answer is found, do not export this set of data)

Sample Input

99000
0

Sample Output

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

HINT

Test instructions

Exercises

Junior high School math problem ...

Code

#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>typedefLong Longll;using namespacestd;//freopen ("d.in", "R", stdin);//freopen ("D.out", "w", stdout);#defineSspeed ios_base::sync_with_stdio (0); Cin.tie (0)#defineTest Freopen ("Test.txt", "R", stdin)#defineMAXN 1050005#defineMoD 10007#defineEPS 1e-9Const intinf=0x3f3f3f3f;Constll infll =0x3f3f3f3f3f3f3f3fll;inline ll Read () {ll x=0, f=1;CharCh=GetChar ();  while(ch<'0'|| Ch>'9'){if(ch=='-') f=-1; ch=GetChar ();}  while(ch>='0'&&ch<='9') {x=x*Ten+ch-'0'; ch=GetChar ();} returnx*F;}//**************************************************************************************intkiss= the*12000;intMain () {intx;  while(cin>>x) { for(intI=0;i< A; i++)        {             for(intj=0; j<= -; j + +)            {                 for(intk=0; k<= -; k+=Ten)                {                    intt1= -*12000*i+6000*j+ -*K; intT2=12000*6*j+ -*K; intT= (t1-T2);  while(t>=Kiss) T-=Kiss;  while(t<0) T+=Kiss; if(t>kiss/2) T=kiss-T; if(t==x) printf ("%02d:%02d:%02d\n", i,j,k); }            }        }    }}

HDU 5276 YJC Tricks time Math

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.