大佬帮帮忙,今天T2WA了几个点
查看原帖
大佬帮帮忙,今天T2WA了几个点
910271
zhengshuyue楼主2023/10/5 19:42

求调

#include<bits/stdc++.h>
using namespace std;
int main(){
	unsigned long long a,b,c,n,x,y,ld1=0,ld2=0,ld3=0;
	cin>>a>>b>>c>>n;
	for(int i=1;i<=n;i++){
		cin>>x>>y;
		if(x==1&&y>ld1){
			a-=y-ld1;
			ld1=y;
		}
		else if(x==2&&y>ld2){
			b-=y-ld2;
			ld2=y;
		}
		else if(x==3&&y>ld3){
			c-=y-ld3;
			ld3=y;
		}
		if(a<=0||b<=0||c<=0)cout<<"0";
		else cout<<a*b*c<<endl;
	}
	return 0;
}
2023/10/5 19:42
加载中...