QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#801439#9750. 拼图PhoenixRebirthWA 50ms3972kbC++23474b2024-12-06 23:55:572024-12-06 23:55:57

Judging History

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

  • [2024-12-06 23:55:57]
  • 评测
  • 测评结果:WA
  • 用时:50ms
  • 内存:3972kb
  • [2024-12-06 23:55:57]
  • 提交

answer

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

int a, b, c, d;

void sc() {
    scanf("%d%d%d%d", &a, &b, &c, &d);
    int ans = 0;
    for (int i = 2; i <= 1000; i++) {
        for (int j = 2; i * j <= 1000; j++) {
            if (a >= 4 && min(b, c) >= i + j - 4 && d >= (i - 2) * (j - 2))
                ans = max(ans, i * j);
        }
    }
    printf("%d\n", ans);
}

int main() {
    int T; scanf("%d", &T);
    while (T--) sc();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3848kb

input:

2
4 0 0 0
4 4 4 4

output:

4
16

result:

ok 2 lines

Test #2:

score: 0
Accepted
time: 41ms
memory: 3780kb

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:

ok 10000 lines

Test #3:

score: -100
Wrong Answer
time: 50ms
memory: 3972kb

input:

10000
931 537 776 551
811 819 334 584
895 420 468 352
954 224 103 732
643 617 385 978
608 310 256 303
561 212 871 741
324 192 179 44
949 54 897 852
388 181 293 91
265 511 49 91
640 354 190 947
886 688 330 526
708 353 725 669
47 997 339 760
417 414 873 495
902 342 778 406
402 529 950 616
73 267 114 7...

output:

1000
1000
999
930
1000
771
1000
362
841
366
188
1000
1000
1000
1000
999
999
1000
963
1000
1000
1000
1000
1000
1000
1000
315
1000
738
795
1000
1000
1000
1000
1000
768
49
620
111
595
1000
696
1000
1000
456
897
1000
1000
1000
732
1000
1000
1000
816
999
1000
1000
1000
492
1000
474
1000
778
0
536
750
100...

result:

wrong answer 1st lines differ - expected: '1614', found: '1000'