poj 3672 Long Distance Racing(水题)
来源:互联网 发布:希腊方阵知乎 编辑:程序博客网 时间:2024/05/22 14:56
纯数学。对于每一个unit,同时计算来回所要的时间。
#include<algorithm>
#include<iostream>
#include<stdio.h>
int main()
{
int m,t,u,f,d,ans=0;
char c;
int i;
bool flag;
scanf("%d%d%d%d%d",&m,&t,&u,&f,&d);
for(i=0;i<t;i++)
{
flag=0;
scanf("/n%c",&c);
// printf(" %c/n",c);
if(flag)
continue;
if(c=='u'||c=='d')
{
m-=u;
m-=d;
}
if(c=='f')
{
m=m-2*f;
}
if(m>=0)
ans++;
else
flag=1;
}
printf("%d/n",ans);
return 0;
}
- poj 3672 Long Distance Racing(水题)
- poj 3672 Long Distance Racing
- poj 3672 Long Distance Racing
- poj 3672 Long Distance Racing
- POJ 3672 Long Distance Racing
- POJ 3672 Long Distance Racing(水~)
- POJ 3672 Long Distance Racing G++
- POJ-3672-Long Distance Racing-水题、%c输入要去除换行
- (Relax ST1.29)POJ 3672 Long Distance Racing(来回路问题..)
- poj3672 Long Distance Racing留念下,惨痛的教训
- long-distance running
- A long distance memory
- Long Distance Relationships
- aizu 1318 Long Distance Taxi
- Long Long Message POJ
- poj 2774 Long Long Message
- POJ 2774 Long Long Message
- poj 2774 Long Long Message
- (转)一些BFS的题目
- 我今儿整理收藏夹,改了收藏夹位置!~
- insmod lcd.ko:module has no symbols (stripped?)
- WinCE流设备驱动简介及往BSP添加GPIO驱动
- asp.net中Treeview在IE7中出现竖线断裂的处理
- poj 3672 Long Distance Racing(水题)
- 批量下载MSDN WebCast
- 空间点绕向量旋转
- @Inherited
- 亿万富翁对大学生说的18句话
- 04/03/09
- QT安装(4.4.1+VC2005Team版)
- 关于一些算法介绍的网址
- 赛程生成算法