QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#367012 | #6113. Window Arrangement | Tobo | AC ✓ | 1854ms | 4376kb | C++20 | 3.0kb | 2024-03-25 15:58:48 | 2024-03-25 15:58:48 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
vector<vector<int>> p(n, vector<int>(m));
auto w = p;
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
cin >> p[i][j];
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
cin >> w[i][j];
int s = n * m + (n + 1) * m + (m + 1) * n, t = s + 1;
vector<int> head(t + 1, -1), cost, nxt, cap, to;
auto add = [&](int x, int y, int f, int c)
{
cost.push_back(c);
cap.push_back(f);
to.push_back(y);
nxt.push_back(head[x]);
head[x] = cost.size() - 1;
cost.push_back(-c);
cap.push_back(0);
to.push_back(x);
nxt.push_back(head[y]);
head[y] = cost.size() - 1;
};
vector<int> dis(t + 1), g(t + 1);
const int inf = numeric_limits<int>::max();
auto bfs = [&]() -> bool
{
dis.assign(t + 1, inf);
dis[s] = 0;
queue<int> que;
que.push(s);
while (!que.empty())
{
int cur = que.front();
g[cur] = head[cur];
que.pop();
for (int p = head[cur]; ~p; p = nxt[p])
{
if (cap[p] && dis[to[p]] > dis[cur] + cost[p])
{
dis[to[p]] = dis[cur] + cost[p];
que.push(to[p]);
}
}
}
return dis[t] != inf;
};
vector<int> vis(t + 1);
auto dfs = [&](auto &dfs, int cur, int flow) -> int
{
if (cur == t)
return flow;
int used = 0;
vis[cur] = 1;
for (int &p = g[cur]; ~p; p = nxt[p])
{
if (!vis[to[p]] && cap[p] && dis[to[p]] == dis[cur] + cost[p])
{
int k = dfs(dfs, to[p], min(flow - used, cap[p]));
used += k;
cap[p] -= k, cap[p ^ 1] += k;
if (used == flow)
break;
}
}
vis[cur] = 0;
return used;
};
for (int i = n * m; i < s; i++)
add(i, t, 1, 0);
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
int id = i * m + j;
add(s, id, w[i][j], 0);
add(id, n * m + i * m + j, 1, 0);
add(id, n * m + (i + 1) * m + j, 1, 0);
add(id, n * m + (n + 1) * m + i * (m + 1) + j, 1, 0);
add(id, n * m + (n + 1) * m + i * (m + 1) + j + 1, 1, 0);
if (i + 1 < n)
add(n * m + (i + 1) * m + j, t, 1, p[i][j] * p[i + 1][j]);
if (j + 1 < m)
add(n * m + (n + 1) * m + i * (m + 1) + j + 1, t, 1, p[i][j] * p[i][j + 1]);
}
}
i64 ans = 0;
while (bfs())
ans += (i64)dfs(dfs, s, 1e9) * dis[t];
cout << ans << '\n';
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3580kb
input:
4 3 1 7 10 7 2 8 7 9 10 4 6 4 3 3 3 3 2 4 4 3 4 2 2 3
output:
178
result:
ok 1 number(s): "178"
Test #2:
score: 0
Accepted
time: 1ms
memory: 3600kb
input:
4 3 2 2 9 9 8 4 8 4 5 7 5 2 0 1 0 1 0 1 0 0 1 0 1 0
output:
0
result:
ok 1 number(s): "0"
Test #3:
score: 0
Accepted
time: 4ms
memory: 3964kb
input:
20 20 755 344 600 54 516 407 657 429 565 185 90 323 449 464 872 138 404 500 196 111 666 191 824 98 505 538 949 801 266 861 984 957 396 851 496 147 225 451 874 380 536 200 581 397 305 514 351 416 228 763 566 442 618 131 527 651 954 757 226 129 286 608 819 477 891 22 19 747 565 704 198 703 736 8 835 1...
output:
14347279
result:
ok 1 number(s): "14347279"
Test #4:
score: 0
Accepted
time: 5ms
memory: 3720kb
input:
20 20 883 996 857 428 770 375 536 417 721 664 530 67 347 193 683 55 126 251 918 160 415 776 141 481 362 746 171 662 682 27 506 739 391 283 605 747 955 822 408 490 124 123 362 556 302 894 162 660 846 126 487 389 607 952 719 885 545 378 273 741 797 417 859 458 922 875 804 871 60 542 43 785 751 519 710...
output:
17832787
result:
ok 1 number(s): "17832787"
Test #5:
score: 0
Accepted
time: 5ms
memory: 3716kb
input:
20 20 12 841 115 905 831 152 815 405 876 550 673 811 141 138 710 972 745 513 936 400 355 554 651 160 219 658 688 419 699 897 925 305 978 420 418 451 685 897 645 705 225 533 655 10 491 681 974 904 568 889 305 737 997 772 423 119 432 703 424 545 204 34 194 840 954 241 589 291 659 676 400 571 470 735 4...
output:
10140249
result:
ok 1 number(s): "10140249"
Test #6:
score: 0
Accepted
time: 16ms
memory: 4024kb
input:
30 30 797 774 295 888 552 163 89 965 38 658 757 17 679 751 765 379 981 930 470 284 953 287 129 763 332 975 658 131 71 469 628 464 611 554 436 790 498 346 226 538 108 781 747 246 219 39 481 241 736 136 929 949 939 276 948 960 351 611 327 147 19 290 259 790 418 305 325 634 12 940 359 61 939 794 989 48...
output:
24175937
result:
ok 1 number(s): "24175937"
Test #7:
score: 0
Accepted
time: 25ms
memory: 3756kb
input:
30 30 925 618 41 366 101 428 72 953 193 136 197 760 577 992 576 296 896 488 192 333 597 361 638 147 189 695 880 992 383 340 855 247 199 987 545 390 227 421 463 944 209 895 528 893 215 418 101 485 354 602 43 705 224 904 844 898 237 232 886 655 426 396 298 364 449 967 110 758 803 482 908 143 954 602 8...
output:
36345958
result:
ok 1 number(s): "36345958"
Test #8:
score: 0
Accepted
time: 26ms
memory: 3752kb
input:
30 30 349 463 594 739 355 204 951 941 53 22 444 504 667 425 603 405 322 942 210 574 346 947 147 530 750 904 101 557 503 210 81 517 194 419 653 798 661 984 997 863 502 114 821 347 404 206 208 25 268 557 964 757 317 724 36 132 828 853 37 972 937 717 633 346 184 524 791 585 402 616 560 634 969 114 636 ...
output:
31921917
result:
ok 1 number(s): "31921917"
Test #9:
score: 0
Accepted
time: 19ms
memory: 3720kb
input:
30 30 773 603 852 217 416 981 231 225 912 205 588 544 758 962 222 322 237 500 932 518 94 428 952 105 311 112 618 905 816 376 499 891 589 555 762 398 687 59 938 270 603 228 602 506 593 481 724 565 694 728 78 1000 306 249 636 663 611 666 84 776 345 630 672 623 408 889 280 5 193 942 109 524 792 521 511...
output:
26614264
result:
ok 1 number(s): "26614264"
Test #10:
score: 0
Accepted
time: 140ms
memory: 3796kb
input:
30 30 336 905 393 891 816 387 961 566 524 281 843 444 349 981 28 136 307 622 626 5 629 895 178 573 642 966 218 403 307 677 536 675 854 13 321 77 285 966 611 597 21 24 708 662 592 486 784 554 491 526 887 955 32 370 996 382 221 577 783 515 364 974 684 238 489 576 786 705 855 57 229 256 515 120 685 91 ...
output:
154020136
result:
ok 1 number(s): "154020136"
Test #11:
score: 0
Accepted
time: 147ms
memory: 3736kb
input:
30 30 464 45 139 369 69 460 648 554 383 463 579 187 736 414 543 757 29 76 348 757 377 376 983 445 203 878 735 264 915 548 250 945 441 149 430 381 503 41 144 4 610 435 489 116 780 570 891 798 109 992 296 711 614 894 892 128 108 902 638 23 67 784 723 220 712 238 763 829 646 191 74 42 530 631 264 521 9...
output:
127330425
result:
ok 1 number(s): "127330425"
Test #12:
score: 0
Accepted
time: 141ms
memory: 3752kb
input:
30 30 888 593 397 39 835 428 632 246 539 645 723 931 826 951 866 674 943 634 70 998 126 154 300 828 764 86 957 613 36 714 476 24 732 877 539 85 936 116 86 115 414 357 269 571 777 653 407 338 831 651 114 955 411 10 892 363 699 523 389 827 578 697 58 498 744 795 548 248 949 29 431 124 545 143 140 951 ...
output:
144503495
result:
ok 1 number(s): "144503495"
Test #13:
score: 0
Accepted
time: 145ms
memory: 3760kb
input:
30 30 16 734 142 220 89 909 103 530 694 827 162 675 620 384 381 783 370 385 88 239 874 740 514 507 621 102 178 178 348 584 406 294 831 14 544 685 666 191 323 329 707 768 562 729 966 441 514 582 449 118 228 7 992 343 492 597 482 144 540 440 282 18 97 776 479 160 37 76 740 163 276 615 561 551 911 86 8...
output:
133057161
result:
ok 1 number(s): "133057161"
Test #14:
score: 0
Accepted
time: 158ms
memory: 3768kb
input:
30 30 756 758 410 391 362 933 81 834 557 688 707 327 424 206 531 271 793 985 337 425 289 33 505 309 183 193 811 159 269 641 788 482 954 122 524 522 702 421 527 409 705 997 652 915 908 48 889 353 934 746 852 394 728 673 939 262 138 874 438 137 4 891 439 710 325 575 705 9 656 365 982 548 754 481 768 4...
output:
174981485
result:
ok 1 number(s): "174981485"
Test #15:
score: 0
Accepted
time: 168ms
memory: 4028kb
input:
30 30 180 898 155 869 616 6 65 822 713 871 851 366 811 935 342 893 411 543 763 178 742 811 822 884 40 402 736 724 94 807 15 856 541 259 337 930 432 392 764 327 805 407 433 369 905 835 996 597 552 108 670 638 13 302 539 496 728 495 293 941 411 508 479 692 549 236 490 941 959 499 827 142 769 697 51 92...
output:
165187617
result:
ok 1 number(s): "165187617"
Test #16:
score: 0
Accepted
time: 164ms
memory: 3820kb
input:
30 30 604 743 413 50 973 975 944 810 572 349 586 814 901 176 369 810 134 294 781 419 682 589 331 563 601 610 254 73 702 677 433 831 832 691 150 338 161 763 2 734 802 522 22 824 797 919 512 137 466 871 80 690 811 122 731 434 615 116 636 258 922 317 518 970 284 898 171 65 46 825 184 928 784 209 118 63...
output:
189511101
result:
ok 1 number(s): "189511101"
Test #17:
score: 0
Accepted
time: 165ms
memory: 3996kb
input:
30 30 732 291 967 528 227 48 223 798 728 235 538 662 695 906 180 727 48 556 799 363 431 175 841 946 650 34 475 638 14 548 659 909 227 827 450 938 891 838 239 845 391 740 507 982 986 707 619 677 892 530 193 741 392 454 923 669 502 737 491 62 330 230 853 248 315 263 956 484 645 663 29 11 503 720 994 7...
output:
146279509
result:
ok 1 number(s): "146279509"
Test #18:
score: 0
Accepted
time: 6ms
memory: 4048kb
input:
50 20 7 6 1 3 2 6 6 4 7 7 4 1 8 4 1 7 1 4 9 5 5 4 3 10 6 5 1 10 4 1 6 5 8 6 2 7 6 5 3 5 4 3 4 10 4 7 7 8 6 6 4 7 9 6 3 2 5 7 10 1 6 9 5 4 3 8 6 5 10 7 3 10 10 7 9 8 3 5 10 6 3 5 10 9 8 4 3 3 10 6 1 1 9 8 4 9 4 7 6 3 2 8 8 4 5 3 6 7 6 9 4 1 8 7 9 3 5 6 10 8 3 9 3 1 3 4 8 3 5 4 9 4 3 5 7 9 10 4 1 1 4 ...
output:
5096
result:
ok 1 number(s): "5096"
Test #19:
score: 0
Accepted
time: 18ms
memory: 4220kb
input:
50 45 7 9 9 1 6 9 1 4 5 8 5 9 9 2 7 10 3 9 3 4 10 2 7 10 4 2 4 7 10 10 8 4 7 4 6 10 8 7 8 9 9 8 4 1 4 6 7 5 6 10 3 9 9 10 4 3 8 3 5 1 9 2 3 10 3 4 8 6 4 7 6 6 2 5 2 10 2 4 7 3 5 2 3 9 6 6 1 7 7 3 3 1 6 6 6 3 3 9 6 3 6 1 8 6 2 4 3 6 4 2 4 3 8 3 3 8 2 2 4 2 2 2 2 4 1 3 10 1 5 8 3 3 1 8 6 2 5 9 5 3 8 5...
output:
10959
result:
ok 1 number(s): "10959"
Test #20:
score: 0
Accepted
time: 15ms
memory: 4260kb
input:
45 50 10 10 8 7 1 1 10 10 10 8 7 9 1 5 4 7 9 10 7 10 4 4 5 10 9 4 9 9 2 7 6 8 2 5 3 2 2 7 9 3 5 4 9 3 4 1 2 7 6 9 9 1 1 6 3 9 3 10 7 3 2 7 9 4 3 9 3 1 10 3 6 10 2 9 3 5 4 5 4 7 6 5 2 2 8 4 10 2 8 1 1 5 9 9 4 6 5 1 6 6 10 7 2 1 5 7 4 9 7 5 10 5 3 6 8 1 9 8 5 4 2 8 6 7 10 7 3 9 5 2 3 4 9 9 2 1 7 8 6 2...
output:
10532
result:
ok 1 number(s): "10532"
Test #21:
score: 0
Accepted
time: 15ms
memory: 4308kb
input:
50 50 2 4 5 2 9 8 6 10 2 3 6 8 7 2 5 3 4 5 5 9 10 5 3 9 2 5 9 3 6 1 6 1 10 9 4 5 5 5 6 4 4 9 5 5 7 9 2 9 3 6 10 4 10 8 8 6 5 6 5 10 10 5 6 1 10 9 2 4 3 1 2 7 1 8 3 10 1 7 6 4 6 8 7 3 5 8 7 4 5 1 10 10 7 5 9 8 3 7 10 7 3 2 10 6 4 9 3 5 4 1 6 7 2 8 10 9 3 10 7 9 9 4 7 9 3 9 2 5 1 3 3 5 9 4 9 9 5 4 7 9...
output:
11611
result:
ok 1 number(s): "11611"
Test #22:
score: 0
Accepted
time: 11ms
memory: 4256kb
input:
50 50 2 8 8 7 9 1 5 2 1 1 4 5 7 9 4 10 6 3 1 10 8 9 2 2 9 4 6 4 9 1 2 1 7 5 9 9 10 10 7 7 5 2 4 3 4 7 8 3 7 9 7 8 4 8 10 6 6 7 2 4 1 10 1 9 3 4 7 8 5 5 1 7 6 2 10 4 2 10 9 10 9 8 3 1 8 2 9 1 5 10 8 10 9 10 8 6 1 4 4 3 2 9 1 9 6 1 7 10 9 2 3 1 4 9 2 10 6 10 5 5 5 9 5 3 7 3 6 1 8 9 7 1 7 1 9 6 10 5 10...
output:
11341
result:
ok 1 number(s): "11341"
Test #23:
score: 0
Accepted
time: 15ms
memory: 4244kb
input:
50 50 10 8 4 9 10 10 4 6 1 3 7 9 7 2 5 9 1 7 9 7 9 4 1 2 10 10 7 1 9 8 4 10 8 8 8 3 4 1 5 8 4 2 5 8 2 10 5 3 1 2 1 4 9 8 6 4 5 10 1 7 8 1 6 7 9 9 6 9 6 4 3 10 3 3 10 4 2 7 4 7 3 3 9 5 3 4 1 1 6 6 8 3 10 5 7 1 9 5 6 4 5 9 2 4 1 3 8 3 5 4 9 10 6 8 6 5 8 3 2 1 10 5 6 3 4 4 6 3 6 4 9 6 8 10 8 6 10 7 1 3...
output:
9600
result:
ok 1 number(s): "9600"
Test #24:
score: 0
Accepted
time: 18ms
memory: 4276kb
input:
50 50 8 1 2 7 4 7 8 8 6 9 7 9 9 3 2 10 7 5 7 8 1 2 5 9 1 2 3 2 8 8 2 10 5 4 1 3 10 5 2 2 9 7 10 2 9 4 1 7 7 5 5 2 4 7 6 9 2 5 3 5 2 6 2 7 10 7 3 9 5 8 2 6 8 9 5 5 8 4 7 1 4 9 6 9 8 4 5 4 6 5 8 1 7 2 2 1 5 7 10 6 2 7 5 7 5 9 3 10 10 5 6 5 8 8 10 6 7 5 10 9 5 4 8 7 4 8 9 10 10 6 7 8 10 9 4 3 1 4 10 1 ...
output:
9049
result:
ok 1 number(s): "9049"
Test #25:
score: 0
Accepted
time: 29ms
memory: 4240kb
input:
50 50 1 5 2 9 6 4 6 7 7 7 6 6 4 5 6 8 7 2 1 10 3 9 9 5 4 5 10 9 6 10 2 1 7 7 10 2 5 4 3 9 5 3 6 6 1 9 4 5 3 8 6 5 6 4 4 6 4 9 8 6 6 3 7 1 5 3 3 6 1 10 2 3 7 6 9 4 3 1 5 6 10 9 5 4 2 6 6 8 7 10 2 4 6 9 10 4 4 7 10 6 2 4 7 7 9 4 10 9 6 6 5 2 7 5 5 8 8 3 1 10 7 7 1 5 10 8 3 1 4 6 9 2 9 10 8 7 3 5 8 1 1...
output:
55739
result:
ok 1 number(s): "55739"
Test #26:
score: 0
Accepted
time: 28ms
memory: 4248kb
input:
50 50 9 10 6 9 9 3 10 5 2 9 5 10 5 8 5 5 9 8 3 1 2 7 7 5 5 3 1 8 4 10 10 1 4 9 7 10 4 9 7 10 8 3 7 5 10 7 9 5 1 1 4 7 9 2 4 1 5 10 5 10 7 6 2 9 8 9 2 10 10 6 4 3 2 9 4 8 3 2 8 8 7 9 5 2 6 4 10 5 7 9 10 10 7 4 9 9 2 8 2 6 5 8 8 2 6 6 9 10 1 1 9 3 9 10 1 9 8 7 7 7 5 3 4 5 3 2 10 7 8 10 8 8 9 3 2 2 10 ...
output:
53476
result:
ok 1 number(s): "53476"
Test #27:
score: 0
Accepted
time: 29ms
memory: 4244kb
input:
50 50 3 8 1 10 1 6 3 3 8 8 5 1 9 6 4 2 4 10 1 5 4 3 2 8 6 1 2 3 5 1 2 10 5 1 9 10 4 4 8 5 5 6 8 9 8 1 5 5 5 3 4 9 4 3 10 5 2 5 6 2 1 9 7 5 3 4 3 4 9 10 3 3 5 1 5 5 9 9 1 6 8 1 6 6 7 2 1 7 10 8 4 7 8 9 8 5 10 10 10 2 6 2 9 3 10 8 9 5 7 2 8 2 1 3 9 2 10 10 6 3 10 4 10 9 1 6 10 8 9 7 10 4 7 2 8 9 7 3 3...
output:
49141
result:
ok 1 number(s): "49141"
Test #28:
score: 0
Accepted
time: 30ms
memory: 4240kb
input:
50 50 1 3 9 8 5 3 2 1 7 10 8 1 9 9 3 1 6 1 3 4 5 4 1 7 3 8 9 3 7 9 2 10 10 8 8 8 8 5 6 5 1 6 7 6 5 6 10 1 3 6 1 3 7 5 6 3 2 6 5 10 6 2 6 6 4 1 4 7 10 4 8 6 10 7 1 9 5 2 6 8 2 8 10 4 4 5 3 8 4 7 2 9 7 4 3 7 6 1 2 6 1 6 10 10 3 4 8 8 2 5 4 6 5 1 3 3 9 8 1 7 6 4 8 9 7 4 8 4 3 9 2 10 2 9 9 5 8 5 6 9 5 6...
output:
49743
result:
ok 1 number(s): "49743"
Test #29:
score: 0
Accepted
time: 29ms
memory: 4272kb
input:
50 50 2 9 7 9 4 9 5 9 7 2 8 10 5 2 2 9 7 2 6 4 10 6 2 3 9 3 2 10 6 7 10 5 8 3 7 9 7 6 5 7 7 1 10 7 8 4 3 9 7 9 9 1 5 9 3 2 4 9 2 8 7 2 4 8 1 3 3 4 4 10 4 3 4 7 5 9 10 8 5 10 8 10 1 4 9 8 4 7 6 10 9 3 8 6 8 4 2 9 7 3 7 6 3 3 9 4 4 4 9 7 5 8 9 1 7 7 8 9 1 1 7 8 6 10 4 3 6 10 9 8 9 3 3 1 6 2 8 9 9 6 1 ...
output:
56108
result:
ok 1 number(s): "56108"
Test #30:
score: 0
Accepted
time: 26ms
memory: 4376kb
input:
50 50 10 3 3 1 6 3 10 7 2 4 1 10 6 3 3 6 1 6 8 9 9 10 10 6 10 9 3 1 8 7 6 3 3 5 2 5 7 5 7 1 4 9 5 6 7 10 1 3 5 1 3 3 9 3 9 4 4 4 7 4 10 5 3 1 2 8 1 4 3 4 7 5 3 3 7 5 10 1 8 6 9 2 7 8 4 8 2 4 6 3 7 7 7 1 7 1 10 7 3 7 4 2 8 10 1 10 3 7 6 2 5 7 1 10 5 2 10 8 8 8 3 4 4 9 6 1 6 1 5 4 1 9 7 6 7 8 9 4 1 5 ...
output:
58373
result:
ok 1 number(s): "58373"
Test #31:
score: 0
Accepted
time: 28ms
memory: 4304kb
input:
50 50 10 8 7 10 9 10 7 9 8 7 1 3 10 2 10 9 8 4 6 7 7 10 5 7 7 2 10 6 5 7 2 8 4 2 4 3 6 6 10 8 5 3 10 2 6 7 2 9 7 4 5 4 4 10 5 9 1 5 10 9 8 6 8 3 3 6 6 8 4 8 6 1 8 5 2 9 6 4 5 10 3 8 4 1 6 4 4 10 4 2 5 4 9 1 6 3 6 8 7 1 8 6 9 1 10 6 8 4 10 4 10 8 3 5 9 3 9 10 6 4 4 5 2 3 6 9 6 3 3 7 5 4 6 9 3 5 5 2 4...
output:
57541
result:
ok 1 number(s): "57541"
Test #32:
score: 0
Accepted
time: 28ms
memory: 4188kb
input:
50 50 8 2 6 2 7 3 9 3 7 9 1 1 10 7 1 6 6 8 8 2 8 7 4 10 4 10 1 9 1 3 6 2 1 4 5 3 10 1 8 9 4 4 5 7 2 1 4 2 5 7 8 8 9 2 7 7 8 8 9 3 9 1 7 9 8 7 3 2 3 6 10 8 3 6 1 9 2 1 10 8 6 1 4 9 7 2 1 7 3 8 3 10 10 2 5 7 4 9 9 7 1 1 2 8 4 2 4 3 7 5 4 3 6 3 5 8 1 1 5 8 2 7 10 3 10 3 6 9 8 1 7 6 6 6 3 6 6 3 5 9 3 10...
output:
56369
result:
ok 1 number(s): "56369"
Test #33:
score: 0
Accepted
time: 1854ms
memory: 4304kb
input:
50 50 994 478 621 47 258 702 48 709 325 437 589 483 431 49 309 64 259 541 443 819 743 753 463 739 139 805 731 414 806 378 616 875 313 977 194 56 649 833 296 4 321 45 757 606 390 324 834 500 577 576 425 981 353 983 867 784 70 661 756 43 959 432 842 533 45 75 897 987 246 707 569 71 795 589 902 12 266 ...
output:
1256165665
result:
ok 1 number(s): "1256165665"
Test #34:
score: 0
Accepted
time: 1ms
memory: 3552kb
input:
1 1 1 4
output:
0
result:
ok 1 number(s): "0"
Test #35:
score: 0
Accepted
time: 0ms
memory: 4248kb
input:
50 50 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000...
output:
2427000000
result:
ok 1 number(s): "2427000000"
Test #36:
score: 0
Accepted
time: 2ms
memory: 4224kb
input:
50 50 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000...
output:
0
result:
ok 1 number(s): "0"
Test #37:
score: 0
Accepted
time: 2ms
memory: 4188kb
input:
50 50 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000...
output:
1000000
result:
ok 1 number(s): "1000000"