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;
}


机器视觉避坑指南:为什么你的Halcon划痕检测总漏检?(附优化方案) 本文深入剖析了Halcon在表面划痕检测中漏检率高的常见原因,如灰度值波动、噪声干扰及形态学参数设置不当。针对复杂背景与低对比度划痕,提出了超越官方例程的多尺度纹理分析与特征融合优化方案,旨在帮助开发者构建更鲁棒、稳定的机器视觉检测流程,有效提升检出率。 阅读详情

相关推荐

TBOX(Telematics Box)在智能网联汽车中的核心功能与应用场景解析

TBOX(Telematics Box)是智能网联汽车的“中枢神经”,基于Android或Linux操作系统,并通过CAN总线与车辆深度交互。它实现了远程控制、车辆状态监控、OTA升级及紧急呼叫(E-CALL)等核心功能,是提升用车安全、便利性与实现车辆持续进化的关键技术组件。

weixin_29158413的博客 800

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

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

lxt_Lucia的博客 828

别再只调电压了!深入理解数控电源的CC/CV模式与双闭环PID控制(以BUCK电路为例)

本文深入解析数控电源的CC/CV模式与双闭环PID控制技术,以BUCK电路为例,探讨如何通过双闭环控制优化负载突变响应和模式切换稳定性。文章详细介绍了电压环与电流环的协同工作原理、PID参数整定技巧及工程实践中的非线性补偿方法,帮助工程师提升电源设计的智能控制能力。

weixin_27017211的博客 261

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

USB-Blaster在Win11报错?3分钟搞定驱动兼容性问题(Quartus 21.4实测)

本文针对Windows 11系统下USB-Blaster驱动安装问题,提供了一套快速解决方案。通过优化驱动安装流程、绕过签名验证及设备管理器高级技巧,帮助开发者在3分钟内解决Quartus 21.4的兼容性问题,提升FPGA调试效率。

weixin_30772105的博客 288

PLc S7-200 smart如何使用Modbus 485通讯传输接收数据

西门子在 STEP 7-Micro/WIN SMART 中正式推出 Modbus RTU 主站协议库(西门子标准库指令)。使用 Modbus RTU 主站指令库,可以读写 Modbus RTU 从站的数字量、模拟量 I/O 以及保持寄存器,从而实现PLC通过modbus方式控制其他器件。提示:以下是本篇文章正文内容,下面案例可供参考。

xjbsw0的博客 6万+

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

DeepSeek Harness实战:从零构建插件化AI Agent

AI Agent开发正从硬编码走向框架化组织,插件化架构成为提升工程效率的关键。在构建可复用、可扩展的智能体系统时,开发团队需要一套能够统一管理模型调用、工具注册与上下文组装的基础设施。DeepSeek Harness作为面向Agent工程的插件化框架,通过Harness、DeepAgent与Skill三个核心抽象,将模型、工具与技能解耦为可插拔单元,让开发者无需重复造轮子即可快速搭建具备工具调用能力的智能体。本文从环境配置到Skill插件开发,完整演示如何基于DeepSeek模型构建一个可运行的Agent

weixin_34279184的博客 441

codeforces 916 A Jamie and Alarm Snooze

一道很简单的模拟题。

toby的博客 838

回声消除AEC初探

那段保留即可——在播放期间把麦克风关闭(软件层面的 mute),同样能根除回声,只是会失去“一句话期间仍能捕获背景噪声”的能力。如果还有更细节的需求(比如多语言 TTS、实时流式 ASR),欢迎继续交流。的完整示例,可直接拷贝、改造、集成到你现有的 LLM‑TTS 对话系统中。实际效果取决于用户设备的硬件与驱动,若仍有回声,可让用户佩戴。把扬声器信号(把播放音频拷贝给 AEC)从麦克风流中减去。:TTS 播放的声音被同一个麦克风再次捕获,导致声学回声。三种实现示例,帮助你快速落地。,几乎可以消除所有回声。

NLP与推荐算法 569

sap中途启用物料账

spro->控制->产品成本控制->实际成本核算/物料分类帐->实际成本核算->激活实际成本的在产品。spro->控制->产品成本控制->实际成本核算/物料分类帐->实际成本核算->激活实际成本组件划分。spro->控制->产品成本控制->实际成本核算/物料分类帐->实际成本核算->激活实际成本核算。spro->控制->产品成本控制->实际成本核算/物料分类帐->激活评估范围的物料分类账。2.对于之前存在物料移动,但是期初没有库存的物料,物料分类账里追踪不到相关物料信息。1.需要激活物料分类账。

Yeol827的博客 991

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

【项目实战】使用Python - Mediapipe、OpenCV进行手部面部检测(Python源码)

本文介绍了使用MediaPipe和OpenCV库进行实时面部和手部关键点检测的方法。通过MediaPipe的Holistic模型,可以获取468个面部特征点及每只手21个特征点。文章详细说明了环境配置、模型初始化参数设置,并提供了完整的代码实现,包括视频流处理、关键点绘制和FPS计算等功能。这套方案可应用于手语识别、疲劳检测等计算机视觉场景,为开发者提供了一套高效的开箱即用解决方案。

梦想起飞的地方 480

[简单思维题] 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

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

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语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

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

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

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、付费专栏及课程。

余额充值