URAL - 1740 - Deer is Better!

2023-11-03 12:58
文章标签 better ural 1740 deer

本文主要是介绍URAL - 1740 - Deer is Better!,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

题意:一只驴每h小时走k千米,现要走l千米,问这只驴最少用时与最长用时(1 ≤ k ≤ l ≤ 1000; 1 ≤ h ≤ 1000)。

题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1740

——>>每h小时走k千米,可极限为第0.00000...001秒走了k千米或者最后0.00000...001秒走了k千米,这样就是多一个h与少一个h的问题了~

#include <cstdio>
#include <cmath>using namespace std;int main()
{double l, k, h;while(scanf("%lf%lf%lf", &l, &k, &h) == 3) printf("%.8lf %.8lf\n", floor(l / k) * h, ceil(l / k) * h);return 0;
}


这篇关于URAL - 1740 - Deer is Better!的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/338308

相关文章

ural 1297. Palindrome dp

1297. Palindrome Time limit: 1.0 second Memory limit: 64 MB The “U.S. Robots” HQ has just received a rather alarming anonymous letter. It states that the agent from the competing «Robots Unli

ural 1149. Sinus Dances dfs

1149. Sinus Dances Time limit: 1.0 second Memory limit: 64 MB Let  An = sin(1–sin(2+sin(3–sin(4+…sin( n))…) Let  Sn = (…( A 1+ n) A 2+ n–1) A 3+…+2) An+1 For given  N print  SN Input One

ural 1820. Ural Steaks 贪心

1820. Ural Steaks Time limit: 0.5 second Memory limit: 64 MB After the personal contest, happy but hungry programmers dropped into the restaurant “Ural Steaks” and ordered  n specialty steaks

ural 1017. Staircases DP

1017. Staircases Time limit: 1.0 second Memory limit: 64 MB One curious child has a set of  N little bricks (5 ≤  N ≤ 500). From these bricks he builds different staircases. Staircase consist

ural 1026. Questions and Answers 查询

1026. Questions and Answers Time limit: 2.0 second Memory limit: 64 MB Background The database of the Pentagon contains a top-secret information. We don’t know what the information is — you

ural 1014. Product of Digits贪心

1014. Product of Digits Time limit: 1.0 second Memory limit: 64 MB Your task is to find the minimal positive integer number  Q so that the product of digits of  Q is exactly equal to  N. Inpu

[论文笔记]Making Large Language Models A Better Foundation For Dense Retrieval

引言 今天带来北京智源研究院(BAAI)团队带来的一篇关于如何微调LLM变成密集检索器的论文笔记——Making Large Language Models A Better Foundation For Dense Retrieval。 为了简单,下文中以翻译的口吻记录,比如替换"作者"为"我们"。 密集检索需要学习具有区分性的文本嵌入,以表示查询和文档之间的语义关系。考虑到大语言模

@vueup/vue-quill使用quill-better-table报moduleClass is not a constructor

quill官方中文文档:https://www.kancloud.cn/liuwave/quill/1434144 扩展表格的使用 注意:想要使用表格 quill的版本要是2.0以后 升级到这个版本后 其他一些插件就注册不了了。 安装: npm install quill@latest   版本需要大于2.0版本 npm install quill-better-table 引入&

后缀数组 - 求最长回文子串 + 模板题 --- ural 1297

1297. Palindrome Time Limit: 1.0 second Memory Limit: 16 MB The “U.S. Robots” HQ has just received a rather alarming anonymous letter. It states that the agent from the competing «Robots Unlim

【URAL】1057 Amount of Degrees 数位DP

传送门:【URAL】1057 Amount of Degrees 题目分析:将数转化成能达到的最大的01串,串上从右往左第i位为1表示该数包括B^i。 代码如下: #include <cstdio>#include <cstring>#include <algorithm>using namespace std ;typedef long long LL ;#de