【Codeforces Round #457 (Div. 2) A】 Jamie and Alarm Snooze
【链接】 我是链接,点我呀:)
【题意】
在这里输入题意
【题解】
暴力往前走x分钟就好。
直到出现7为止。
【代码】
#include <bits/stdc++.h>
using namespace std;
int hh,mm,x,cnt;
bool find7(){
if (hh%10==7 || (hh/10)==7) return true;
if (mm%10==7 || (mm/10)==7) return true;
return false;
}
int main(){
#ifdef LOCAL_DEFINE
freopen("rush_in.txt", "r", stdin);
#endif
ios::sync_with_stdio(0),cin.tie(0);
cin >> x;
cin >> hh >> mm;
while (!find7()){
mm-=x;
cnt++;
if (mm<0){
hh--;
mm+=60;
if (hh<0){
hh = 23;
}
}
}
cout <<cnt<<endl;
return 0;
}
【Codeforces Round #457 (Div. 2) A】 Jamie and Alarm Snooze的更多相关文章
- 【Codeforces Round #457 (Div. 2) C】Jamie and Interesting Graph
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 找比n-1大的最小的素数x 1-2,2-3..(n-2)-(n-1)长度都为1 然后(n-1)-n长度为(x-(n-2)) 然后其他 ...
- 【Codeforces Round #457 (Div. 2) B】Jamie and Binary Sequence
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 把n分解成二进制的形式. n=2^a0+2^a1+...+2^a[q-1] 则固定就是长度为q的序列. 要想扩展为长为k的序列. 可 ...
- 【Codeforces Round #432 (Div. 1) B】Arpa and a list of numbers
[链接]h在这里写链接 [题意] 定义bad list是一个非空的.最大公约数为1的序列.给定一个序列,有两种操作:花费x将一个元素删除.花费y将一个元素加1,问你将这个序列变为good list所需 ...
- 【Codeforces Round #420 (Div. 2) C】Okabe and Boxes
[题目链接]:http://codeforces.com/contest/821/problem/C [题意] 给你2*n个操作; 包括把1..n中的某一个数压入栈顶,以及把栈顶元素弹出; 保证压入和 ...
- 【Codeforces Round #420 (Div. 2) B】Okabe and Banana Trees
[题目链接]:http://codeforces.com/contest/821/problem/B [题意] 当(x,y)这个坐标中,x和y都为整数的时候; 这个坐标上会有x+y根香蕉; 然后给你一 ...
- 【Codeforces Round #420 (Div. 2) A】Okabe and Future Gadget Laboratory
[题目链接]:http://codeforces.com/contest/821/problem/A [题意] 给你一个n*n的数组; 然后问你,是不是每个位置(x,y); 都能找到一个同一行的元素q ...
- 【Codeforces Round #423 (Div. 2) C】String Reconstruction
[Link]:http://codeforces.com/contest/828/problem/C [Description] 让你猜一个字符串原来是什么; 你知道这个字符串的n个子串; 且知道第i ...
- 【Codeforces Round #423 (Div. 2) B】Black Square
[Link]:http://codeforces.com/contest/828/problem/B [Description] 给你一个n*m的格子; 里面包含B和W两种颜色的格子; 让你在这个格子 ...
- 【Codeforces Round #423 (Div. 2) A】Restaurant Tables
[Link]:http://codeforces.com/contest/828/problem/A [Description] 有n个组按照时间顺序来餐馆; 每个组由一个人或两个人组成; 每当有一个 ...
随机推荐
- NodeJS学习笔记 (17)集群-cluster(ok)
cluster模块概览 node实例是单线程作业的.在服务端编程中,通常会创建多个node实例来处理客户端的请求,以此提升系统的吞吐率.对这样多个node实例,我们称之为cluster(集群). 借助 ...
- SQL Server存储ntext截断问题
SQL Server存储ntext截断问题 最近遇到一个问题:将大文本存储到数据库的时候,查询出来的文本却被截断了. 最后百度发现,作者提出 sql server management studi ...
- 洛谷—— P2419 [USACO08JAN]牛大赛Cow Contest
https://www.luogu.org/problem/show?pid=2419 题目背景 [Usaco2008 Jan] 题目描述 N (1 ≤ N ≤ 100) cows, convenie ...
- error C2440: “static_cast”: 无法从“LRESULT (__thiscall CTextProgressCtrl::* )(UINT,LPCTSTR)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)
转自原文 error C2440 “static_cast” 无法从“void (__thiscall C* )(void)... error C2440: “static_cast”: 无法从“LR ...
- Linux异常关机后,Mysql启动出错ERROR 2002 (HY000)
Linux异常关机后,Mysql启动或訪问时,出错: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/ ...
- Cocos2d-x第三方类库不支持arm64的问题解决(64位架构)
32位能够兼容64位操作系统. ipad mini2 64位编译有问题. 各种第三方库不支持64位操作系统. 设置build setting 直接上图:
- android selector设置button点击效果(具体)以及常见问题
button的点击效果学习起来其实比較easy,此点对开发人员来说也是使用的比較频繁的一个知识点,与它相关的还有编辑框的获取焦点时改变背景颜色.选择button选择时改变字体颜色等等.这些其实都是用到 ...
- Java定时器TimeTask
package com.alan.timer; import java.util.Calendar;import java.util.Date;import java.util.Timer;impor ...
- BZOJ 1050 枚举+并查集
思路: 枚举最大边 像Kruskal一样加边 每回更新一下 就搞定了- //By SiriusRen #include <cstdio> #include <cstring> ...
- KDD 2011 最佳工业论文中机器学习的实践方法-翻译
作者:黄永刚 Practical machine learning tricks from the KDD 2011 best industry paper 原文链接:http://blog.davi ...