QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#770889#9750. 拼图liuhuahua#AC ✓7ms3816kbC++14445b2024-11-22 01:23:512024-11-22 01:23:52

Judging History

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

  • [2024-11-22 01:23:52]
  • 评测
  • 测评结果:AC
  • 用时:7ms
  • 内存:3816kb
  • [2024-11-22 01:23:51]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int T,A,B,C,D;
int main() {
    cin>>T;
    while (T--){
        scanf("%d%d%d%d",&A,&B,&C,&D);
        if(A<4){
            puts("0");
            continue;
        }
        int w=2*min(B, C);
        int ans=0;
        for(int i=0;i<= min(w,D);i++){
            int h=min(i?D/i:(int)1e9,w/2-i);
            ans=max(ans,(i+2)*(h + 2));
        }
        cout<<ans<<'\n';
    }
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
4 0 0 0
4 4 4 4

output:

4
16

result:

ok 2 lines

Test #2:

score: 0
Accepted
time: 2ms
memory: 3612kb

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: 0
Accepted
time: 6ms
memory: 3760kb

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:

1614
1176
1062
930
1640
771
1122
362
841
366
188
1309
1060
1344
1356
1245
1029
1590
963
1347
1320
1304
1548
2586
1900
2166
315
1020
738
795
1032
2016
1732
1344
1576
768
49
620
111
595
1608
696
1428
1180
456
897
1820
1586
1128
732
1668
1030
2007
816
1119
1632
1944
1527
492
1864
474
1100
778
0
536
750...

result:

ok 10000 lines

Test #4:

score: 0
Accepted
time: 0ms
memory: 3740kb

input:

1
0 0 0 0

output:

0

result:

ok single line: '0'

Test #5:

score: 0
Accepted
time: 7ms
memory: 3816kb

input:

10000
631 504 936 780
628 943 109 259
294 847 528 757
534 416 218 606
612 204 654 841
333 866 936 613
217 631 773 693
852 731 561 479
206 903 613 276
218 944 804 730
541 687 701 176
172 308 963 513
657 786 311 603
218 627 913 183
414 732 405 180
414 631 378 417
546 741 150 976
104 255 614 289
476 15...

output:

1568
440
1587
1020
1212
1845
1896
1443
1230
2196
1378
1032
1212
1258
814
1137
1269
768
786
1610
1108
1334
333
1160
828
396
556
1128
654
1472
426
1302
2310
644
1628
1020
1155
639
1560
2352
1329
1160
1944
1257
936
792
1119
1312
1560
1728
1329
702
957
2103
879
1190
1296
1950
1017
905
968
1348
1184
1356...

result:

ok 10000 lines

Extra Test:

score: 0
Extra Test Passed