QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#752015#9750. 拼图doyoWA 2ms3596kbC++201.4kb2024-11-15 21:36:312024-11-15 21:36:31

Judging History

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

  • [2024-11-15 21:36:31]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3596kb
  • [2024-11-15 21:36:31]
  • 提交

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)<=D;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;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3588kb

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

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 4243rd lines differ - expected: '9', found: '12'