QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#515010 | #2270. LCM of GCDs | PlentyOfPenalty# | AC ✓ | 186ms | 28444kb | C++20 | 2.9kb | 2024-08-11 14:26:16 | 2024-08-11 14:26:17 |
Judging History
answer
#include <bits/stdc++.h>
#define sz(x) ((int)(x).size())
#define all(x) begin(x), end(x)
#define rep(i, l, r) for (int i = (l), i##end = (r); i <= i##end; ++i)
#define per(i, l, r) for (int i = (l), i##end = (r); i >= i##end; --i)
#ifdef memset0
#define log(...) fprintf(stderr, __VA_ARGS__)
#else
#define log(...) (void(0))
#define endl '\n'
#endif
using namespace std;
// using ll = long long;
// using lf = long double;
// using lll = __int128;
// using ull = unsigned long long;
using ll = __int128;
#define putc putchar
void write(ll x) {
if (x == 0) {
putc('0');
return;
}
if (x > 9) write(x / 10);
putc('0' + x % 10);
}
const int N = 1e5 + 9;
int n, m;
ll a[N];
string op;
ll GCD(ll a, ll b) {
if (!a) return b;
if (!b) return a;
return __gcd(a, b);
}
ll LCM(ll a, ll b) {
if (!a) return b;
if (!b) return a;
return a / GCD(a, b) * b;
}
struct atom {
ll v[3];
int len;
void set(ll x) {
v[0] = x, v[1] = v[2] = 0;
len = 1;
}
};
atom operator^(const atom &a, const atom &b) {
atom res;
res.v[0] = GCD(a.v[0], b.v[0]);
res.v[1] = LCM(GCD(a.v[0], b.v[1]), GCD(a.v[1], b.v[0]));
res.v[2] = GCD(a.v[1], b.v[1]);
if (a.len >= 2) res.v[2] = LCM(res.v[2], GCD(a.v[2], b.v[0]));
if (b.len >= 2) res.v[2] = LCM(res.v[2], GCD(a.v[0], b.v[2]));
res.len = a.len + b.len;
return res;
}
struct segment {
int l, r, mid;
atom x;
} p[N << 2];
void build(int u, int l, int r) {
p[u].l = l, p[u].r = r, p[u].mid = (l + r) >> 1;
if (l == r) {
p[u].x.set(a[l]);
// cerr << "! " << a[l] << endl;
// log("[%d %d] >> %lld %lld %lld\n", p[u].l, p[u].r, p[u].x[0], p[u].x[1], p[u].x[2]);
return;
}
build(u << 1, l, p[u].mid);
build(u << 1 | 1, p[u].mid + 1, r);
p[u].x = p[u << 1].x ^ p[u << 1 | 1].x;
// log("[%d %d] >> %lld %lld %lld\n", p[u].l, p[u].r, (long long)p[u].x[0], (long long)p[u].x[1], (long long)p[u].x[2]);
}
void modify(int u, int k) {
if (p[u].l == p[u].r) {
p[u].x.set(a[p[u].l]);
return;
}
if (k <= p[u].mid) {
modify(u << 1, k);
} else {
modify(u << 1 | 1, k);
}
p[u].x = p[u << 1].x ^ p[u << 1 | 1].x;
}
atom query(int u, int l, int r) {
if (p[u].l == l && p[u].r == r) {
return p[u].x;
}
if (r <= p[u].mid) return query(u << 1, l, r);
if (l > p[u].mid) return query(u << 1 | 1, l, r);
return query(u << 1, l, p[u].mid) ^ //
query(u << 1 | 1, p[u].mid + 1, r);
}
int main() {
#ifdef memset0
freopen("H.in", "r", stdin);
#endif
cin.tie(0)->sync_with_stdio(0);
cin >> n >> m;
for (int x, i = 1; i <= n; i++) {
cin >> x;
a[i] = x;
}
build(1, 1, n);
for (int l, r, k, x, i = 1; i <= m; i++) {
cin >> op;
if (op[0] == 'U') {
cin >> k >> x;
a[k] = x;
modify(1, k);
} else {
cin >> l >> r >> k;
auto it = query(1, l, r);
write(it.v[k]), putc('\n');
}
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3824kb
input:
5 10 12 10 16 28 15 Q 1 3 1 Q 3 4 0 Q 2 2 0 Q 2 5 2 U 3 21 Q 1 3 1 Q 2 4 1 Q 3 5 1 Q 4 4 0 Q 2 5 2
output:
4 4 10 20 6 14 21 28 210
result:
ok 9 lines
Test #2:
score: 0
Accepted
time: 1ms
memory: 5608kb
input:
20 10 12 15 17 13 18 11 17 9 13 13 8 9 6 18 2 20 6 8 10 16 Q 3 19 1 Q 4 15 2 Q 1 17 1 Q 13 14 0 Q 11 18 2 Q 1 16 2 Q 3 20 1 Q 5 20 1 Q 8 18 2 Q 13 15 1
output:
1 1 1 6 2 1 1 1 1 6
result:
ok 10 lines
Test #3:
score: 0
Accepted
time: 166ms
memory: 28240kb
input:
99417 100000 997410 720487 932768 115 128154 302401 999266 146789 236143 92360 396671 186303 387999 345639 669897 396857 935750 538939 846502 419289 313345 685374 524667 204499 443553 878316 229629 27394 534535 670619 914168 417399 457308 558816 430796 140419 939340 198147 778565 800925 716132 96848...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 100000 lines
Test #4:
score: 0
Accepted
time: 83ms
memory: 28180kb
input:
99436 100000 185124 25933 931751 549787 947945 435421 484859 420463 320609 330410 154462 204695 699021 619411 119978 299723 485286 266888 632881 621274 818412 529262 683180 134611 498674 513694 586930 184482 719917 785513 258557 854168 546331 494349 407400 846753 177025 79664 969851 505360 297086 65...
output:
1 2 1 1 1 1 3 1 56300 1 12384699284 1 1337543592 161063 1 2 3 448477444200 1 44550 1 2 1 3 1 1 1 1 1 1 1 2 1 1 1 2 299267391095190 1 1 307267 3 803685 1 5 1 1 2 3 3 2 1 287211 1 655508 1 1 1 2 20 3 1 2 1 1 580803 1 1 4 835458 2 1 353019 1 1 1 2 30817594836 1 575704 215909 1 1 1 809644 1 1 1 2 1 1 1 ...
result:
ok 100000 lines
Test #5:
score: 0
Accepted
time: 91ms
memory: 25916kb
input:
100000 100000 185124 25933 931751 549787 947945 435421 484859 420463 320609 330410 154462 204695 699021 619411 119978 299723 485286 266888 632881 621274 818412 529262 683180 134611 498674 513694 586930 184482 719917 785513 258557 854168 546331 494349 407400 846753 177025 79664 969851 505360 297086 6...
output:
2 2 1 2 1 3 1 1 728441 1 75032825160 1 62521619383862340 1 2 1 1 1 1 1 1 1 1 61512528819 1 125341410605929740 1 9 1 1 964890 1 2 74020 1 1 1 1 2 758166 1 1 1 1 858585 2666536944364800 1 340525 1 2 1 1 1 1 1 2 1 1 191665267830 503005 281993 45 3 2 17096779026 1 1 3 1 1 583882 1 1 1 1 1 1 1 1 1 1 7974...
result:
ok 100000 lines
Test #6:
score: 0
Accepted
time: 140ms
memory: 26008kb
input:
99772 100000 67522 810426 959176 794398 778802 983478 906982 988840 251298 912378 503494 597514 743684 917932 210788 629856 167446 484766 327640 762840 630602 310996 405312 427858 101598 68298 227192 8948 127810 811452 414984 812970 345514 105980 767572 810146 942472 555648 125578 515618 124202 9776...
output:
2 2 2 2 426 382 2 34 5882 2 2 2 2 2 2 2 479302 842 158 382 2 2 2 2 2 2 2 2 2 2 158 2 2 2 2 2 142 175222 1306 2 1574 2 2 2 554 2 2 6 2 2 2 2 2 13694 2 2 556154 2 64786 2 2 74 86 2 2 202 2 2 2 2 2 2 422338 2 479326 2 218 2 2 2 2 2 2 2 762946 2 197342 2 2 2 333182 2 762946 2 454042 93458 2 2 1354 2 2 4...
result:
ok 100000 lines
Test #7:
score: 0
Accepted
time: 126ms
memory: 26368kb
input:
99772 100000 799728 156672 461820 979236 278580 686628 736920 456348 738312 340620 47100 592356 891840 982524 929844 585996 695892 976536 798492 182172 566772 136008 86376 587796 535200 737472 409500 992256 648276 520632 432972 536376 664608 777468 658032 297624 254232 379464 537852 374196 842484 22...
output:
12 12 12 12 12 12 12 12 12 12 12 12 12 12 24204 12 12 12 3972 45516 12 12 12 12 12 12 12 12756 12 12 12 4596 1572 12 13116 12 12 12 12 13164 12 12 28092 12 12 12 12 38244 12 12 12 12 12 12 12 39612 4764 12 12 12 12 12 12 12 12 12 50628 12 15468 12 508812 12 12 12 12 12 12 12 17412 12 12 12 14172 12 ...
result:
ok 100000 lines
Test #8:
score: 0
Accepted
time: 137ms
memory: 25748kb
input:
99772 100000 67522 810426 959176 794398 778802 983478 906982 988840 251298 912378 503494 597514 743684 917932 210788 629856 167446 484766 327640 762840 630602 310996 405312 427858 101598 68298 227192 8948 127810 811452 414984 812970 345514 105980 767572 810146 942472 555648 125578 515618 124202 9776...
output:
2 2 2 2 426 382 2 34 5882 2 2 2 2 2 2 2 479302 842 158 382 2 2 2 2 2 2 2 2 2 2 158 2 2 2 2 2 142 175222 1306 2 1574 2 2 2 554 2 2 6 2 2 2 2 2 13694 2 2 556154 2 64786 2 2 74 86 2 2 202 2 2 2 2 2 2 422338 2 479326 2 218 2 2 2 2 2 2 2 762946 2 197342 2 2 2 333182 2 762946 2 454042 93458 2 2 1354 2 2 4...
result:
ok 100000 lines
Test #9:
score: 0
Accepted
time: 129ms
memory: 25740kb
input:
99772 100000 799728 156672 461820 979236 278580 686628 736920 456348 738312 340620 47100 592356 891840 982524 929844 585996 695892 976536 798492 182172 566772 136008 86376 587796 535200 737472 409500 992256 648276 520632 432972 536376 664608 777468 658032 297624 254232 379464 537852 374196 842484 22...
output:
12 12 12 12 12 12 12 12 12 12 12 12 12 12 24204 12 12 12 3972 45516 12 12 12 12 12 12 12 12756 12 12 12 4596 1572 12 13116 12 12 12 12 13164 12 12 28092 12 12 12 12 38244 12 12 12 12 12 12 12 39612 4764 12 12 12 12 12 12 12 12 12 50628 12 15468 12 508812 12 12 12 12 12 12 12 17412 12 12 12 14172 12 ...
result:
ok 100000 lines
Test #10:
score: 0
Accepted
time: 138ms
memory: 28180kb
input:
100000 100000 67522 810426 959176 794398 778802 983478 906982 988840 251298 912378 503494 597514 743684 917932 210788 629856 167446 484766 327640 762840 630602 310996 405312 427858 101598 68298 227192 8948 127810 811452 414984 812970 345514 105980 767572 810146 942472 555648 125578 515618 124202 977...
output:
218 2 2 2 2 2 2 2 762946 2 197342 2 2 2 333182 2 762946 2 454042 93458 2 2 1354 2 2 4354 2 2 2558 2 1574 2 526 1018 2 226 2 2 2 118 2 2 2 2 2 2 2 2 2 626 153946 2 93458 2 2 794 11546 2 158 2 1322 118 2 2 2 2 982 122 2 158 2 146294 502 2 2 2 838 22618 2 1018 2 2 2 2 53926 2 2 458 2 2 2 2 2 2 2 2 2 85...
result:
ok 100000 lines
Test #11:
score: 0
Accepted
time: 186ms
memory: 28236kb
input:
99417 100000 997410 720487 932768 115 128154 302401 999266 146789 236143 92360 396671 186303 387999 345639 669897 396857 935750 538939 846502 419289 313345 685374 524667 204499 443553 878316 229629 27394 534535 670619 914168 417399 457308 558816 430796 140419 939340 198147 778565 800925 716132 96848...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 49799 lines
Test #12:
score: 0
Accepted
time: 149ms
memory: 28148kb
input:
99436 100000 185124 25933 931751 549787 947945 435421 484859 420463 320609 330410 154462 204695 699021 619411 119978 299723 485286 266888 632881 621274 818412 529262 683180 134611 498674 513694 586930 184482 719917 785513 258557 854168 546331 494349 407400 846753 177025 79664 969851 505360 297086 65...
output:
6 258 12384699284 344018 1 44550 13848458974641174 1 1 1 4572790943490 299267391095190 6 8636785118672876 2 34 1 1 2 1 1 544978 853362 1 1 1 1 1 4 1 513598 332181952920 1 903676 12 13914317985 1 502144 1 1 1 1 1 2 120148896790 890966 2044698528 816600 2 147307 500355991408 1 1 1 1 453027 5866 2 3719...
result:
ok 50057 lines
Test #13:
score: 0
Accepted
time: 153ms
memory: 28176kb
input:
100000 100000 185124 25933 931751 549787 947945 435421 484859 420463 320609 330410 154462 204695 699021 619411 119978 299723 485286 266888 632881 621274 818412 529262 683180 134611 498674 513694 586930 184482 719917 785513 258557 854168 546331 494349 407400 846753 177025 79664 969851 505360 297086 6...
output:
785467 573087 1 1 1 62521619383862340 514727 1 1 3 1 9 2 65 2 3 11235114372 1 1 1 340525 650875 120364 1 110908477869339818 1 2 1 1 3 1 62 1 1 1 1 2 1 351012042060 101201 8 2 59212 1 12 2 1 4 2 1 410187570878 573546 4 1 749198 1 1 1 1 1 173112341009520 2 1 529205718520040784 2 1 173566 984723 1 1 1 ...
result:
ok 50064 lines
Test #14:
score: 0
Accepted
time: 169ms
memory: 25732kb
input:
99772 100000 67522 810426 959176 794398 778802 983478 906982 988840 251298 912378 503494 597514 743684 917932 210788 629856 167446 484766 327640 762840 630602 310996 405312 427858 101598 68298 227192 8948 127810 811452 414984 812970 345514 105980 767572 810146 942472 555648 125578 515618 124202 9776...
output:
2 2 2 2 2 158 2 2 2 2 2 2 2 74 2 2 2 2 2 2 2 2 2 2 2 401266 2 746 2 218 326 1 1 166 2 2 14 2 2 2 22 2 122 2 2 2 158 2 1094 2 2 32482 394 626 2 2 1 994078 1286 2 2 2 2 2 2 2 2 2 2 2 194 2 2 1 1 2 2 1154 2 1 2234 866 778 2 866 2 2 662 2 2 1 554 1 2 2 2 2 1 2 1 1 1 746 2 2 2 2 1 2 580462 2 2 687998 758...
result:
ok 49936 lines
Test #15:
score: 0
Accepted
time: 166ms
memory: 28244kb
input:
99772 100000 799728 156672 461820 979236 278580 686628 736920 456348 738312 340620 47100 592356 891840 982524 929844 585996 695892 976536 798492 182172 566772 136008 86376 587796 535200 737472 409500 992256 648276 520632 432972 536376 664608 777468 658032 297624 254232 379464 537852 374196 842484 22...
output:
28572 12 12 12 12 12 12 12 12 12 2724 12 12 12 12 12 45852 12 12 12 12 12 12 12 12 3396 4 12 12 50628 12 12 12 12 12 12 12 12 3156 12 14052 12 12 12 94596 12 12 12 12 12 12 12 5196 12 12 12 12 8868 12 12 12 12 12 12 12 12 12 31404 12 12 11796 12 12 12 276996 12 5484 12 12 12 12 12 12 12 12 12 12 12 ...
result:
ok 50076 lines
Test #16:
score: 0
Accepted
time: 178ms
memory: 28244kb
input:
99772 100000 67522 810426 959176 794398 778802 983478 906982 988840 251298 912378 503494 597514 743684 917932 210788 629856 167446 484766 327640 762840 630602 310996 405312 427858 101598 68298 227192 8948 127810 811452 414984 812970 345514 105980 767572 810146 942472 555648 125578 515618 124202 9776...
output:
2 2 2 2 2 158 2 2 2 2 2 2 2 74 2 2 2 2 2 2 2 2 2 2 2 401266 2 746 2 218 326 1 1 166 2 2 14 2 2 2 22 2 122 2 2 2 158 2 1094 2 2 32482 394 626 2 2 1 994078 1286 2 2 2 2 2 2 2 2 2 2 2 194 2 2 1 1 2 2 1154 2 1 2234 866 778 2 866 2 2 662 2 2 1 554 1 2 2 2 2 1 2 1 1 1 746 2 2 2 2 1 2 580462 2 2 687998 758...
result:
ok 49936 lines
Test #17:
score: 0
Accepted
time: 173ms
memory: 28444kb
input:
99772 100000 799728 156672 461820 979236 278580 686628 736920 456348 738312 340620 47100 592356 891840 982524 929844 585996 695892 976536 798492 182172 566772 136008 86376 587796 535200 737472 409500 992256 648276 520632 432972 536376 664608 777468 658032 297624 254232 379464 537852 374196 842484 22...
output:
28572 12 12 12 12 12 12 12 12 12 2724 12 12 12 12 12 45852 12 12 12 12 12 12 12 12 3396 4 12 12 50628 12 12 12 12 12 12 12 12 3156 12 14052 12 12 12 94596 12 12 12 12 12 12 12 5196 12 12 12 12 8868 12 12 12 12 12 12 12 12 12 31404 12 12 11796 12 12 12 276996 12 5484 12 12 12 12 12 12 12 12 12 12 12 ...
result:
ok 50076 lines
Test #18:
score: 0
Accepted
time: 170ms
memory: 25864kb
input:
100000 100000 67522 810426 959176 794398 778802 983478 906982 988840 251298 912378 503494 597514 743684 917932 210788 629856 167446 484766 327640 762840 630602 310996 405312 427858 101598 68298 227192 8948 127810 811452 414984 812970 345514 105980 767572 810146 942472 555648 125578 515618 124202 977...
output:
2 2 2 166 2 2 14 2 2 2 22 2 122 2 2 2 158 2 1094 2 2 32482 394 626 2 2 2 994078 1286 2 2 2 2 2 2 2 2 2 2 118 194 2 2 2 2 2 2 1154 2 1 64786 866 778 2 866 2 2 662 2 2 2 554 2 2 1202 2 2 2 2 1 82 2 746 2 2 2 538 1 2 580462 2 2 687998 758 2 2 1 34946 1 756526 2 123542 2 718 2 2 2 2 2 6 2 2 3398 599798 ...
result:
ok 49940 lines
Test #19:
score: 0
Accepted
time: 167ms
memory: 28404kb
input:
99772 100000 67522 810426 959176 794398 778802 983478 906982 988840 251298 912378 503494 597514 743684 917932 210788 629856 167446 484766 327640 762840 630602 310996 405312 427858 101598 68298 227192 8948 127810 811452 414984 812970 345514 105980 767572 810146 942472 555648 125578 515618 124202 9776...
output:
2 2 2 2 2 158 2 2 2 2 2 2 2 74 1306 2 2 2 2 2 2 2 2 2 2 401266 2 746 2 218 326 82 2 166 2 2 14 2 2 2 22 2 122 2 2 2 158 2 1094 2 2 32482 394 626 2 2 2 994078 1286 2 2 2 2 2 2 2 2 2 2 118 194 2 2 2 2 2 2 1154 2 2 64786 866 778 2 866 2 2 662 2 2 2 554 2 2 2 626 2 2 2 2 82 2 746 2 922 2 538 2 2 580462 ...
result:
ok 49928 lines
Test #20:
score: 0
Accepted
time: 149ms
memory: 28120kb
input:
99772 100000 799728 156672 461820 979236 278580 686628 736920 456348 738312 340620 47100 592356 891840 982524 929844 585996 695892 976536 798492 182172 566772 136008 86376 587796 535200 737472 409500 992256 648276 520632 432972 536376 664608 777468 658032 297624 254232 379464 537852 374196 842484 22...
output:
28572 12 12 12 12 12 12 12 12 12 2724 12 12 12 12 12 45852 12 12 12 12 12 12 12 12 3396 12 12 12 50628 12 12 12 12 12 12 12 12 3156 12 14052 12 12 12 94596 12 12 12 12 12 12 12 5196 12 12 12 12 8868 12 12 12 12 12 12 12 12 12 31404 12 12 11796 12 12 12 276996 12 5484 12 12 12 12 12 12 12 12 12 12 12...
result:
ok 50082 lines
Test #21:
score: 0
Accepted
time: 161ms
memory: 28252kb
input:
99772 100000 67522 810426 959176 794398 778802 983478 906982 988840 251298 912378 503494 597514 743684 917932 210788 629856 167446 484766 327640 762840 630602 310996 405312 427858 101598 68298 227192 8948 127810 811452 414984 812970 345514 105980 767572 810146 942472 555648 125578 515618 124202 9776...
output:
2 2 2 2 2 158 2 2 2 2 2 2 2 74 1306 2 2 2 2 2 2 2 2 2 2 401266 2 746 2 218 326 82 2 166 2 2 14 2 2 2 22 2 122 2 2 2 158 2 1094 2 2 32482 394 626 2 2 2 994078 1286 2 2 2 2 2 2 2 2 2 2 118 194 2 2 2 2 2 2 1154 2 2 64786 866 778 2 866 2 2 662 2 2 2 554 2 2 2 626 2 2 2 2 82 2 746 2 922 2 538 2 2 580462 ...
result:
ok 49928 lines
Test #22:
score: 0
Accepted
time: 160ms
memory: 28180kb
input:
99772 100000 799728 156672 461820 979236 278580 686628 736920 456348 738312 340620 47100 592356 891840 982524 929844 585996 695892 976536 798492 182172 566772 136008 86376 587796 535200 737472 409500 992256 648276 520632 432972 536376 664608 777468 658032 297624 254232 379464 537852 374196 842484 22...
output:
28572 12 12 12 12 12 12 12 12 12 2724 12 12 12 12 12 45852 12 12 12 12 12 12 12 12 3396 12 12 12 50628 12 12 12 12 12 12 12 12 3156 12 14052 12 12 12 94596 12 12 12 12 12 12 12 5196 12 12 12 12 8868 12 12 12 12 12 12 12 12 12 31404 12 12 11796 12 12 12 276996 12 5484 12 12 12 12 12 12 12 12 12 12 12...
result:
ok 50082 lines
Test #23:
score: 0
Accepted
time: 174ms
memory: 28404kb
input:
100000 100000 67522 810426 959176 794398 778802 983478 906982 988840 251298 912378 503494 597514 743684 917932 210788 629856 167446 484766 327640 762840 630602 310996 405312 427858 101598 68298 227192 8948 127810 811452 414984 812970 345514 105980 767572 810146 942472 555648 125578 515618 124202 977...
output:
2 2 2 166 2 2 14 2 2 2 22 2 122 2 2 2 158 2 1094 2 2 32482 394 626 2 2 2 994078 1286 2 2 2 2 2 2 2 2 2 2 118 194 2 2 2 2 2 2 1154 2 2 64786 866 778 2 866 2 2 662 2 2 2 554 2 2 1202 626 2 2 2 2 82 2 746 2 922 2 538 2 2 580462 2 2 687998 758 2 146 2 34946 2 756526 2 123542 2 718 2 2 2 2 2 6 2 2 3398 5...
result:
ok 49932 lines
Test #24:
score: 0
Accepted
time: 183ms
memory: 28184kb
input:
99772 100000 67522 810426 959176 794398 778802 983478 906982 988840 251298 912378 503494 597514 743684 917932 210788 629856 167446 484766 327640 762840 630602 310996 405312 427858 101598 68298 227192 8948 127810 811452 414984 812970 345514 105980 767572 810146 942472 555648 125578 515618 124202 9776...
output:
2 34 2 643718 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1306 2 2 2 1 2 2 2 1 2 746 2 2 2 2 2 2 166 2 458 2 2 2 22 2 122 2 2 2 226 13462 2 2 2 2 46 1 2 2 2 554 2 794 2 1018 2 2 118 458 2 2 1762 2 5744 2 2 2 2 866 2026 2 2 866 2 2 662 2 2 1 2 2 1642 2 1 2 2 450962 11842 698 2 28542 2 2 283282 326 825262 2 2 2 2...
result:
ok 49730 lines
Test #25:
score: 0
Accepted
time: 179ms
memory: 28212kb
input:
99772 100000 799728 156672 461820 979236 278580 686628 736920 456348 738312 340620 47100 592356 891840 982524 929844 585996 695892 976536 798492 182172 566772 136008 86376 587796 535200 737472 409500 992256 648276 520632 432972 536376 664608 777468 658032 297624 254232 379464 537852 374196 842484 22...
output:
12 5172 12 12 12 12 45516 12 12 2388 24 4596 12 45852 12 12 12 12 38244 12 39612 12 12 12 12 12 25332 17124 12 12 12 12 1788 12 12 14052 12 12 12 20652 12 12 945960 12 12 5196 12 12 12 12 17868 12 12 12 12 12 12 12 12 12 31404 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 353172 40116 12 12 ...
result:
ok 50113 lines
Test #26:
score: 0
Accepted
time: 182ms
memory: 28444kb
input:
99772 100000 67522 810426 959176 794398 778802 983478 906982 988840 251298 912378 503494 597514 743684 917932 210788 629856 167446 484766 327640 762840 630602 310996 405312 427858 101598 68298 227192 8948 127810 811452 414984 812970 345514 105980 767572 810146 942472 555648 125578 515618 124202 9776...
output:
2 34 2 643718 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1306 2 2 2 1 2 2 2 1 2 746 2 2 2 2 2 2 166 2 458 2 2 2 22 2 122 2 2 2 226 13462 2 2 2 2 46 1 2 2 2 554 2 794 2 1018 2 2 118 458 2 2 1762 2 5744 2 2 2 2 866 2026 2 2 866 2 2 662 2 2 1 2 2 1642 2 1 2 2 450962 11842 698 2 28542 2 2 283282 326 825262 2 2 2 2...
result:
ok 49730 lines
Test #27:
score: 0
Accepted
time: 161ms
memory: 28404kb
input:
99772 100000 799728 156672 461820 979236 278580 686628 736920 456348 738312 340620 47100 592356 891840 982524 929844 585996 695892 976536 798492 182172 566772 136008 86376 587796 535200 737472 409500 992256 648276 520632 432972 536376 664608 777468 658032 297624 254232 379464 537852 374196 842484 22...
output:
12 5172 12 12 12 12 45516 12 12 2388 24 4596 12 45852 12 12 12 12 38244 12 39612 12 12 12 12 12 25332 17124 12 12 12 12 1788 12 12 14052 12 12 12 20652 12 12 945960 12 12 5196 12 12 12 12 17868 12 12 12 12 12 12 12 12 12 31404 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 353172 40116 12 12 ...
result:
ok 50113 lines
Test #28:
score: 0
Accepted
time: 149ms
memory: 25980kb
input:
100000 100000 67522 810426 959176 794398 778802 983478 906982 988840 251298 912378 503494 597514 743684 917932 210788 629856 167446 484766 327640 762840 630602 310996 405312 427858 101598 68298 227192 8948 127810 811452 414984 812970 345514 105980 767572 810146 942472 555648 125578 515618 124202 977...
output:
2 2 2 2 2 166 2 458 2 2 2 22 2 122 2 2 2 226 13462 2 2 2 2 46 2 2 2 2 554 2 794 2 1018 2 2 118 458 2 2 1762 2 1436 2 2 2 2 866 2026 2 2 866 2 2 662 2 2 2 2 2 1642 2 1 2 2 450962 11842 698 2 28542 2 2 283282 326 825262 2 2 2 2 1844 2 2 1 2 2 2 2 6 2 2 2 1838 2 1286 1354 2 2 2 2 1 1 2 1 93458 1 2 2 2 ...
result:
ok 49705 lines