QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#779757 | #9750. 拼图 | Nlll# | AC ✓ | 9ms | 3652kb | C++17 | 520b | 2024-11-24 21:36:14 | 2024-11-24 21:36:15 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
void solve()
{
int A, B, C, D;
cin >> A >> B >> C >> D;
int ans = 0;
if(A >= 4)
{
B = min(B, C);
ans = 4 + B * 2;
for(int i = 1; i < B; i++)
{
int j = min(B - i, D / i);
ans = max(ans, 4 + i * 2 + j * 2 + i * j);
}
}
cout << ans << "\n";
}
int main()
{
cin.tie(0)->sync_with_stdio(false);
int T;
cin >> T;
while(T--) solve();
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3580kb
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: 3584kb
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: 9ms
memory: 3592kb
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: 3652kb
input:
1 0 0 0 0
output:
0
result:
ok single line: '0'
Test #5:
score: 0
Accepted
time: 6ms
memory: 3576kb
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