A - Jamie and Alarm Snooze
題意:
Jamie要在某一時刻起床,但希望在某一個含7的幸運時刻被鬧鐘吵醒,然後在恰好經過若干個x分鐘的小睡後到達該時刻。注意是before.
注意讀題。
題解:
模擬一下即可。
程式碼:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <cstdlib>
using namespace std;
int main()
{
int x;
int hh,mm;
cin>>x;
cin>>hh>>mm;
int tmpm=mm;
int tmph=hh;
int cnt=0;
for(;;)
{
if(tmpm%10==7||tmph%10==7) break;
tmpm-=x;cnt++;
if(tmpm<0)
{
tmpm+=60;
tmph--;
if(tmph<00) tmph+=24;
}
}
cout <<cnt<<endl;
return 0;
}
相關推薦
A - Jamie and Alarm Snooze
題意: Jamie要在某一時刻起床,但希望在某一個含7的幸運時刻被鬧鐘吵醒,然後在恰好經過若干個x分鐘的小睡後到達該時刻。注意是before. 注意讀題。 題解: 模擬一下即可。 程式碼: #include <iostream> #include
【Codeforces Round #457 (Div. 2) A】 Jamie and Alarm Snooze
als lar clu efi out .com bit source fin 【鏈接】 我是鏈接,點我呀:) 【題意】 在這裏輸入題意 【題解】 暴力往前走x分鐘就好。 直到出現7為止。 【代碼】 #include <bits/stdc++.h&
Jamie and Alarm Snooze
minutes sam namespace use lin count first wan sid Description Jamie loves sleeping. One day, he decides that he needs to wake up at
A - Mike and palindrome
nbsp == 字符串長度 cda problem eal iostream quotes aaa A - Mike and palindrome Mike has a string s consisting of only lowercase English le
Codeforces Round #417 (Div. 2) A. Sagheer and Crossroads 模擬 枚舉
ces color 一次 name exit main cst space amp Codeforces Round #417 (Div. 2) A. Sagheer and Crossroads 模擬 枚舉 題意 一個紅綠燈 按逆時針方向一次給出各個路口的左轉,
CodeForces 321 A - Ciel and Robot
names switch robot bit -a msu clu include == 【題目鏈接】:click here~~ 【題目大意】:一個robot 機器人 。能夠依據給定的指令行動,給你四種指令,robot初始位置是(0,0)。指令一出。robot會反
【貪心】 Codeforces Round #419 (Div. 1) A. Karen and Game
blog true 刪除 round 貪心 cnblogs pac names namespace 容易發現,刪除的順序不影響答案。 所以可以隨便刪。 如果行數大於列數,就先刪列;否則先刪行。 #include<cstdio> #include<algo
#419(div2) A. Karen and Morning
return main name spa ring 思路 clas 判斷 bit 題意:給出某個時刻,問多少秒後時刻變成回文的了 思路:A題就直接暴力咯,一秒一秒加,判斷,註意:24點為0點 1 #include<bits/stdc++.h> 2 usin
CF821 A. Okabe and Future Gadget Laboratory 水
push nbsp int 個數 return bar .com tin link Link 題意:詢問n X n中非1數是否能夠由同行同列中分別取兩個數做和得到。 思路:水題。 /** @Date : 2017-07-03 16:23:18 * @
Codeforces A - Bear and Prime 100(交互題)
mes 思路 logs cin out else 一個 如果能 pos A - Bear and Prime 100 思路:任何一個合數都可以寫成2個以上質數的乘積。在2-100中,除了4,9,25,49外都可以寫成兩個以上不同質數的乘積。 所以打一個質數加這四個數的表:{
Two Wrongs Can Make a Right (and Are Difficult to Fix)
write work visible fun mar pop sig per cati Two Wrongs Can Make a Right (and Are Difficult to Fix) Allan Kelly CODE NEVER LIE
poj 1912 A highway and the seven dwarfs
n) visit += clock build lan opera script following A highway and the seven dwarfs Time Limit: 8000MS Memory Limit: 30000K Total S
PAT1065: A+B and C (64bit)
from whether ble 思路 限制 eth test mco ont 1065. A+B and C (64bit) (20) 時間限制 100 ms 內存限制 65536 kB 代碼長度限制 16000 B 判題程序 Standard 作者 H
CF 815 A. Karen and Game(暴力,模擬)
技術分享 multipl ext single tput names example 輸出 初始 題目鏈接:http://codeforces.com/problemset/problem/815/A 題目: On the way to school, Karen
論文:ORB-SLAM:a Versatile and accurate Monocular SLAM System
軌跡 關鍵幀 lam lns auto 排除 校正 超出 mathjax 前言 一、介紹 PTAM(parallel tracking and Mapping)系統局限於小尺度場景中,提供簡單但是有效的關鍵幀選擇、特征匹配、三角化、重定位技術,但是具有以下缺點:(1)缺
【Codeforces Round #457 (Div. 2) C】Jamie and Interesting Graph
include pac bits namespace mark span .com ifd graph 【鏈接】 我是鏈接,點我呀:) 【題意】 在這裏輸入題意 【題解】 找比n-1大的最小的素數x 1-2,2-3..(n-2)-(n-1)長度都為1 然後(
CF916C Jamie and Interesting Graph
class col strong tin pre 實現 rest main graph 思路:構造 實現: 1 #include <bits/stdc++.h> 2 using namespace std; 3 int main() 4 { 5
Codeforces Round #396(Div. 2) A. Mahmoud and Longest Uncommon Subsequence
color HA \n seq 字符 turn ces DC %s 【題意概述】 找兩個字符串的最長不公共子串。 【題目分析】 兩個字符串的最長不公共子串就應該是其中一個字符串本身,那麽判斷兩個字符串是否相等,如果相等,那麽肯定沒有公共子串,輸出“-1”.否則就
Codeforces Round #417 (Div. 2)-A. Sagheer and Crossroad
sca \n ret name nbsp style can turn ros 【題意概述】 在一個十字路口 ,給定紅綠燈的情況, 按逆時針方向一次給出各個路口的左轉,直行,右轉,以及行人車道,判斷汽車是否有可能撞到行人 【題目分析】 需要在邏輯上清晰
A - Kefa and First Steps
maximum XA res some dex CA sequence ger pac Problem description Kefa decided to make some money doing business on the Internet for exactl