求助
查看原帖
求助
373662
KobeBeanBryant楼主2021/2/23 18:56
#include<bits/stdc++.h>
using namespace std;
int a,b,c,q,w,e,r,t,y,p,o,l;
int v[5],fy;
int main() {
	cin>>a>>b>>c;
	cin>>q>>w>>e>>r>>t>>y;
	p=w-q;
	o=r-e;
	l=y-t;
	bool sf[5];
	for(int i=min(q,min(e,t)); i<=max(p,max(o,l)); i++) {
		if(i>=q&&i<w) sf[0]=true;
		else if(i>=e&&i<r) sf[1]=true;
		else if(i>=t&&i<y) sf[2]=true;
		if(sf[0]) fy+=a;
		else if(sf[1]) fy+=2*b;
		else if(sf[2]) fy+=3*c;
	}
	cout<<fy;
}

不知道为什么一直0分

2021/2/23 18:56
加载中...