codeforces 916 A Jamie and Alarm Snooze

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

Description


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.
Examples

InputOutput
3
11 23
2
InputOutput
5
01 07
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.


题意:Jamie要在某一时刻起床,但希望在某一个含7的幸运时刻被闹钟吵醒,然后在恰好经过若干个x分钟的小睡后到达该时刻。
只需要模拟一个表从起床时刻开始,每次把时间向前调x分钟,最先遇到的含7的时刻就是答案。

#include <stdio.h>

class clock {
public:
    int x;
    int hh;
    int mm;
    bool luck() {
        if (hh % 10 == 7||mm%10==7)return true;//含7的只可能是个位
        else return false;
    }
    void dec() {//模拟时钟
        mm = mm - x;
        if (mm < 0) {
            mm += 60;
            hh--;
        }
        if (hh < 0)hh += 24;//前一天
    }
};

int main() {
    clock time;
    scanf("%d", &time.x);
    scanf("%d %d", &time.hh, &time.mm);
    int t;
    for (t = 0; !time.luck(); ++t)  time.dec();
    printf("%d", t);
}
ADS版图优化中的参数化设计技巧 本文详细介绍了在ADS中进行射频电路版图参数化设计的核心技巧。通过将版图关键尺寸定义为变量,并与电磁仿真及优化器联动,实现从手动修改到自动迭代的转变,极大提升了PA、LNA等电路的设计与优化效率。文章以阶梯阻抗变换器为例,阐述了变量创建、绑定及协同仿真的完整流程,并提供了避免网格冲突、变量混乱等常见问题的实用指南。 阅读详情

相关推荐

自动驾驶仿真工具链集成:ECU TEST与VTD、VERISTAND的深度配置指南

本文详细介绍了自动驾驶仿真测试中ECU TEST、VTD与VERISTAND三大核心工具的深度集成与连接配置方法。通过解析工具链的角色分工,提供从单机到分布式部署的实战指南,并重点阐述了Test Bench Configuration与Test Configuration的关键参数设置、SSH免密登录配置,以及在线与离线工作模式的切换技巧,旨在帮助测试工程师高效构建稳定、自动化的硬件在环测试环境。

wind6的博客 789

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

无知的我 728

实测有效!易灵思FPGA工程如何正确配置Efinity+Modelsim仿真环境

本文详细介绍了易灵思FPGA工程中如何高效配置Efinity与Modelsim联合仿真环境,包括软件版本匹配、系统环境变量设置、工程文件结构优化及仿真脚本深度优化等实战经验。通过实测数据验证,该方案可显著提升仿真效率,适用于不同规模的设计验证,帮助工程师快速搭建稳定高效的联仿环境。

m2n3b4v5c6的博客 405

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

android10 部分机型(华为)无法正常更新安装app

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=file://storage/emulated/0/文件夹名/***.apk typ=application/vnd.android.package-archive }

森森先生的博客 3927

从零搭建:C#+YOLOv8质检系统(从相机选型到上位机部署,附完整开发流程与源码)

后来换成45°斜射的条形光源,光线从侧面打在引脚上,弯曲处会形成暗区,缺陷边缘立刻清晰——光源预算别省,我这套光源+支架才600块,比换相机划算多了。前阵子帮一家电子厂做连接器引脚缺陷检测,他们原来靠2个师傅用放大镜看,每天8小时最多检5000个,0.2mm的针脚弯曲还经常漏检,不良品流到客户那里,单月罚款就超5万。做质检第一步不是挑设备,是先明确“要检测多大的缺陷”——比如我要检的连接器引脚,直径0.5mm,允许的最大弯曲是0.2mm,这直接决定相机分辨率。,后面C#就用这个模型推理。

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 1267

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

钉钉多维表格开发

从0到1完成钉钉多维表格开发SDK对接与实践案例。

沉修所长,勇逐新机;安而不怠,静而思变 3610

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

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

lxt_Lucia的博客 828

代码复现5——VLMaps

报错“AttributeError: module 'clip' has no attribute 'load'”,运行下述命令解决。运行后接着报错:“ModuleNotFoundError: No module named 'pytorch_lightning'”运行后命令后会弹出一个RGB窗口,可以用键盘上的“W”“A”“D”键控制移动视角的变化,“空格”键开始记录,“q”键停止。并更改相关代码文件,vlmaps/vlmaps/lseg/modules/models/lseg_vit.py。

qq_44100524的博客 603

AI应用架构师实战:半导体器件仿真AI智能体系统搭建

半导体器件仿真(如MOSFET、FinFET等)是芯片设计的核心环节,传统流程依赖专家手动调参、多物理场仿真引擎(如TCAD)耗时(小时级至天级)、经验难以沉淀,导致研发周期长、成本高。如何构建一个AI智能体系统,实现仿真任务的自动化调度、参数智能优化、结果分析与知识沉淀,成为提升半导体研发效率的关键挑战。

移动开发前沿的博客 1222

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

030、自动白平衡AWB实战:灰度世界、完美反射与色温估计的工程实现与局限

本文深入探讨了自动白平衡(AWB)算法在工程实践中的实现与局限性。作者结合实际项目经验,分析了灰度世界算法、完美反射算法和色温估计三种主流方法的优缺点和适用场景,并分享了调试过程中的关键技巧和常见陷阱。文章指出,纯色背景、多光源环境等特殊场景容易导致算法失效,需要通过混合策略和场景检测来优化。作者强调AWB调试需要大量实际场景测试,建议保留手动调节功能,并针对不同硬件配置进行参数标定。最后提出,AWB优化是一个持续迭代的过程,需要工程化的测试方法和数据处理能力。

zzfmlxs的博客 281

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

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

VB摄像头监控

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

Codeforces 916-A

A. Jamie and Alarm Snooze time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Jamie loves sleeping. One day, he decides that he needs to wake

辞树 463

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

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

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

codeforces 916E Jamie and Tree 题解

题意简述 给定一个 n≤105n\le 10^5n≤105 个点带权的树,初始根为 111。支持三种操作: 1 r 把根换成 rrr 2 u v x 把 LCA(u,v)LCA(u,v)LCA(u,v) 的子树整体加 xxx 3 u 查询 uuu 的子树点权和 操作数≤105\le 10^5≤105。每个点权 ≤108\le 10^8≤108 。 思路 如果没有 111 操作,那 2,32,32,...

LightningUZ的博客 312

Codeforces 907A Masha and Bears

A family consisting of father bear, mother bear and son bear owns three cars. Father bear can climb into the largest car and he likes it. Also, mother bear can climb into the middle car and she likes i

toby的博客 688

Codeforces Round #374 (Div. 2) D 贪心+优先队列

链接:戳这里 D. Maxim and Array time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Recently Maxim has found an array of n integers, neede

Cross 633

[CF916E]Jamie and Tree——树链剖分+线段树

题目大意: 有一棵n个点的树,每个节点上有一个权值wi,最开始根为1号点.现在有3种 类型的操作: • 1 root, 表示将根设为root. • 2 u v x, 设u, v的最近公共祖先为p, 将p的子树中的所有点的权值加上x. • 3 u, 查询u的子树中的所有点的权值和. 对于每个3操作,输出答案. 思路: 如果真的换根的话肯定是不行的。。。所以我们要想办法在原树上面搞出不...

ylsoi的博客 795

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

Jamie and Tree( Codeforces 916E)

题意: 给出一个有n个点以及n-1条边的树,进行3个操作: 1. 将x变成整个树的根 2. 将以x,y相对于根的最近公共祖先的为根的那棵子树的所有根节点加上z. 3. 查询以x为根的子树的所有节点的和 算法: LCA,DFS序,线段树区间维护 解题思路: 首先考虑不对根进行修改,通过对根与询问节点的相对位置关系分析,通过求LCA实现各个操作。由于每一次操作修改的点不确定,

sdut16szq的博客 587

第0周周赛——极限手速赛(题解)之上篇

A题: A题题目链接 题目描述: 这道题是一血 TimeLimit:500MS  MemoryLimit:64MB 64-bit integer IO format:%I64d admin Problem Description 编辑 什么?这道题竟然没有题目描述? Input 编辑 输入只有一行,包含一个整数

多反思,多回顾,要坚持。 1718

Jamie and Alarm 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 set

codeswarrior的博客 464

C - C 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 less painful by setting the alarm at a lucky time. He ...

做一只熊猫不好吗? 279
上一篇: codeforces 915 C Permute Digits
下一篇: codeforces 914 D Bash and a Tough Math Puzzle
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值