[Codeforces 816A]Karen and Morning
题目大意:给你一个时间(hh:mm),求最少经过多少分钟才能使这个时间变成回文。
解题思路:模拟,先判断0的情况,然后每过1分钟判断一次即可。
C++ Code:
#include<cstdio>
int main(){
int h,m;
scanf("%d:%d",&h,&m);
if(h==m%10*10+m/10){
puts("0");
return 0;
}
for(int i=1;;++i){
++m;
if(m==60){
m=0;
++h;
if(h==24)h=0;
}
if(h==m%10*10+m/10){
printf("%d\n",i);
return 0;
}
}
}
[Codeforces 816A]Karen and Morning的更多相关文章
- CodeForces 816B Karen and Coffee(前缀和,大量查询)
CodeForces 816B Karen and Coffee(前缀和,大量查询) Description Karen, a coffee aficionado, wants to know the ...
- 【codeforces 816A】Karen and Morning
[题目链接]:http://codeforces.com/contest/816/problem/A [题意] 让你一分钟一分钟地累加时间; 问多长时间以后是个回文串; [题解] reverse之后如 ...
- Codeforces 816A/B
A. Karen and Morning 传送门:http://codeforces.com/contest/816/problem/A 水题,参考程序如下: #include <stdio.h ...
- codeforces 815C Karen and Supermarket
On the way home, Karen decided to stop by the supermarket to buy some groceries. She needs to buy a ...
- Codeforces 815C Karen and Supermarket 树形dp
Karen and Supermarket 感觉就是很普通的树形dp. dp[ i ][ 0 ][ u ]表示在 i 这棵子树中选择 u 个且 i 不用优惠券的最小花费. dp[ i ][ 1 ][ ...
- codeforces 816B.Karen and Coffee 解题报告
题目链接:http://codeforces.com/contest/816/problem/B 题目意思:给出 n 个recipes,第 i 个(1<= i <=n)recipes 表明 ...
- CodeForces - 816C Karen and Game(简单模拟)
Problem Description On the way to school, Karen became fixated on the puzzle game on her phone! The ...
- codeforces 816B Karen and Coffee (差分思想)
题目链接 816B Karen and Coffee 题目分析 题意:有个人在学泡咖啡,因此看了很多关于泡咖啡温度的书,得到了n种推荐的泡咖啡温度范围[L1,R1] ,此人将有k种做法推荐的温度记为可 ...
- Codeforces 815C. Karen and Supermarket【树形DP】
LINK 思路 首先发现依赖关系是一个树形的结构 然后因为直接算花多少钱来统计贡献不是很好 因为数组开不下 那就可以算一个子树里面选多少个的最小代价就可以了 注意统计贡献的时候用优惠券的答案只能在1号 ...
随机推荐
- PHP正则表达式函数总结
/* 测试环境:PHP5.3.29(PCRE8.32) */ 常用函数:(正则表达式规则基本同JS_RE_Read.txt) PS:1.PHP中的PCRE一般仅使用这三个修饰符:"i&quo ...
- 74HC164应用
管脚定义与内部逻辑图 注:管脚一般A.B连在一起作为一个输入:CLR硬件接VDD. 原理如下:每8个CLK上升沿,bit分别从QA移至QH,所以给定一个字节,左移后送入至A/B,这样Bit7经过8个上 ...
- 1028C:Rectangles
You are given n rectangles on a plane with coordinates of their bottom left and upper right points. ...
- 虚拟集群LVS及DR模式搭建笔记
LVS(虚拟集群Linux Virtual Server) LVS-NAT:地址转换,数据包来回都要经过NAT转换,所以Director Server(即LVS服务器)将成为系统瓶颈.使用NAT模式将 ...
- Eclipse集成Git插件及使用
目录(?)[+] 1 Git插件安装 11 下载插件 2 Git提交代码 21 建git的本地仓库 第一种 第二种 项目创建本地仓库后 如图 22 提交本地仓库 23 提交远程仓库 3 Git下载代码 ...
- readb(), readw(), readl(),writeb(), writew(), writel() 宏函数
参见: http://blog.csdn.net/hustyangju/article/details/20448339
- dll签名两种方法
以下两种签名方法,都是对csp.dll签名,都不是CA颁发的,且效果不同, 一:通过自建证书签名 下载windows sdk,成功安装后,包括makecert.exe, cert2spc.exe, p ...
- Android Studio生成apk
1.菜单Build->Generate Signed APK 2.生成android.keystore,能够依据弹框去Create new一个,也可使用命令来生成android.keystore ...
- mysql-增删改数据
一.增加操作 INSERT用来插入或添加行到数据库表的.插入用以下几种方式: 1.插入完整的行 insert into customers values(null,'Pep E,LaPew','100 ...
- uva_127,栈以及vector的应用
参考自http://www.cnblogs.com/maqiang/archive/2012/05/02/2479760.html #include <iostream> #include ...