标签:ring family scan math char s 没有 mes bre soft
想要继续往前的时候想想还有没有时间赶回来?
这是训练,不是人生。
// q.c
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
using namespace std;
int main() {
freopen("HAOI2013T1.in","r",stdin);
freopen("HAOI2013T1.out","w",stdout);
int m,t,v1,v2,v3,i,ans=0; char s[3];
scanf("%d%d%d%d%d",&m,&t,&v1,&v2,&v3);
for(i=1;i<=t;i++) {
scanf("%s",s);
if(s[0]==‘u‘||s[0]==‘d‘)
if(ans+v1+v3<=m) ans+=v1+v3;
else break;
else if(ans+v2+v2<=m) ans+=v2+v2;
else break;
}
printf("%d\n",i-1);
return 0;
}
标签:ring family scan math char s 没有 mes bre soft
原文地址:https://www.cnblogs.com/qjs12/p/8848639.html