QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#761365#9750. 拼图wuyi2024WA 9ms3668kbC++201.5kb2024-11-18 22:25:172024-11-18 22:25:21

Judging History

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

  • [2024-11-18 22:25:21]
  • 评测
  • 测评结果:WA
  • 用时:9ms
  • 内存:3668kb
  • [2024-11-18 22:25:17]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
void man()
{
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < 4) {
        cout << "0\n";
        return;
    }
    int ans = 4;
    ans=max(ans,min(C/2,B/2)*2*2+4);
    for (int i=1000;i>=2; i--){
        // if(i*i<ans) break;
        bool ok=false;
        for (int j=2;j<=i ;j++) {
            // if(i*j<ans) break;
            if ((i & 1) == (j & 1)) {
                int need = (i + j - 2 - 2) * 2;
                int x = i * j - 4 - need;
                if (B >= need / 2 && C >= need / 2 && D >= x) {
                    // cerr << i << " " << j << '\n';
                    // cout<<i*j<<'\n';
                    ans = max(ans, i * j);
                    // assert(ans!=2997);
                    // return;
                }else{
                    // ok=true;
                    break;
                }
            } else {
                // int need=(i+j)*2-8;
                // int x=i*j-4-need;
                // if(B>=need/2&&C>=need/2&&D>=x){
                //     cerr<<i<<" "<<j<<'\n';
                //     // cout<<i*j<<'\n';
                //     ans=max(ans,i*j);
                //     // return;
                // }
            }
        }
        // if(ok) break;
    }
    cout << ans << '\n';
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int T;
    cin >> T;
    while (T--)
        man();
    return 0;
}

详细

Test #1:

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

input:

2
4 0 0 0
4 4 4 4

output:

4
16

result:

ok 2 lines

Test #2:

score: -100
Wrong Answer
time: 9ms
memory: 3668kb

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 4111th lines differ - expected: '6', found: '4'