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

网上的解答铺天盖地。我硬是花了两天才懂了点。

wiki上的解释:https://en.wikipedia.org/wiki/Jeep_problem

解答:每个点的油量是500,500*2,500*3... ...

每次的距离是500,500/3,500/5,... ...,500/2n-1;

#include <bits/stdc++.h>
using namespace std; int main()
{
double dist, tank;
scanf("%lf%lf", &dist, &tank);
double now = dist, cost = , pre;
int k = ;
while( (pre = now - tank / (*k-)) > ){
cost += tank;
now = pre;
k++;
}
cost += now * (*k-);
printf("%.0f\n", ceil(cost));
return ;
}

ural 1113,jeep problem的更多相关文章

  1. URAL 1881 Long problem statement

    1881. Long problem statement Time limit: 0.5 secondMemory limit: 64 MB While Fedya was writing the s ...

  2. 【构造】Ural Championship April 30, 2017 Problem K. King’s island

    题意:让你构造一个n个点的简单多边形,使得所有点是整点,并且所有边长是整数,并且没有边平行于坐标轴. 就利用勾股数,如下图这样构造即可,n为偶数时,只需矩形拼成,n为奇数时,封上虚线边即可. #inc ...

  3. 【哈希表】Ural Championship April 30, 2017 Problem H. Hamburgers

    题意:有n群人,每个人有喜欢的汉堡配方:有m家店,给出每家店的每个汉堡的配方,如果存在某个汉堡,其配料表包含某个人喜欢的配方,则这个人喜欢这个汉堡所在的店家.问你对每群人,输出被喜欢的人数最多的店面是 ...

  4. 【折半枚举】Ural Championship April 30, 2017 Problem G. Glasses with solutions

    题意:有n杯盐溶液,给定每杯里面盐的质量以及盐溶液的质量.问你有多少种方案选择一个子集,使得集合里面的盐溶液倒到一个被子里面以后,浓度为A/B. 折半枚举,暴力搜索分界线一侧的答案数,跨越分界线的答案 ...

  5. 【POJ 1113】Wall

    http://poj.org/problem?id=1113 夏令营讲课时的求凸包例题,据说是PKUSC2015的一道题 我WA两次错在四舍五入上了(=゚ω゚)ノ #include<cmath& ...

  6. CSU 1113 Updating a Dictionary(map容器应用)

    题目链接:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1113 解题报告:输入两个字符串,第一个是原来的字典,第二个是新字典,字典中的元素的格式为 ...

  7. ural 2071. Juice Cocktails

    2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and ...

  8. ural 2073. Log Files

    2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best pro ...

  9. ural 2070. Interesting Numbers

    2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate int ...

随机推荐

  1. 实验十三_编写、应用中断例程_2 & 总结

    编写并安装int 7ch中断例程,功能为完成loop指令的功能 参数:(cx)= 循环次数,(bx)= 位移 以上中断例程安装成功后,对下面的程序进行单步跟踪,尤其注意观察int.iret指令执行前后 ...

  2. Leetcode: String to Integer

    Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. ...

  3. 转:SELENIUM TIPS: CSS SELECTORS

    This page will show you some CSS rules and pseudo-classes that will help you move your XPATH locator ...

  4. 2-sat(石头、剪刀、布)hdu4115

    Eliminate the Conflict Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/O ...

  5. 批量文本读取URL获取正常访问且保留对应IP

    #coding=utf-8 import sys import requests for i in range(3000,4999,1): url = 'http://192.168.88.139:8 ...

  6. Cookie—的使用

    编写 Cookie 浏览器负责管理用户系统上的 Cookie.Cookie 通过 HttpResponse 对象发送到浏览器,该对象公开称为 Cookies 的集合. 可以将 HttpResponse ...

  7. centos 关闭不使用的服务

    CentOS关闭服务的方法: chkconfig –level 2345 服务名称 off 服務名稱 建議 說明 acpid 停用 Advanced Configuration and Power I ...

  8. 夺命雷公狗---微信开发52----网页授权(oauth2.0)获取用户基本信息接口(2)

    我们在上一节课已经发送code给第三方了,那么这就要获取code去换取到用户的openid. 第一步:编写create_baseurl.php(上一节课程已经写完了) 第二步:编写vote1.php( ...

  9. ajax讲解:“创建用户”和“用户登录”练习

    ajax可以在不重新加载整个网页的情况下,对网页的某部分进行更新. 传统的网页(不使用 AJAX)如果需要更新内容,必须重载整个网页页面.   接下来,将以例子的形式进行讲解   例一:创建用户   ...

  10. 【转】The Attached Behavior Pattern

    原文:http://www.bjoernrochel.de/2009/08/19/the-attached-behavior-pattern/ The Attached Behavior Patter ...