QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#752008 | #9750. 拼图 | doyo | WA | 2ms | 3700kb | C++20 | 1.4kb | 2024-11-15 21:34:54 | 2024-11-15 21:34:55 |
Judging History
answer
#include<bits/stdc++.h>
using ll=long long;
void work()
{
int A,B,C,D;
std::cin>>A>>B>>C>>D;
int ans=0;
if(A<4) {std::cout<<ans<<'\n';return;}
ans=2*(2+std::min(B,C));
for(int x=3;x<=C+2;x++)
{
for(int y=3;(x-2)*(y-2)<=C;y++)
{
bool flag=false;
if(x%2==1&&y%2==1)
{
int ndB=((x-2+1)/2)*2+((y-2)/2)*2;
int ndC=((y-2+1)/2)*2+((x-2)/2)*2;
if(B>=ndB&&C>=ndC||B>=ndC&&C>=ndB) flag=true;
}
if(x%2==0&&y%2==1)
{
int ndB=x-2+((y-2+1)/2)*2;
int ndC=x-2+((y-2)/2)*2;
if(B>=ndB&&C>=ndC||B>=ndC&&C>=ndB) flag=true;
}
if(x%2==1&&y%2==0)
{
int ndB=x-2+((y-2+1)/2)*2;
int ndC=x-2+((y-2)/2)*2;
if(B>=ndB&&C>=ndC||B>=ndC&&C>=ndB) flag=true;
}
if(x%2==0&&y%2==0)
{
int ndB=x-2+y-2;
int ndC=x-2+y-2;
if(B>=ndB&&C>=ndC||B>=ndC&&C>=ndB) flag=true;
}
if(flag) ans=std::max(ans,x*y);
}
}
std::cout<<ans<<'\n';
}
int main()
{
std::cin.tie(0);
std::cin.sync_with_stdio(0);
int t=1;
std::cin>>t;
while(t--)
work();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3700kb
input:
2 4 0 0 0 4 4 4 4
output:
4 16
result:
ok 2 lines
Test #2:
score: -100
Wrong Answer
time: 2ms
memory: 3584kb
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 4221st lines differ - expected: '8', found: '9'