QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#751008 | #504. Chessboard | Bucketsmith | 47 | 847ms | 16340kb | C++20 | 2.1kb | 2024-11-15 16:42:50 | 2024-11-15 16:42:51 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using pii = pair<int, int>;
const int N = 1e5 + 10;
vector<pii> sl[N], sr[N];
int tr[N * 4][2], lazy[N * 4];
void update(int i) {
tr[i][0] = tr[i * 2][0] * (lazy[i * 2] <= 0) + tr[i * 2 + 1][0] * (lazy[i * 2 + 1] <= 0);
tr[i][1] = tr[i * 2][1] * (lazy[i * 2] <= 0) + tr[i * 2 + 1][1] * (lazy[i * 2 + 1] <= 0);
}
void build(int i, int l, int r, int m) {
lazy[i] = 0;
if(l + 1 == r) {
tr[i][0] = tr[i][1] = 0;
tr[i][l / m % 2] = 1;
return;
}
int mid = (l + r) / 2;
build(i * 2, l, mid, m);
build(i*2+1, mid, r, m);
tr[i][0] = tr[i * 2][0] + tr[i * 2 + 1][0];
tr[i][1] = tr[i * 2][1] + tr[i * 2 + 1][1];
}
void modify(int i, int l, int r, int ql, int qr, int x) {
if(l >= qr || r <= ql) return;
if(l >= ql && r <= qr) {
lazy[i] += x;
return;
}
int mid = (l + r) / 2;
modify(i * 2, l, mid, ql, qr, x);
modify(i*2+1, mid, r, ql, qr, x);
update(i);
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, k;
cin >> n >> k;
for(int i = 0, x1, y1, x2, y2; i < k; i ++) {
cin >> x1 >> y1 >> x2 >> y2;
x1 --;
y1 --;
sl[x1].emplace_back(y1, y2);
sr[x2].emplace_back(y1, y2);
}
i64 ans = n * (i64)n;
for(int i = 1; i < n; i ++) {
if(n % i) continue;
build(1, 0, n, i);
i64 a = 0, b = 0;
int s0 = (n / i + 1) / 2 * i, s1 = n - s0;
for(int j = 0; j < n; j ++) {
for(auto &[l, r] : sl[j])
modify(1, 0, n, l, r, 1);
for(auto &[l, r] : sr[j])
modify(1, 0, n, l, r, -1);
if(j % i == 0) swap(a, b);
int x = tr[1][0] * (lazy[1] <= 0), y = tr[1][1] * (lazy[1] <= 0);
a += x + s1 - y;
b += y + s0 - x;
}
if(a < ans) ans = a;
if(b < ans) ans = b;
}
cout << ans << "\n";
}
/*
6 8
3 3 3 3
1 2 1 2
3 4 3 4
5 5 5 5
4 3 4 3
4 4 4 4
2 1 2 1
3 6 3 6
*/
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 8
Accepted
Test #1:
score: 8
Accepted
time: 1ms
memory: 5680kb
input:
100 0
output:
4800
result:
ok single line: '4800'
Test #2:
score: 8
Accepted
time: 1ms
memory: 5684kb
input:
99 0
output:
4356
result:
ok single line: '4356'
Test #3:
score: 8
Accepted
time: 1ms
memory: 5604kb
input:
98 0
output:
4704
result:
ok single line: '4704'
Test #4:
score: 8
Accepted
time: 1ms
memory: 5624kb
input:
97 0
output:
4704
result:
ok single line: '4704'
Test #5:
score: 8
Accepted
time: 1ms
memory: 5676kb
input:
96 0
output:
4096
result:
ok single line: '4096'
Test #6:
score: 8
Accepted
time: 1ms
memory: 5736kb
input:
95 0
output:
4332
result:
ok single line: '4332'
Test #7:
score: 8
Accepted
time: 1ms
memory: 5660kb
input:
94 0
output:
4416
result:
ok single line: '4416'
Subtask #2:
score: 8
Accepted
Test #8:
score: 8
Accepted
time: 40ms
memory: 11844kb
input:
62119 62603 12553 17025 12553 17025 6889 49271 6889 49271 22523 10778 22523 10778 27058 28538 27058 28538 39696 26638 39696 26638 59348 52344 59348 52344 53272 14810 53272 14810 29522 5148 29522 5148 52527 55935 52527 55935 43346 19863 43346 19863 49934 33407 49934 33407 57492 27016 57492 27016 7355...
output:
1929384918
result:
ok single line: '1929384918'
Test #9:
score: 8
Accepted
time: 7ms
memory: 7220kb
input:
13553 16567 10214 777 10214 777 1372 7931 1372 7931 2222 8015 2222 8015 12573 8712 12573 8712 11772 7517 11772 7517 13462 5796 13462 5796 11421 3259 11421 3259 259 7736 259 7736 7391 3520 7391 3520 9568 7552 9568 7552 10914 2655 10914 2655 915 11734 915 11734 7211 10475 7211 10475 2350 9168 2350 916...
output:
91841677
result:
ok single line: '91841677'
Test #10:
score: 8
Accepted
time: 27ms
memory: 13672kb
input:
83311 39346 17169 55690 17169 55690 44097 70844 44097 70844 21463 68879 21463 68879 65027 22685 65027 22685 24591 56773 24591 56773 47003 22668 47003 22668 43456 35367 43456 35367 38682 41848 38682 41848 22547 25019 22547 25019 32120 57672 32120 57672 35244 51896 35244 51896 27588 18334 27588 18334 ...
output:
3470361291
result:
ok single line: '3470361291'
Test #11:
score: 8
Accepted
time: 20ms
memory: 7056kb
input:
2593 45808 734 225 734 225 2097 527 2097 527 1970 1389 1970 1389 1595 164 1595 164 535 2519 535 2519 945 1570 945 1570 1155 1379 1155 1379 1805 1711 1805 1711 1722 1785 1722 1785 1875 2530 1875 2530 1258 665 1258 665 1671 2481 1671 2481 702 2358 702 2358 2207 127 2207 127 2420 1000 2420 1000 703 91 ...
output:
3361728
result:
ok single line: '3361728'
Test #12:
score: 8
Accepted
time: 34ms
memory: 12844kb
input:
56393 54508 31316 8221 31316 8221 28261 551 28261 551 56373 14562 56373 14562 30770 1992 30770 1992 26181 47974 26181 47974 20906 48883 20906 48883 30498 40114 30498 40114 42754 10090 42754 10090 17359 14718 17359 14718 39687 20578 39687 20578 38086 21607 38086 21607 46774 54122 46774 54122 15651 11...
output:
1590085022
result:
ok single line: '1590085022'
Test #13:
score: 8
Accepted
time: 16ms
memory: 10112kb
input:
48313 34790 25246 25140 25246 25140 27687 40566 27687 40566 29723 14480 29723 14480 8105 11104 8105 11104 26980 34212 26980 34212 24319 34779 24319 34779 28496 2921 28496 2921 41606 19546 41606 19546 4871 1373 4871 1373 38836 24241 38836 24241 7112 32587 7112 32587 40232 32604 40232 32604 31909 4077...
output:
1167072972
result:
ok single line: '1167072972'
Test #14:
score: 8
Accepted
time: 6ms
memory: 7476kb
input:
22369 7369 8903 15030 8903 15030 21789 2148 21789 2148 20232 1605 20232 1605 18493 16645 18493 16645 7899 17751 7899 17751 20641 6627 20641 6627 8533 4787 8533 4787 17994 79 17994 79 3380 10157 3380 10157 3032 3571 3032 3571 13692 13531 13692 13531 13475 10046 13475 10046 5445 17435 5445 17435 6393 ...
output:
250186080
result:
ok single line: '250186080'
Test #15:
score: 8
Accepted
time: 20ms
memory: 10300kb
input:
49177 34976 20242 3416 20242 3416 29831 41358 29831 41358 44096 23812 44096 23812 38772 41358 38772 41358 15408 24508 15408 24508 12918 43262 12918 43262 14923 13241 14923 13241 24245 1273 24245 1273 15496 17569 15496 17569 18827 48604 18827 48604 24179 10086 24179 10086 39151 33628 39151 33628 3046...
output:
1209188651
result:
ok single line: '1209188651'
Test #16:
score: 8
Accepted
time: 51ms
memory: 10260kb
input:
30517 90160 1148 29295 1148 29295 4742 14556 4742 14556 13369 19072 13369 19072 3570 26309 3570 26309 27652 20912 27652 20912 23698 22199 23698 22199 23527 10525 23527 10525 25304 2904 25304 2904 28108 27338 28108 27338 6120 14668 6120 14668 15168 15380 15168 15380 19202 13390 19202 13390 24498 1460...
output:
465643354
result:
ok single line: '465643354'
Test #17:
score: 8
Accepted
time: 28ms
memory: 9832kb
input:
37853 50195 37739 14089 37739 14089 13677 29088 13677 29088 21276 27518 21276 27518 14263 24397 14263 24397 19814 30961 19814 30961 6565 8097 6565 8097 3121 28314 3121 28314 21858 19175 21858 19175 17886 27128 17886 27128 19921 26743 19921 26743 20268 5870 20268 5870 18988 19478 18988 19478 12130 25...
output:
716424803
result:
ok single line: '716424803'
Subtask #3:
score: 15
Accepted
Test #18:
score: 15
Accepted
time: 1ms
memory: 3736kb
input:
78 280 55 71 55 71 22 73 22 73 60 30 60 30 28 11 28 11 51 39 51 39 21 33 21 33 25 32 25 32 42 54 42 54 62 71 62 71 23 31 23 31 75 1 75 1 56 76 56 76 33 9 33 9 9 76 9 76 77 67 77 67 68 21 68 21 62 24 62 24 32 70 32 70 41 2 41 2 58 58 58 58 65 14 65 14 66 72 66 72 72 21 72 21 71 63 71 63 13 18 13 18 6...
output:
2732
result:
ok single line: '2732'
Test #19:
score: 15
Accepted
time: 0ms
memory: 3660kb
input:
66 47 28 26 28 26 40 19 40 19 6 14 6 14 32 53 32 53 20 1 20 1 26 52 26 52 65 63 65 63 53 65 53 65 16 36 16 36 1 44 1 44 50 24 50 24 54 61 54 61 24 15 24 15 41 30 41 30 31 42 31 42 3 21 3 21 48 4 48 4 7 44 7 44 20 9 20 9 9 40 9 40 53 20 53 20 27 50 27 50 14 39 14 39 48 37 48 37 48 1 48 1 22 63 22 63 ...
output:
1941
result:
ok single line: '1941'
Test #20:
score: 15
Accepted
time: 0ms
memory: 5704kb
input:
80 192 6 44 6 44 5 11 5 11 60 63 60 63 13 7 13 7 38 49 38 49 75 48 75 48 21 18 21 18 57 1 57 1 12 9 12 9 22 58 22 58 38 62 38 62 53 62 53 62 62 49 62 49 28 37 28 37 20 50 20 50 22 27 22 27 63 38 63 38 33 63 33 63 22 57 22 57 1 5 1 5 22 22 22 22 43 5 43 5 79 1 79 1 75 41 75 41 71 46 71 46 30 51 30 51...
output:
3096
result:
ok single line: '3096'
Test #21:
score: 15
Accepted
time: 2ms
memory: 5648kb
input:
78 980 6 3 6 3 26 55 26 55 56 50 56 50 74 1 74 1 63 32 63 32 27 49 27 49 7 37 7 37 43 42 43 42 60 37 60 37 14 53 14 53 41 27 41 27 62 49 62 49 67 7 67 7 21 44 21 44 74 60 74 60 69 51 69 51 17 41 17 41 15 7 15 7 49 20 49 20 13 64 13 64 78 8 78 8 75 47 75 47 38 31 38 31 32 23 32 23 47 51 47 51 39 33 3...
output:
2820
result:
ok single line: '2820'
Test #22:
score: 15
Accepted
time: 1ms
memory: 5704kb
input:
77 854 21 27 21 27 51 59 51 59 24 42 24 42 31 31 31 31 45 17 45 17 28 47 28 47 58 68 58 68 11 17 11 17 76 58 76 58 75 11 75 11 61 17 61 17 50 5 50 5 49 37 49 37 77 55 77 55 38 60 38 60 1 26 1 26 60 9 60 9 38 3 38 3 45 20 45 20 1 65 1 65 16 36 16 36 64 74 64 74 39 47 39 47 43 2 43 2 65 28 65 28 45 45...
output:
2926
result:
ok single line: '2926'
Test #23:
score: 15
Accepted
time: 1ms
memory: 5760kb
input:
76 376 36 4 36 4 71 16 71 16 44 55 44 55 9 38 9 38 57 45 57 45 49 53 49 53 72 18 72 18 8 33 8 33 10 59 10 59 41 64 41 64 26 46 26 46 27 76 27 76 29 57 29 57 55 5 55 5 65 19 65 19 28 13 28 13 34 52 34 52 57 2 57 2 76 36 76 36 58 15 58 15 3 20 3 20 59 23 59 23 65 37 65 37 55 41 55 41 31 14 31 14 35 2 ...
output:
2862
result:
ok single line: '2862'
Test #24:
score: 15
Accepted
time: 0ms
memory: 5672kb
input:
87 898 30 50 30 50 9 39 9 39 26 12 26 12 6 62 6 62 85 51 85 51 72 15 72 15 8 78 8 78 29 36 29 36 68 24 68 24 13 56 13 56 1 39 1 39 4 51 4 51 79 14 79 14 14 85 14 85 59 54 59 54 57 86 57 86 26 54 26 54 14 22 14 22 86 46 86 46 47 34 47 34 75 42 75 42 15 22 15 22 87 79 87 79 7 61 7 61 84 76 84 76 28 85...
output:
3468
result:
ok single line: '3468'
Test #25:
score: 15
Accepted
time: 1ms
memory: 5708kb
input:
63 680 36 4 36 4 62 16 62 16 17 62 17 62 55 58 55 58 38 50 38 50 30 25 30 25 57 38 57 38 38 62 38 62 8 3 8 3 7 38 7 38 9 51 9 51 33 5 33 5 6 6 6 6 22 28 22 28 62 14 62 14 55 29 55 29 17 40 17 40 54 38 54 38 50 30 50 30 2 58 2 58 58 13 58 13 48 27 48 27 12 24 12 24 24 54 24 54 10 37 10 37 46 11 46 11...
output:
1854
result:
ok single line: '1854'
Test #26:
score: 15
Accepted
time: 0ms
memory: 5780kb
input:
94 392 10 77 10 77 77 51 77 51 44 52 44 52 52 51 52 51 65 90 65 90 80 9 80 9 50 27 50 27 26 57 26 57 90 49 90 49 94 14 94 14 24 6 24 6 19 80 19 80 13 77 13 77 33 73 33 73 45 83 45 83 48 73 48 73 67 12 67 12 36 28 36 28 82 18 82 18 10 80 10 80 66 33 66 33 16 34 16 34 88 13 88 13 7 29 7 29 41 65 41 65...
output:
4388
result:
ok single line: '4388'
Test #27:
score: 15
Accepted
time: 1ms
memory: 5704kb
input:
67 130 38 38 38 38 12 6 12 6 55 13 55 13 24 29 24 29 21 38 21 38 65 6 65 6 36 58 36 58 61 47 61 47 56 7 56 7 43 67 43 67 10 1 10 1 7 50 7 50 57 60 57 60 23 42 23 42 51 27 51 27 20 26 20 26 33 29 33 29 8 48 8 48 58 15 58 15 62 1 62 1 55 28 55 28 24 5 24 5 46 66 46 66 24 28 24 28 58 25 58 25 8 46 8 46...
output:
2238
result:
ok single line: '2238'
Test #28:
score: 15
Accepted
time: 1ms
memory: 5708kb
input:
65 620 19 61 19 61 52 63 52 63 46 11 46 11 17 11 17 11 32 9 32 9 21 55 21 55 14 44 14 44 53 51 53 51 28 25 28 25 27 59 27 59 14 34 14 34 62 23 62 23 24 56 24 56 64 51 64 51 42 43 42 43 48 46 48 46 51 46 51 46 45 22 45 22 23 36 23 36 33 1 33 1 4 36 4 36 27 1 27 1 57 19 57 19 49 1 49 1 61 2 61 2 63 50...
output:
2030
result:
ok single line: '2030'
Test #29:
score: 15
Accepted
time: 1ms
memory: 5640kb
input:
53 538 30 25 30 25 17 23 17 23 42 10 42 10 32 19 32 19 42 6 42 6 7 9 7 9 5 30 5 30 10 51 10 51 22 9 22 9 36 45 36 45 5 39 5 39 40 33 40 33 21 8 21 8 22 40 22 40 20 17 20 17 43 4 43 4 14 30 14 30 14 3 14 3 43 23 43 23 43 36 43 36 22 46 22 46 51 16 51 16 46 6 46 6 33 19 33 19 31 24 31 24 36 20 36 20 2...
output:
1402
result:
ok single line: '1402'
Test #30:
score: 15
Accepted
time: 1ms
memory: 3664kb
input:
66 833 54 9 54 9 9 58 9 58 40 38 40 38 66 40 66 40 56 2 56 2 49 9 49 9 49 32 49 32 18 23 18 23 5 51 5 51 58 48 58 48 39 27 39 27 50 62 50 62 22 32 22 32 49 48 49 48 35 31 35 31 26 15 26 15 62 52 62 52 33 14 33 14 3 17 3 17 1 22 1 22 29 57 29 57 60 19 60 19 35 25 35 25 36 15 36 15 58 39 58 39 29 10 2...
output:
2031
result:
ok single line: '2031'
Test #31:
score: 15
Accepted
time: 1ms
memory: 5708kb
input:
76 942 8 17 8 17 45 67 45 67 49 7 49 7 63 31 63 31 8 47 8 47 68 3 68 3 66 26 66 26 31 47 31 47 42 43 42 43 54 51 54 51 54 50 54 50 30 30 30 30 58 22 58 22 51 3 51 3 47 16 47 16 9 15 9 15 21 2 21 2 50 41 50 41 30 29 30 29 5 69 5 69 13 47 13 47 40 33 40 33 71 17 71 17 18 19 18 19 37 14 37 14 31 49 31 ...
output:
2818
result:
ok single line: '2818'
Test #32:
score: 15
Accepted
time: 1ms
memory: 3608kb
input:
51 996 39 14 39 14 15 41 15 41 7 26 7 26 47 28 47 28 38 12 38 12 13 49 13 49 7 38 7 38 48 29 48 29 28 33 28 33 16 16 16 16 17 49 17 49 16 35 16 35 13 30 13 30 41 26 41 26 1 4 1 4 27 40 27 40 40 11 40 11 37 48 37 48 12 9 12 9 14 1 14 1 1 37 1 37 36 7 36 7 47 12 47 12 28 2 28 2 12 8 12 8 23 12 23 12 2...
output:
1234
result:
ok single line: '1234'
Subtask #4:
score: 16
Accepted
Dependency #2:
100%
Accepted
Test #33:
score: 16
Accepted
time: 18ms
memory: 6456kb
input:
951 27387 498 551 498 551 473 607 473 607 34 412 34 412 235 309 235 309 669 533 669 533 326 206 326 206 820 566 820 566 708 684 708 684 765 192 765 192 437 719 437 719 640 241 640 241 752 327 752 327 677 433 677 433 227 769 227 769 561 182 561 182 813 480 813 480 486 108 486 108 930 705 930 705 473 ...
output:
404957
result:
ok single line: '404957'
Test #34:
score: 16
Accepted
time: 31ms
memory: 7812kb
input:
997 84199 816 858 816 858 867 339 867 339 48 144 48 144 602 605 602 605 246 432 246 432 461 795 461 795 767 478 767 478 606 851 606 851 88 169 88 169 660 484 660 484 186 907 186 907 16 846 16 846 739 919 739 919 756 464 756 464 525 34 525 34 161 508 161 508 161 135 161 135 290 878 290 878 139 823 13...
output:
496614
result:
ok single line: '496614'
Test #35:
score: 16
Accepted
time: 73ms
memory: 7980kb
input:
995 98903 812 180 812 180 208 3 208 3 989 882 989 882 752 405 752 405 928 344 928 344 407 923 407 923 45 545 45 545 732 51 732 51 659 674 659 674 144 526 144 526 901 713 901 713 354 159 354 159 926 345 926 345 338 759 338 759 786 907 786 907 380 127 380 127 56 136 56 136 836 864 836 864 772 44 772 4...
output:
479313
result:
ok single line: '479313'
Test #36:
score: 16
Accepted
time: 472ms
memory: 7552kb
input:
960 88310 3 682 3 682 1 188 1 188 822 937 822 937 159 619 159 619 944 633 944 633 750 439 750 439 702 431 702 431 504 513 504 513 384 344 384 344 215 798 215 798 366 113 366 113 956 278 956 278 144 109 144 109 809 806 809 806 69 947 69 947 119 63 119 63 957 798 957 798 529 325 529 325 767 59 767 59 ...
output:
419856
result:
ok single line: '419856'
Test #37:
score: 16
Accepted
time: 517ms
memory: 7544kb
input:
960 98688 527 620 527 620 684 89 684 89 819 261 819 261 489 334 489 334 380 364 380 364 883 902 883 902 359 64 359 64 49 792 49 792 868 50 868 50 893 944 893 944 921 7 921 7 550 271 550 271 93 217 93 217 175 198 175 198 382 278 382 278 206 127 206 127 764 703 764 703 302 948 302 948 395 235 395 235 ...
output:
420968
result:
ok single line: '420968'
Test #38:
score: 16
Accepted
time: 26ms
memory: 7952kb
input:
997 80944 838 518 838 518 68 710 68 710 270 343 270 343 766 3 766 3 915 519 915 519 512 235 512 235 669 304 669 304 292 869 292 869 490 142 490 142 441 313 441 313 289 649 289 649 264 391 264 391 796 438 796 438 47 850 47 850 155 597 155 597 938 106 938 106 827 160 827 160 423 933 423 933 700 226 70...
output:
496902
result:
ok single line: '496902'
Test #39:
score: 16
Accepted
time: 2ms
memory: 5688kb
input:
1000 452 536 100 536 100 315 886 315 886 900 842 900 842 249 135 249 135 696 2 696 2 675 140 675 140 739 975 739 975 358 255 358 255 972 143 972 143 30 18 30 18 313 820 313 820 947 209 947 209 628 4 628 4 271 659 271 659 528 522 528 522 457 709 457 709 832 994 832 994 180 583 180 583 241 576 241 576...
output:
479998
result:
ok single line: '479998'
Test #40:
score: 16
Accepted
time: 64ms
memory: 6904kb
input:
970 42341 130 398 130 398 43 267 43 267 152 807 152 807 362 376 362 376 793 156 793 156 666 260 666 260 891 399 891 399 709 333 709 333 722 236 722 236 405 480 405 480 700 166 700 166 150 864 150 864 627 657 627 657 611 539 611 539 17 747 17 747 20 524 20 524 448 929 448 929 470 850 470 850 235 258 ...
output:
453319
result:
ok single line: '453319'
Test #41:
score: 16
Accepted
time: 67ms
memory: 7904kb
input:
995 90058 511 885 511 885 527 974 527 974 410 866 410 866 904 157 904 157 250 697 250 697 63 988 63 988 274 600 274 600 732 47 732 47 584 58 584 58 440 349 440 349 384 743 384 743 334 146 334 146 33 394 33 394 266 349 266 349 456 459 456 459 828 672 828 672 615 5 615 5 608 49 608 49 450 781 450 781 ...
output:
478912
result:
ok single line: '478912'
Test #42:
score: 16
Accepted
time: 10ms
memory: 5976kb
input:
969 8460 864 658 864 658 488 287 488 287 899 142 899 142 619 510 619 510 408 44 408 44 781 345 781 345 588 528 588 528 745 314 745 314 813 545 813 545 255 957 255 957 211 665 211 665 771 331 771 331 884 734 884 734 51 616 51 616 226 171 226 171 109 493 109 493 880 157 880 157 459 1 459 1 568 880 568...
output:
418466
result:
ok single line: '418466'
Test #43:
score: 16
Accepted
time: 42ms
memory: 7196kb
input:
955 56519 839 109 839 109 193 929 193 929 855 553 855 553 217 753 217 753 525 382 525 382 396 505 396 505 297 109 297 109 120 15 120 15 879 160 879 160 891 466 891 466 608 90 608 90 724 499 724 499 100 481 100 481 500 88 500 88 194 97 194 97 798 775 798 775 103 285 103 285 829 215 829 215 63 190 63 ...
output:
439975
result:
ok single line: '439975'
Test #44:
score: 16
Accepted
time: 73ms
memory: 7672kb
input:
964 67886 426 661 426 661 518 368 518 368 88 520 88 520 723 173 723 173 390 635 390 635 655 637 655 637 254 939 254 939 285 33 285 33 243 460 243 460 117 715 117 715 569 665 569 665 194 231 194 231 193 467 193 467 662 10 662 10 387 266 387 266 852 425 852 425 727 615 727 615 797 343 797 343 609 196 ...
output:
464330
result:
ok single line: '464330'
Test #45:
score: 16
Accepted
time: 71ms
memory: 7816kb
input:
958 95428 850 365 850 365 724 136 724 136 680 956 680 956 557 423 557 423 335 832 335 832 413 272 413 272 587 757 587 757 890 307 890 307 756 424 756 424 221 303 221 303 647 731 647 731 2 606 2 606 877 890 877 890 278 632 278 632 411 837 411 837 679 507 679 507 638 93 638 93 249 404 249 404 230 609 ...
output:
458568
result:
ok single line: '458568'
Test #46:
score: 16
Accepted
time: 13ms
memory: 6736kb
input:
971 33239 281 301 281 301 332 762 332 762 880 766 880 766 394 44 394 44 170 729 170 729 647 241 647 241 689 296 689 296 729 240 729 240 365 521 365 521 351 283 351 283 303 479 303 479 565 891 565 891 820 705 820 705 546 683 546 683 657 464 657 464 10 532 10 532 642 406 642 406 88 266 88 266 549 517 ...
output:
471397
result:
ok single line: '471397'
Test #47:
score: 16
Accepted
time: 3ms
memory: 5828kb
input:
982 2680 707 794 707 794 924 976 924 976 771 496 771 496 757 224 757 224 572 397 572 397 324 319 324 319 325 55 325 55 530 912 530 912 4 388 4 388 799 303 799 303 502 150 502 150 833 19 833 19 159 676 159 676 505 331 505 331 564 134 564 134 335 295 335 295 476 300 476 300 889 553 889 553 643 569 643...
output:
482066
result:
ok single line: '482066'
Subtask #5:
score: 0
Time Limit Exceeded
Test #48:
score: 23
Accepted
time: 767ms
memory: 15688kb
input:
99774 82706 29912 70150 29912 70150 93471 873 93471 873 64978 14740 64978 14740 57016 16856 57016 16856 93392 19170 93392 19170 28713 63187 28713 63187 65553 40025 65553 40025 97816 38346 97816 38346 4184 36771 4184 36771 63515 21172 63515 21172 39860 95092 39860 95092 62818 96699 62818 96699 74942 ...
output:
4424387268
result:
ok single line: '4424387268'
Test #49:
score: 23
Accepted
time: 134ms
memory: 15668kb
input:
99977 93922 21409 34520 21409 34520 86353 53283 86353 53283 63290 57739 63290 57739 29449 23631 29449 23631 61783 79678 61783 79678 67827 84598 67827 84598 8089 36213 8089 36213 55853 38651 55853 38651 31913 29808 31913 29808 64350 59529 64350 59529 83870 62529 83870 62529 13404 87928 13404 87928 34...
output:
4980407190
result:
ok single line: '4980407190'
Test #50:
score: 23
Accepted
time: 380ms
memory: 15632kb
input:
99891 83172 90303 85558 90303 85558 33844 73421 33844 73421 88863 39217 88863 39217 72109 49051 72109 49051 25659 79842 25659 79842 88028 57170 88028 57170 47005 41021 47005 41021 71160 95622 71160 95622 82507 28307 82507 28307 69704 36555 69704 36555 38845 55126 38845 55126 33823 6085 33823 6085 11...
output:
4434769828
result:
ok single line: '4434769828'
Test #51:
score: 23
Accepted
time: 127ms
memory: 15700kb
input:
99993 90989 79270 14288 79270 14288 85646 79349 85646 79349 52895 28799 52895 28799 89240 68108 89240 68108 47521 63032 47521 63032 91833 65207 91833 65207 56215 81968 56215 81968 54407 91291 54407 91291 87242 34284 87242 34284 64307 56530 64307 56530 91507 78113 91507 78113 12306 64739 12306 64739 ...
output:
4443832367
result:
ok single line: '4443832367'
Test #52:
score: 23
Accepted
time: 66ms
memory: 15836kb
input:
99833 97797 91728 33605 91728 33605 56240 1921 56240 1921 52574 2978 52574 2978 66080 84364 66080 84364 96774 46832 96774 46832 90534 78850 90534 78850 37084 57175 37084 57175 96960 74901 96960 74901 1279 85780 1279 85780 67037 80864 67037 80864 63532 14457 63532 14457 91656 16250 91656 16250 35743 ...
output:
4983313553
result:
ok single line: '4983313553'
Test #53:
score: 23
Accepted
time: 847ms
memory: 15664kb
input:
99788 92629 6234 39317 6234 39317 65115 28113 65115 28113 47733 59631 47733 59631 99682 1524 99682 1524 30100 75836 30100 75836 89177 90525 89177 90525 87553 50091 87553 50091 73512 77248 73512 77248 22064 97557 22064 97557 63750 44736 63750 44736 2399 96025 2399 96025 29905 88427 29905 88427 54191 ...
output:
4949362925
result:
ok single line: '4949362925'
Test #54:
score: 23
Accepted
time: 60ms
memory: 15436kb
input:
99713 85568 43719 78844 43719 78844 33991 59935 33991 59935 92925 27684 92925 27684 60286 18810 60286 18810 61410 15158 61410 15158 85740 19367 85740 19367 43352 47681 43352 47681 47811 52636 47811 52636 93092 52225 93092 52225 36943 73559 36943 73559 59912 57408 59912 57408 60639 87392 60639 87392 ...
output:
4971341116
result:
ok single line: '4971341116'
Test #55:
score: 23
Accepted
time: 258ms
memory: 15480kb
input:
99883 86910 55536 1053 55536 1053 21242 23495 21242 23495 45485 56205 45485 56205 50620 73711 50620 73711 23850 55731 23850 55731 37260 16224 37260 16224 2259 23390 2259 23390 96517 89046 96517 89046 77483 29174 77483 29174 95366 60764 95366 60764 57536 36070 57536 36070 56850 8416 56850 8416 16038 ...
output:
4886506698
result:
ok single line: '4886506698'
Test #56:
score: 23
Accepted
time: 121ms
memory: 16340kb
input:
99983 83817 58795 99486 58795 99486 21058 4598 21058 4598 61620 11559 61620 11559 34661 78688 34661 78688 77815 68520 77815 68520 21591 16288 21591 16288 20346 36445 20346 36445 76817 27129 76817 27129 76177 31402 76177 31402 44392 5997 44392 5997 25117 81175 25117 81175 55373 62174 55373 62174 6204...
output:
4968724747
result:
ok single line: '4968724747'
Test #57:
score: 0
Time Limit Exceeded
input:
83160 90683 25845 47632 25845 47632 55730 52535 55730 52535 78252 71397 78252 71397 23041 36989 23041 36989 76643 31953 76643 31953 55555 13626 55555 13626 51598 76034 51598 76034 6152 49447 6152 49447 6383 46914 6383 46914 13306 1647 13306 1647 26282 55141 26282 55141 70184 34713 70184 34713 21879 ...
output:
result:
Subtask #6:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
0%