Codefroces 916A Jamie and Alarm Snooze

Labview时钟snooze闹钟 利用labview所设计的时钟,实现了定时,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.

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

【分析】:自己当时真的是low 题意读错了 怪不得一直A不了 还是英语差呀
题目大意:Jamie要起床 但是要一定在带 ‘’7‘’的时候设定闹钟才可以,因为他认为那样是lucky的。然后给你了个 x,hh,mm。然后问你 经过几干x可以达到他的幸运时间
【代码思路】 :直接向前暴力x 看什么时候有‘7’,在这里要注意分钟不够时小时借,当然也可以是前一天也就是hh=0时,再借就变成了23.

【代码】:

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>

using namespace std;
const int N=5e5+10;
int mm,hh;

int f()
{
    if(hh%10==7||hh/10==7)
        return 1;
    if(mm%10==7||hh/10==7)
        return 1;
    return 0;
}

int main()
{

    ios::sync_with_stdio(false);
    int x;
    while(cin>>x>>hh>>mm)
    {
        int ans=0;
        while(!f())
        {
            mm-=x;
            ans++;
            if(mm<0)
            {
                hh--;
                mm+=60;
            }
            if(hh<0)
                hh=23;
        }
        cout<<ans<<endl;
    }


    return 0;
}
本地AI助手部署指南:DeepSeek Harness与Ollama集成实践 AI Agent作为当前人工智能领域的热门技术,通过模拟人类决策过程,能够自主规划、调用工具并执行复杂任务。其核心原理在于将大语言模型的推理能力与外部工具API相结合,形成可闭环的工作流。这种技术架构的价值在于显著提升了AI系统的实用性和自动化水平,使其从单纯的对话工具转变为能够解决实际问题的智能助手。在应用场景上,AI Agent广泛应用于代码生成、数据分析、自动化办公等领域。本文聚焦于如何通过DeepSeek Harness平台与Ollama本地模型的集成,实现隐私安全、离线可用的AI助手部署方案,特别 阅读详情

相关推荐

ctf——writeup

ctf线上赛——第三关地址:http://106.75.86.18:2222提示:ip spoofing——ip伪造首先访问目标地址,一个正常的网页,挺文艺的。上面有些提示。根据上面的提示,我们浏览网页。找了好久,终于找到你。这个跳转链接。(在这个页面下方)我们接着点击这个链接,就跳转到administrator.php这个页面了。看到这个登录页面,就要知道用户名,密码,可是没有怎么办。一开始也试

Child_by_dream的博客 1320

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

手把手教你用DCT/DCG实现Multi-bit FF物理优化(含SPG流程避坑指南)

本文详细解析了Multi-bit FF(MBFF)在芯片物理实现中的优化方法,重点介绍了DCT/DCG与SPG流程的实战应用。通过物理感知综合、寄存器组识别和增量优化三阶段流程,实现PPA(Power-Performance-Area)的协同提升。文章还提供了Innovus与ICC工具的协同优化策略及典型问题排查指南,帮助工程师高效完成MBFF物理优化。

ik67890123的博客 241

codeforces 916 A Jamie and Alarm Snooze

一道很简单的模拟题。

toby的博客 838

多边形裁剪算法

多边形裁剪算法 刚参加工作就跟多边形刚上了,对于多边形的裁剪做一些简单的总结。 多边形裁剪主要有四种算法 Greiner-Hormann裁剪算法 Sutherland-Hodgman算法 Vatti裁剪算法 Weiler-Atherton裁剪算法 作为一名想要成为优秀算法工程师的程序员,我们不能只会使用,而不知道其原理,倘若如此,我们无法做到应用于本身业务上的定制化的修改。 Greiner–H...

papalqi 6729

基于CANopenNode协议栈在正点原子探索者开发板上进行移植

配置好之后进行采用keil IDE进行代码生成即可,还需要进行CANopenNode的代码集成,并参照demo进行代码移植。发送完成后心跳包以1s的周期重新开始发送。正点原子的开发板引出的是CAN1接口。这里的心跳时间间隔设置为100ms。则将心跳包周期设置为0。

wangfandashe的博客 4694

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

Python调用CANoe(2)(测试模块配置)

本节内容在Python和CANoe的数据交互(1)的基础认知上,继续探索Python如何加载TestSetup,以及运行tse测试文件

蚂蚁小兵 1万+

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

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

lxt_Lucia的博客 828

第六部分:VTK进阶(第182章 体素化与隐式建模)

本文系统介绍了基于点云构建有符号距离场(SDF)的核心原理与VTK实现方法。主要内容包括:1)SDF的基本概念与算法原理,通过体素网格隐式表达几何表面;2)关键参数配置指南,如体素分辨率、边界范围和影响半径的选择;3)点云法向估计、SDF计算与等值面提取的完整工作流程;4)常见问题解决方案与性能优化建议。文中提供了详细的C++代码示例,展示从随机点云生成SDF并重建曲面的完整过程,特别强调了法向估计、参数调优和后处理等关键环节。该方法适用于点云表面重建、几何处理等应用场景。

仰望星空的博客 528

《Python Web项目集锦》-专栏介绍和目录

本专栏专注于Python Web项目,涉及内容包含FastAPI、Django、Flask等,所有项目代码完整且可直接运行。不管是零基础还是有经验的开发,相信都能从本专栏获益。有任何问题欢迎私聊博主,专栏持续更新中...

数据知道的博客 5211

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

Python 爬虫实战:医学临床指南爬取(含 PDF 解析与结构化存储)

在当今数字化时代,医学临床指南作为医生进行科学诊疗的重要参考资料,包含大量经过临床验证的诊疗路径和建议。这些指南通常发布在权威医学网站上,数量庞大且更新频繁。如何自动化地抓取并存储这些指南,成为医疗数据分析、医学研究以及医疗 AI 模型训练等工作的关键第一步。本文将系统讲解如何利用 Python 爬虫技术从权威医学网站爬取临床指南内容,并实现 PDF 解析与结构化存储。

u014481728的博客 449

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

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

VB摄像头监控

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

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

QQ:690217293 283

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

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

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

浪在ACM集训队清明训练部分题集

浪在ACM集训队清明训练部分题集DAY.1Dangerous Dive题面题解Triangles题面题解DAY.2Jamie and Alarm Snooze题面InputOutputExamplesNote题解Alice's Print Service题面InputOutput题解DAY.3Robot Motion题面InputOutput解析Beautiful Paintings题面Input...

rp++ 799

CodeForces 916A(模拟)

题目链接:点击打开链接题目大意:有个人要在某一时刻起床,但希望在某一个含7的时候被闹钟吵醒,然后在恰好经过几个x分钟的小睡后到达该时刻。  题目大意:之前这道题我写过..美滋滋..直接从时刻开始往前倒退x分钟,直到时刻中出现7就好了 以下是代码:#include&lt;iostream&gt; #include&lt;cstdio&gt; using namespace std; int jian...

smilestruggler_Fly To Higher 313

(转)Resin常见问题及解决方法

1. 症状 1.1. Resin停止响应 ●可能是一个线程死锁的问题,应该进行线程转储。 ●启用完全调试日志模式,检查日志最后的纪录看看发生了什么。 1.2. Resin不停重启动 ●启用完全调试日志模式,检查记录看看Resin为什么不停的重启它。 1.3. java.lang.OutOfMemoryError错误,应用程序内存溢出 ●使用JVM启动参数增加堆(hea...

cedric 2048

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

AlarmClock slow alarm Alarm

由于我使用resin调试控制台打出以下红色类似这样的日志 [15-02-13 09:48:57.864] {CoordinatorThread[]-3} AlarmClock slow alarm Alarm[alarm[WebAppExpandDeployGenerator[null]]] 27901ms coordinator-delta 31071ms [15-02-13 09:48:57

Intlgj的专栏 5086

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

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

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

Codeforces 939A Love Triangle(三角恋问题)

题目:As you could know there are no male planes nor female planes. However, each plane on Earth likes some other plane. There are n planes on Earth, numbered from 1 to n, and the plane with number i like

Puppet__的博客 1315

Codeforces 932A Palindromic Supersequence (超级水)

题目:You are given a string A. Find a string B, where B is a palindrome and A is a subsequence of B.A subsequence of a string is a string that can be derived from it by deleting some (not necessarily con

Puppet__的博客 993
上一篇: 树状数组 区间更新(利用了伪线段树) + poj3468题解
下一篇: 山东省第五届省赛 A题 angry_birds_again_and_again(简单数学 积分问题)
Puppet__
博客等级 码龄10年 319粉丝 328原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值