思路应该对的,代码实现过不了样例
查看原帖
思路应该对的,代码实现过不了样例
1200551
yuan2795楼主2024/10/10 12:30
#include<bits/stdc++.h>
#define int unsigned long long//防超时
using namespace std;
int cnt;
int a,b,c,d,e,f,g,h,k,x,y;
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	cin>>a>>b>>c>>d>>e>>f>>g>>h>>k>>x>>y;//输入
	int exp=f;
	int lp=d+x;
	int pt=0;
	while(pt<y)//判断是否超过y
	{
		
		if(lp>=b){//判断是否进入操作1
			pt+=a;
			f+=g;
			
			if(exp>=e)
			{
				
				lp=lp+c-b+h;c+=h;
				exp-=e;
				e+=k;
				
			}
			else
			{
				lp-=b;
			}
		}
		
		if(lp<b)
		{
			lp+=c;
			cnt+=1;
		}
	
	}
	cout<<cnt;
	return 0;
	
}
```cpp
2024/10/10 12:30
加载中...