抽象!!!
查看原帖
抽象!!!
989997
DGL__DGL_AFO楼主2024/5/8 20:16

不过样例2但是能拿50分

为啥咧

#include<bits/stdc++.h>
using namespace std;
int m,s,t;
int f[3145][1145];
int maxx=1e9;

int main()
{
	memset(f,0x3f,sizeof f);
	cin>>m>>s>>t;
	f[0][m]=s;
	for(int i=1;i<=t;i++)
	  for(int j=1;j<=m+10;j++)
	  {
	  	f[i][j]=min(f[i][j],f[i-1][j]-17);
	  	f[i][j]=min(f[i][j],f[i-1][j+10]-60);
	   	f[i][j+4]=f[i-1][j];
	   	if(f[i][j]<=0||f[i][j+4]<=0)
	   	{
	   		cout<<"Yes"<<endl;
	   		cout<<i;
	   		return 0;
			}
			maxx=min(f[i][j],maxx);
		} 
	
	cout<<"No"<<endl;
	cout<<s-maxx;
	
	return 0;
 } 
2024/5/8 20:16
加载中...