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的数列求和. 最后画了一张纸才把最后的结果推出 ...
随机推荐
- 在Mac OS X 通过抓包、“第三方下载工具”加速下载、安装APP或系统
#!/bin/bash ######################################################################################## ...
- Struts2注解 特别注意
1 Struts2注解的作用 使用注解可以用来替换struts.xml配置文件!!! 2 导包 必须导入struts2-convention-plugin-2.3.15.jar包,它在struts2安 ...
- java 开发环境
jdk:包括jre,自己下载即可. 客户端只需安装jre即可. 安装路径:C:\jdk7.0\jdk1.7.0_25\bin (适时更改) 环境变量是从前往后找 测试成功:cmd java ...
- 【整理】JavaEE基本框架(Struts2+Spring+MyBatis三层,Struts MVC)之间的关系
#[整理]JavaEE基本框架(Struts2+Spring+MyBatis三层,Struts MVC)之间的关系 viewDidAppear:(BOOL)animated 或 -(void)viewWillAppear:(BOOL)animated 假如放在 view ...
- .net 数据库连接池超时问题
一.数据库Connection Pool 连接池是什么 每当程序需要读写数据库的时候.Connection.Open()会使用ConnectionString连接到数据库,数据库会为程序建立 一个连接 ...
- INTEL XDK 真机调试
需要安装 1.google服务框架 2.google play 3.app preview
- C++Bulder DataSnap 内存泄露元凶
DSServerClass1 DSServerClass1DestroyInstance void __fastcall TServerContainer1::DSServerClass1Destro ...
- Extjs4.2纯前台导出Excel总结
前段时间做了两个项目,用到了Extjs4.2纯前台导出Excel,遇到很多的问题,从网上也找了很多资料,在这里总结一下,做一个记录: 使用方法: 1.下载extexcel文件包,这里可以下载http: ...