QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#788478#9750. 拼图isWFnoya#WA 3ms3828kbC++20608b2024-11-27 17:07:242024-11-27 17:07:25

Judging History

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

  • [2024-11-27 17:07:25]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3828kb
  • [2024-11-27 17:07:24]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> PII;
const int N=1e6+10,mod=1e9+7;
char s[N];


vector<int> e[N];



void __(){
	int a,b,c,d;
	scanf("%d%d%d%d",&a,&b,&c,&d);
	int mx=0;
	if(a<4){
		puts("0");
		return;
	}
	int ans=4+b/2+c/2;
	for(int i=1;i<=d;i++){
		if(i*2<=b)
		{
			int nw=min(c/2,d/i);
			ans=max(ans,4+i*2+nw*2+i*nw);
		}
		if(i*2<=c)
		{
			int nw=min(b/2,d/i);
			ans=max(ans,4+i*2+nw*2+i*nw);
		}
	}
	printf("%d\n",ans);
}


int main(){
	
    int _=1;
    cin>>_;
    while(_--){
        __();
    }
}

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 3772kb

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: 3828kb

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 4021st lines differ - expected: '4', found: '5'