为什么第八个点没过??

#include <iostream>
using namespace std;
int Time,MoFa,Sum;
bool Leave=false;
int main()
{
cin>>MoFa>>Sum>>Time;
int SUM=Sum,TIME=Time;
while( Time>0 )
{
if( MoFa>=10 )
{
MoFa-=10;
Time--;
Sum-=60;
if( Sum<=0 )
{
cout<<"Yes"<<endl;
cout<<TIME-Time<<endl;
Leave=true;
break;
}
continue;
}
int wait=(10-MoFa)/4+(10-MoFa)%4!=0;
int walk=(wait+1)*17;
if( walk>Sum || (wait>=3 && Time>=7 && Sum<=7*17) )
{
while( Time>=0 && Sum>0 )
{
Sum-=17;
Time--;
}
if( Sum<=0 )
{
cout<<"Yes"<<endl;
cout<<TIME-Time<<endl;
Leave=true;
}
break;
}
if( (wait>=3 && Time<7)|| wait>=Time )
{
while( Time>=0 && Sum>0 )
{
Sum-=17;
Time--;
}
if( Sum<=0 )
{
cout<<"Yes"<<endl;
cout<<TIME-Time<<endl;
Leave=true;
break;
}
break;
}
else
{
Time=Time-wait;
MoFa=MoFa+wait*4;
}
}
if( Leave==false )
{
cout<<"No"<<endl;
cout<<SUM-Sum<<endl;
}
return 0;
}

0 条评论

目前还没有评论...

信息

ID
1431
难度
5
分类
动态规划 | 背包 点击显示
标签
递交数
6160
已通过
1919
通过率
31%
被复制
24
上传者