测评机: Xeost[5]
得分: 100分
提交日期: 2008-11-2 10:33:00
有效耗时: 485毫秒
测试结果1: 通过本测试点|有效耗时62:ms
测试结果2: 通过本测试点|有效耗时47:ms
测试结果3: 通过本测试点|有效耗时47:ms
测试结果4: 通过本测试点|有效耗时47:ms
测试结果5: 通过本测试点|有效耗时47:ms
测试结果6: 通过本测试点|有效耗时47:ms
测试结果7: 通过本测试点|有效耗时47:ms
测试结果8: 通过本测试点|有效耗时47:ms
测试结果9: 通过本测试点|有效耗时47:ms
测试结果10: 通过本测试点|有效耗时47:ms
=============================
果然贪心模拟效率最高啊!!
===C++ source================
#include <iostream>
using namespace std;
int main(int argc, char **argv)
{
int M,S,T;
int m,s,sl,tl;
cin>>M>>S>>T;
m=M;
s=0;
for(int i=0;i<T;)
{
sl=S-s;
tl=T-i;
if(m/10>=1)//可以闪烁:闪烁 +(60-17)
{
s+=60;
m-=10;
i+=1;
}
else if(tl>=2&&m>=6&&sl>37)//不能闪烁:恢复 闪烁(当Tl>=2且M>=4)
{
s+=60;
m-=6;
i+=2;
}
else if(tl>=3&&m>=2&&sl>51) //恢复 恢复 闪烁(Tl>=3且M>=2)
{
s+=60;
m-=2;
i+=3;
}
else if(tl>=7&&sl>=119) //恢复 恢复 恢复 闪烁 恢复 恢复 闪烁 (Tl>=7)
{
s+=60+60;
i+=7;
//m+=0;
}
else//跑
{
s+=17;
i+=1;
}
if(s>=S)
{
cout<<"Yes"<<endl;
cout<<i<<endl;
cin>>argc;
return 0;
}
}
cout<<"No"<<endl;
cout<<s<<endl;
cin>>argc;
//printf("hello world\n");
return 0;
}