QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#260746#7758. PainterLoging#WA 1ms3536kbC++201.0kb2023-11-22 14:42:182023-11-22 14:42:18

Judging History

你现在查看的是最新测评结果

  • [2023-11-22 14:42:18]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3536kb
  • [2023-11-22 14:42:18]
  • 提交

answer

#include <bits/stdc++.h>

#define Max 100005

using namespace std;

struct Node{
	int a,b,c,d,id;
	inline bool operator<(const Node x)const{
		if(d!=x.d)return d<x.d;
		int sum1=max(1ll*c*(a+b)+1ll*c*x.b,1ll*x.c*(x.a+x.b)+1ll*x.c*a);
		int sum2=max(1ll*x.c*(x.a+x.b)+1ll*x.c+b,1ll*c*(a+b)+1ll*c*x.a);
		return sum1<sum2;
	}
}p[Max],q[Max];

int T,n,id[Max];

int main(){
	ios::sync_with_stdio(false);
	cin>>T;
	while(T--){
		cin>>n;
		for(int i=1;i<=n;i++){
			p[i].id=i;
			cin>>p[i].a>>p[i].b>>p[i].c;
			if(p[i].a<p[i].b)p[i].d=-1;
			else if(p[i].a==p[i].b)p[i].d=0;
			else p[i].d=1;
		}
//		for(int i=1;i<=n;i++)cin>>id[i];
//		for(int i=1;i<=n;i++){
//			q[i]=p[id[i]];
//		}
//		for(int i=1;i<=n;i++)p[i]=q[i];
		sort(p+1,p+n+1);
		for(int i=1;i<=n;i++)cout<<p[i].id<<" ";cout<<'\n';
		int ans=0;
		for(int i=1;i<=n;i++){
			int sum=0;
			for(int j=1;j<=i;j++)sum+=p[j].a;
			for(int j=i;j<=n;j++)sum+=p[j].b;
			ans=max(ans,sum*p[i].c);
		}
		cout<<ans<<endl;
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3536kb

input:

7
Circle 0 0 5 *
Circle -2 2 1 @
Circle 2 2 1 @
Rectangle 0 -1 0 0 ^
Rectangle -2 -2 2 -2 _
Render -5 -5 5 5
Render -1 0 1 2

output:


0

0

0

0

0

0

0

result:

wrong answer 1st lines differ - expected: '.....*.....', found: ''