能否帮我看一下代码WA了三个点
查看原帖
能否帮我看一下代码WA了三个点
382747
herobrine_wqh楼主2021/12/18 10:11
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long a,c,p,q,r,x,temp=0;
	cin>>a>>c>>p>>q>>r>>x;
	if(a<c){
		if(x>(c-a)*p){
			x-=(c-a)*p;
			temp+=c;
			if(x>q){
				x-=q;
				temp+=x/r;
				cout<<temp;
				return 0;
			}else{
				cout<<temp;
				return 0;
			}
		}else{
			temp+=(x/(c-a))*p;
			cout<<temp;
			return 0;
		}
	}else if(a==c){
		temp=c;
		if(x>q){
			x-=q;
			temp+=x/r;
			cout<<temp;
			return 0;
		}else{
			cout<<temp;
			return 0;
		}
	}else{
		temp+=a;
		temp+=x/r;
		cout<<temp;
		return 0;
	} 
	return 0;
} 
2021/12/18 10:11
加载中...