Jamie and Alarm Snooze

Labview时钟snooze闹钟 利用labview所设计的时钟,实现了定时,snooze,闹钟,显示等功能 立即下载

Jamie and Alarm Snooze


Jamie loves sleeping. One day, he decides that he needs to wake up at exactly hh: mm. However, he hates waking up, so he wants to make waking up less painful by setting the alarm at a lucky time. He will then press the snooze button every x minutes until hh: mm is reached, and only then he will wake up. He wants to know what is the smallest number of times he needs to press the snooze button.

A time is considered lucky if it contains a digit '7'. For example, 13: 07 and 17: 27 are lucky, while 00: 48 and 21: 34 are not lucky.

Note that it is not necessary that the time set for the alarm and the wake-up time are on the same day. It is guaranteed that there is a lucky time Jamie can set so that he can wake at hh: mm.

Formally, find the smallest possible non-negative integer y such that the time representation of the time x·y minutes before hh: mm contains the digit '7'.

Jamie uses 24-hours clock, so after 23: 59 comes 00: 00.

Input

The first line contains a single integer x (1 ≤ x ≤ 60).

The second line contains two two-digit integers, hh and mm (00 ≤ hh ≤ 23, 00 ≤ mm ≤ 59).

Output

Print the minimum number of times he needs to press the button.

Example
Input
3
11 23
Output
2
Input
5
01 07
Output
0
Note

In the first sample, Jamie needs to wake up at 11:23. So, he can set his alarm at 11:17. He would press the snooze button when the alarm rings at 11:17 and at 11:20.

In the second sample, Jamie can set his alarm at exactly at 01:07 which is lucky.


唯一需要注意的是如果小时变成零,再借为要变成23,用循环查找即可

code:

#include <iostream>
#include <cstdio>
using namespace std;
int judge(int hh,int mm){
    if(hh%10==7||hh/10==7||mm%10==7||mm/10==7)
        return 1;
    else
        return 0;
}
int main(){
    int x,y=0;
    int hh,mm;
    scanf("%d",&x);
    scanf("%d%d",&hh,&mm);
    while(1){
        if(judge(hh,mm)){
            printf("%d\n",y);
            break;
        }
        y++;
        mm -= x;
        if(mm<0){
            hh--;
            mm += 60;
        }
        if(hh<0){
            hh = 23;
        }
    }
    return 0;
}


激光SLAM总结——Fast LIO / Fast LIO2 / Faster LIO 激光SLAM总结——Fast LIO / Fast LIO2 / Faster LIO 在之前的工作中有接触过LOAM,最近在工作中又接触到Faster LIO相关的工作,于是想着对Fast LIO / Fast LIO2 / Faster LIO这一系列工作进行一个简单的总结,以加深自己对激光SLAM算法的理解,之前总结过的一些和激光SLAM算法相关的博客还有,感兴趣的同学可以一起学习讨论: 激光SLAM总结——VLOAM / LIMO算法解析 激光SLAM总结——LIO-Mapping / LIOM / 阅读详情

相关推荐

NoUnityCN:绕过地域限制,从Unity官方CDN直链下载全版本编辑器

在软件开发和游戏制作领域,内容分发网络(CDN)是保障全球用户高速、稳定获取大型文件的核心基础设施。其原理是通过将资源缓存至遍布各地的边缘节点,使用户能从地理距离最近的服务器获取数据,从而显著提升下载速度并降低源站压力。这一技术对于需要频繁下载大型开发工具(如游戏引擎)的团队而言,价值在于能确保开发环境部署的一致性与效率,是构建自动化CI/CD流水线和团队协作的基础。然而,当开发者因网络策略或地域限制无法直接访问官方CDN时,获取安装文件便成为阻碍工作流的痛点。NoUnityCN项目正是针对此场景的工程实践

weixin_33473110的博客 309

Jamie and Alarm Snooze(起床时间,延迟闹铃)

欢迎访问https://blog.youkuaiyun.com/lxt_Lucia~~宇宙第一小仙女\(^o^)/~~萌量爆表求带飞=≡Σ((( つ^o^)つ~dalao们点个关注呗~~emmm都喊我铁头,哼!!!而我的床呢偏偏就是磁铁打的........but每天还是要起床.....比如更博,therefore....没事多来瞅瞅给我增点访客量咯~这个叫Jamie的小盆友还真是像我一样爱睡觉,这个闹铃延迟提...

lxt_Lucia的博客 828

CANoe: Panel的上位机控制方法

本文介绍了不同于IG的报文控制方法,实现了Panel面板的控制模式。

Jonsnow3zz的博客 1405

Jamie and Alarm Snooze(暴力+思维)

Jamie loves sleeping. One day, he decides that he needs to wake up at exactly hh: mm. However, he hates waking up, so he wants to make waking up less painful by setting the alarm at a lucky time. He w...

码农的一亩三分地 378

基于STM32与OV7670的嵌入式视频监控系统设计与实现

本文详细介绍了基于STM32单片机与OV7670摄像头的嵌入式视频监控系统设计与实现。从硬件选型、电路设计到软件开发,涵盖了摄像头驱动、TFT显示优化及图像处理等关键技术,提供了实用的调试技巧和性能优化方案,为低成本、高效率的视频监控系统开发提供完整解决方案。

desk3的博客 801

别再手动切换了!用SP3485+三极管搞定RS485自动收发电路(附完整原理图)

本文详细介绍了如何利用SP3485芯片和三极管设计RS485自动收发电路,解决传统手动切换带来的IO资源占用和软件复杂度问题。通过原理分析、电路设计拆解和实战注意事项,帮助工程师打造稳定可靠的自动收发通信模块,显著提升系统性能和可靠性。

weixin_26833939的博客 509

Codefroces 916A Jamie and Alarm Snooze

Jamie loves sleeping. One day, he decides that he needs to wake up at exactly hh: mm. However, he hates waking up, so he wants to make waking up less painful by setting the alarm at a lucky time. He wi

Puppet__的博客 662

【Apollo学习笔记】——规划模块TASK之SPEED_HEURISTIC_OPTIMIZER

在Apollo星火计划学习笔记——Apollo路径规划算法原理与实践与【Apollo学习笔记】——Planning模块讲到……Stage::Process的函数会依次调用task_list中的TASK,本文将会继续以LaneFollow为例依次介绍其中的TASK部分究竟做了哪些工作。由于个人能力所限,文章可能有纰漏的地方,还请批评斧正。在配置文件中,我们可以看到LaneFollow所需要执行的所有task。本文将继续介绍LaneFollow的第10个TASK——动态规划规划目标加速度尽可能小。

sinat_52032317的博客 3425

codeforces 916 A Jamie and Alarm Snooze

一道很简单的模拟题。

toby的博客 838

手动安装SeuratData包中pbmc3k数据集的详细步骤与避坑指南

本文提供了手动安装SeuratData包中pbmc3k数据集的详细步骤与避坑指南。针对国内用户网络不稳定导致自动下载失败的问题,文章核心介绍了如何从错误信息中获取下载链接,使用浏览器或下载工具完成手动下载,并通过指定本地文件路径和参数在R中成功安装。该方法同样适用于SeuratData包中的其他数据集,是单细胞分析入门的必备生存技能。

weixin_29054399的博客 183

保姆级避坑指南:Mid-360雷达到手后,用livox_ros_driver2从接线到出点云的完整流程

本文提供Mid-360雷达到手后的完整使用指南,涵盖从硬件接线、网络配置到livox_ros_driver2驱动的安装与调试,帮助用户避开常见陷阱,实现点云数据的稳定输出与可视化。重点解析了配置文件的参数设置和点云格式选择,确保用户能够高效部署和使用Mid-360雷达。

weixin_30733003的博客 483

A. Jamie and Alarm Snooze

time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputJamie loves sleeping. One day, he decides that he needs to wake up at exactly hh: mm. However, he ...

无知的我 727

Transformer模型在时间序列预测中的应用:价格和产量预测

Transformer模型由Attention is All You Need论文提出,并在机器翻译任务上取得了巨大成功。其主要特点是使用自注意力机制代替传统的递归或卷积操作进行序列建模。Transformer模型由编码器和解码器组成,其中编码器用于学习输入序列的表示,解码器用于生成目标序列。在时间序列预测中,我们只需要使用Transformer的编码器部分。编码器将历史数据作为输入,学习一个表示,然后使用该表示来预测未来的数值。

HnrzLinux的博客 736

[简单思维题] Jamie and Alarm Snooze

题目描述 Jamie loves sleeping. One day, he decides that he needs to wake up at exactly hh:mm. However, he hates waking up, so he wants to make waking up less painful by setting the alarm at a lucky ...

dingfei496705的博客 191

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

Codeforces 916A Jamie and Alarm Snooze

A. Jamie and Alarm SnoozeJamie loves sleeping. One day, he decides that he needs to wake up at exactly hh: mm. However, he hates waking up, so he wants to make waking up less painful by setting the al...

s540239976的博客 340

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

916A - Jamie and Alarm Snooze

A. Jamie and Alarm Snooze time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Jamie loves sleeping. One day, he

memory_qianxiao的博客 548

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

VJ2-Jamie and Alarm Snooze

A. Jamie and Alarm Snoozetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputJamie loves sleeping. One day, he decides that he needs to wake up at exa...

Scarlett 242

CodeForces-916A-jamie and Alarm Snooze(笨比题目)

链接: https://vjudge.net/problem/CodeForces-916A 题意: Jamie loves sleeping. One day, he decides that he needs to wake up at exactly hh: mm. However, he hates waking up, so he wants to make waking up...

weixin_30693683的博客 147

【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 t...

102

Codeforces Round #457 (Div. 2) A. Jamie and Alarm Snooze简单模拟

A. Jamie and Alarm Snooze time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Jamie loves sleeping. One day, he

Frost_Bite的博客 520

ACM训练

Jamie and Alarm Snooze Jamie loves sleeping. One day, he decides that he needs to wake up at exactly hh: mm. However, he hates waking up, so he wants to make waking up less painful by setting the alar...

Smi_l_e_的博客 435

CodeForces - 731B(贪心)

题目链接:点击打开链接题目大意:有N天需要买披萨,两种方式,一种是一天一次买两个披萨,另一种是今天买一个明天买一个披萨,问是否能把披萨正好全买了。 解题思路:直接模拟,如果当天所需披萨数是偶数,直接就全买过来,如果是奇数,就只好要明天买一个了。(P.S. 如果明天只有0个,今天是奇数,那就凉了..(明天的披萨数会小于0)需要特判一下别被坑) 以下是代码:#include&lt;iostream&g...

smilestruggler_Fly To Higher 308
上一篇: Perfect Squares (水题)
下一篇: New Year and Counting Cards
Guuuuuu老师儿
博客等级 码龄9年 259粉丝 718原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值