QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#846138#9750. 拼图liujunyi123WA 3ms3892kbC++14538b2025-01-06 22:26:302025-01-06 22:26:31

Judging History

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

  • [2025-01-06 22:26:31]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3892kb
  • [2025-01-06 22:26:30]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=2e5+5;
int T,A,B,C,D; 
int check(int i,int j){
	int h=i-2,res=0;
	for(int l=max(0,j-1);l<=j;l++){
		int x=(h+1)/2+(h+(l&1))/2+(l)/2+(l+!(h&1))/2;
		int y=2*(h+l)-x;
		if(x>C||y>B)continue;
		res=max(res,i*(l+2));
	}
	return res;
}
int main(){
	scanf("%d",&T);
	while(T--){
		scanf("%d%d%d%d",&A,&B,&C,&D);
		if(A<4){puts("0");continue ;}
		int ans=check(2,0);
		for(int i=3;i<=B+C+2;i++)ans=max(ans,check(i,D/(i-2)));
		printf("%d\n",ans);
	}
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3880kb

input:

2
4 0 0 0
4 4 4 4

output:

4
16

result:

ok 2 lines

Test #2:

score: -100
Wrong Answer
time: 3ms
memory: 3892kb

input:

10000
0 0 0 0
0 0 0 1
0 0 0 2
0 0 0 3
0 0 0 4
0 0 0 5
0 0 0 6
0 0 0 7
0 0 0 8
0 0 0 9
0 0 1 0
0 0 1 1
0 0 1 2
0 0 1 3
0 0 1 4
0 0 1 5
0 0 1 6
0 0 1 7
0 0 1 8
0 0 1 9
0 0 2 0
0 0 2 1
0 0 2 2
0 0 2 3
0 0 2 4
0 0 2 5
0 0 2 6
0 0 2 7
0 0 2 8
0 0 2 9
0 0 3 0
0 0 3 1
0 0 3 2
0 0 3 3
0 0 3 4
0 0 3 5
0 0 3 ...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

wrong answer 4113th lines differ - expected: '6', found: '4'