当前位置:网站首页>Luogu p5707 [deep foundation 2. example 12] late for school
Luogu p5707 [deep foundation 2. example 12] late for school
2022-06-25 14:50:00 【䨁 逦】
Title Description
yyy Our school requires that in the morning 8 We'll be there by two o'clock . School to yyy There are... In my family s(s\le 10000)s(s≤10000) rice , and yyy We can use v(v<10000)v(v<10000) Walk to school at a constant speed of meters per minute . Besides, it has to spend extra money on the way to school 10 Minutes for garbage sorting . Excuse me, in order to avoid being late yyy When is the latest time to go out ? Output HH:MM Time format of , Fill in zero if there are less than two digits . Because it's a long way , yyy You may have to start a day earlier , But it can't be more than a day in advance .
Input format
Two positive integers s,v, The meaning has been given in the title .
Output format
hh:mm The latest time to leave home ( when : branch , Two digits must be output , Fill in the front of less than two 0)
I/o sample
Input #1 Copy
100 99
Output #1 Copy
07:48
C Language version ,
There are several test points that can not pass when writing the questions , Then I looked carefully and found that C The problem and complement of wide language domain 0 The problem of
use printf() Function must be complemented by lines 0 The operation can be written as follows printf("%02d",n); The non-zero digit part can be changed .
Here is AC Code
#include<stdio.h>
#include<math.h>
int main()
{
int n=0,v=0,t=0,s=0;
scanf("%d %d",&s,&v);
if(s%v==0) { t=s/v+10;}
else t=s/v+11;
if(t<=8*60)
{
int h=0,m=0;
t=8*60-t;
h=t/60;
m=t%60;
printf("%02d:%02d",h,m);
}
else
{
int h=0,m=0;
t=32*60-t;
h=t/60;
m=t%60;
printf("%02d:%02d",h,m);
}
return 0;
}
边栏推荐
- Clinical Chemistry | 张建中/徐健开发幽门螺杆菌单细胞精准诊疗技术
- Gif动图如何裁剪?收下这个图片在线裁剪工具
- 分享自己平时使用的socket多客户端通信的代码技术点和软件使用
- [untitled]
- 【Try to Hack】vulhub靶场搭建
- Thymeleaf Usage Summary
- C language LNK2019 unresolved external symbols_ Main error
- Basic usage of markdown (plain text and grammar)
- 15 -- 最接近原点的 K 个点
- To make pytorch faster, you need to master these 17 methods
猜你喜欢

Jaspersoft studio installation

【Try to Hack】vulnhub DC1

How to combine multiple motion graphs into a GIF? Generate GIF animation pictures in three steps

Sequential programming 1

Heavyweight! The domestic IDE is released and developed by Alibaba. It is completely open source! (high performance + high customization)

Thymeleaf Usage Summary
![[try to hack] vulhub shooting range construction](/img/fc/6057b6dec9b51894140453e5422176.png)
[try to hack] vulhub shooting range construction

关于win10 版本kicad 卡死的问题, 版本6.x

Page 112 machine learning - review of fundamentals of mathematics pptx

Kubernetes 理解kubectl/调试
随机推荐
To make pytorch faster, you need to master these 17 methods
【Try to Hack】vulnhub DC1
[deep learning] multi label learning
分饼干问题
Jaspersoft studio adding MySQL database configuration
Sequential programming 1
【深度学习】多标签学习
It's not easy to understand the data consistency of the microservice architecture for the first time after six years as a programmer
成员变量与局部变量的区别
ffmpeg protocol concat 进行ts流合并视频的时间戳计算及其音画同步方式一点浅析
Customization and encapsulation of go language zap library logger
Modal and modeless dialogs for QT
现在股票开户用什么app最安全?知道的给说一下吧
Encapsulating functions and event handling
重磅!国产 IDE 发布,由阿里研发,完全开源!(高性能+高定制性)
Native JS obtains form data and highlights and beautifies JSON output display
Is it safe to open an online stock account? Who knows
NBD Network Block Device
Explanation of dev/mapper
Deconstruction assignment of variables