QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#758682#9750. 拼图fstqwq#WA 16ms3648kbC++20689b2024-11-17 19:20:362024-11-17 19:20:36

Judging History

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

  • [2024-11-17 19:20:36]
  • 评测
  • 测评结果:WA
  • 用时:16ms
  • 内存:3648kb
  • [2024-11-17 19:20:36]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

void work() {
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < 4) cout << "0\n";
    else {
        int ans = 4;
        for (int i = 3; i <= 9; i++) {
            for (int j = 3; ; j++) {
                int a = 4;
                int b = (i - 3 + j - 3) + 2;
                int c = (i - 3 + j - 3) + 2;
                int d = (i - 2) * (j - 2);
                if (a <= A && b <= B && c <= C && d <= D) {
                    ans = max(ans, i * j);
                } else break;
            }
        }
        cout << ans << '\n';
    }
}

int main() {
    int T; cin >> T;
    while (T--) work();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
4 0 0 0
4 4 4 4

output:

4
16

result:

ok 2 lines

Test #2:

score: -100
Wrong Answer
time: 16ms
memory: 3648kb

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'