hdu 1302(简单模拟题)
2013-04-26 12:28
316 查看
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1302
思路:直接按着题目意思模拟就行了。。。
View Code
思路:直接按着题目意思模拟就行了。。。
View Code
#define _CRT_SECURE_NO_WARNINGS #include<iostream> #include<cstdio> #include<cmath> using namespace std; int main(){ double h,u,d,f; while(~scanf("%lf",&h)&&h){ scanf("%lf%lf%lf",&u,&d,&f); int day=0; bool flag=true; double dist=0,s=u*f/100; while(1){ day++; dist+=u; if(dist>h)break; dist-=d; if(dist<0){flag=false;break;}; u-=s; if(u<0)u=0; } if(flag){ printf("success on day %d\n",day); }else printf("failure on day %d\n",day); } return 0; }
相关文章推荐
- hdu 1302(简单模拟题)
- HDU 1302 The Snail(模拟题)
- HDU 4772 Zhuge Liang's Password (简单模拟题)
- HDU 1234 简单模拟题
- HDU1302_Snail【模拟题】【水题】
- hdu 4751 Divide Groups(简单模拟题)
- HDU 4484 Hailstone HOTPO (简单模拟题)
- HDU 1302 The Snail(简单数学题)
- HDU 4772 Zhuge Liang's Password (简单模拟题)
- HDU 3853 LOOPS (简单期望)
- hdu 2846 简单字典树
- HDU-1176-简单dp
- HDOJ(HDU) 1976 Software Version(简单判断)
- hdu 1087 简单dp
- hdu 4355 简单三分找最小值
- hdu 1524 A Chess Game 博弈之,SG函数简单题
- hdu 1176 免费馅饼(简单dp)
- hdu 1003 Max Sum 简单DP
- HDU-2147 kiki's game 简单博弈(*)
- hdu 1087 Super Jumping! Jumping! Jumping!(简单dp)