QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#286769 | #1789. 密码箱 | james1BadCreeper | 100 ✓ | 478ms | 26756kb | C++14 | 3.3kb | 2023-12-18 16:22:18 | 2023-12-18 16:22:18 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int P = 998244353;
const int N = 200050;
int n, q;
char arr[100005];
mt19937 Rand(time(0));
struct Matrix {
int a00, a01, a10, a11;
friend Matrix operator*(const Matrix &a, const Matrix &b) {
Matrix c;
c.a00 = (1ll * a.a00 * b.a00 + 1ll * a.a01 * b.a10) % P;
c.a01 = (1ll * a.a00 * b.a01 + 1ll * a.a01 * b.a11) % P;
c.a10 = (1ll * a.a10 * b.a00 + 1ll * a.a11 * b.a10) % P;
c.a11 = (1ll * a.a10 * b.a01 + 1ll * a.a11 * b.a11) % P;
return c;
}
} v[N], fl[N], rv[N], frv[N], I[N], fI[N], a, b, base;
int sz[N], ls[N], rs[N], dt[N], tot, rt, tf[N], tr[N];
inline int newNode(int k) {
int o = ++tot; sz[o] = 1, dt[o] = Rand();
if (k == 0) v[o] = rv[o] = I[o] = a, fl[o] = frv[o] = fI[o] = b;
else v[o] = rv[o] = I[o] = b, fl[o] = frv[o] = fI[o] = a;
return o;
}
inline void pushup(int o) {
if (!o) return;
sz[o] = sz[ls[o]] + sz[rs[o]] + 1;
v[o] = v[ls[o]] * I[o] * v[rs[o]];
fl[o] = fl[ls[o]] * fI[o] * fl[rs[o]];
rv[o] = rv[rs[o]] * I[o] * rv[ls[o]];
frv[o] = frv[rs[o]] * fI[o] * frv[ls[o]];
}
inline void addf(int o) {
if (!o) return;
swap(v[o], fl[o]); swap(rv[o], frv[o]); swap(I[o], fI[o]);
tf[o] ^= 1;
}
inline void addr(int o) {
if (!o) return;
swap(v[o], rv[o]); swap(fl[o], frv[o]); swap(ls[o], rs[o]);
tr[o] ^= 1;
}
inline void pushdown(int o) {
if (!o) return;
if (tf[o]) addf(ls[o]), addf(rs[o]), tf[o] = 0;
if (tr[o]) addr(ls[o]), addr(rs[o]), tr[o] = 0;
}
int merge(int x, int y) {
if (!x || !y) return x + y;
if (dt[x] < dt[y]) return pushdown(x), rs[x] = merge(rs[x], y), pushup(x), x;
return pushdown(y), ls[y] = merge(x, ls[y]), pushup(y), y;
}
void split(int o, int S, int &x, int &y) {
if (!o) return x = y = 0, void(); pushdown(o);
if (sz[ls[o]] + 1 <= S) x = o, split(rs[o], S - sz[ls[o]] - 1, rs[o], y);
else y = o, split(ls[o], S, x, ls[o]);
pushup(o);
}
int build(int l, int r) {
if (l == r) return newNode(arr[l] == 'W' ? 0 : 1);
int mid = l + r >> 1; return merge(build(l, mid), build(mid + 1, r));
}
int main(void) {
a.a00 = a.a01 = a.a11 = 1, a.a10 = 0;
b.a00 = 0, b.a01 = P - 1, b.a10 = 1, b.a11 = 2;
// 初始化单位矩阵
base.a00 = base.a11 = 1, base.a10 = base.a01 = 0;
v[0] = fl[0] = rv[0] = frv[0] = I[0] = fI[0] = base;
base.a00 = base.a01 = base.a11 = 1, base.a10 = 0;
ios::sync_with_stdio(0); cin.tie(0);
cin >> n >> q >> arr + 1;
rt = build(1, n);
auto ans = base * v[rt];
cout << ans.a11 << " " << ans.a01 << "\n";
char op[10]; int l, r, x, y, z;
while (q--) {
cin >> op;
if (op[0] == 'A') {
cin >> op;
rt = merge(rt, newNode(op[0] == 'W' ? 0 : 1));
} else if (op[0] == 'F') {
cin >> l >> r; split(rt, r, y, z); split(y, l - 1, x, y);
addf(y); rt = merge(merge(x, y), z);
} else {
cin >> l >> r; split(rt, r, y, z); split(y, l - 1, x, y);
addr(y); rt = merge(merge(x, y), z);
}
auto ans = base * v[rt];
cout << ans.a11 << " " << ans.a01 << "\n";
}
return 0;
}
詳細信息
Test #1:
score: 5
Accepted
time: 3ms
memory: 16152kb
input:
2000 2000 EEWEEWEEWEEEEEEEEEEEWEWWEWEWEWWEWWEEWWWWWEEWWWWEEEWWEEEEEEWEEWWWEWEEWWWEWWWEEEEEWEEWEEEEEWEWWWWEWEWWEWWWEWWEEWEWEWEEWEEEWEEEEEWWWWWEEWEEWWWWEWEEWWEWEWEWWWWEWEWEEWWWWWWEWWEWEWEWEWWWWWEWWEEEEWWEWEEWEEEWWEWWEEEWEWWEEEEEWEWEWWEWWEEWWWWEWWWEEWEWEWWEWWWWEEWWEEWEEWWWWEWWWWWEWEWWEWWWEWEWEWEWEEWEWW...
output:
236914576 427170560 455958030 792307171 350099908 643944131 30094991 244492279 664330683 672034650 196986454 826231782 811869946 57281060 428509085 286574691 242134678 343855751 575517458 916720058 924999075 813960063 502272180 732435768 429026902 548151478 117159291 713634437 994387081 908426498 11...
result:
ok 2001 lines
Test #2:
score: 5
Accepted
time: 3ms
memory: 16168kb
input:
2000 2000 EEEWEEWEWEEEEWWWWWWEWEEWEEWWWEEEEEWWWEWEWEWEEEWWWEEWWEEWWWWEWWWEEWEEWWWEEEEWEWWWWEWEEEWWEEEWWEWEEEWWEEEWEEWWEEEEEEWWWWWWWWWEEWWWEWWEEEEEEEEWEWWWEWEEEEWEEEEWEWWWWEEEEWEEEEWWEEEWWEWWEEEEEEEWWWWEWEEWEEWEEEWWWWWEEEEEEWEWEWWEWWEWWEWEWWWWWWWEWWEWWEEEWEWWWWEWWWEWWEEWWEEWWWWWWEWWWWWEEEWEWEEEWWWWEW...
output:
6463648 45329706 704854091 442597320 611518326 829511419 169746550 712178861 343598285 645073706 51850478 881313322 758347024 119308585 810197502 2377554 8347627 717938203 387334078 730560576 513033985 905117933 941437898 150747949 655470247 523903222 598663792 674651171 441573667 488014808 5663047 ...
result:
ok 2001 lines
Test #3:
score: 5
Accepted
time: 8ms
memory: 20092kb
input:
2000 2000 WEWWWWWWEWEWEEWWEEEWWWEWEEEWWEWWWWWWWEEWWEWEWEEEWEEEEEEEEWEEEWEWWEWEWEWWEEEEEWWEWWWEWWEWEWWEEWEEEWWEWEWWWEWEEWWWWEEEWEWEEWWWEEWEEEEEEWWWWWEEEWWWEWEWEWEEEWWEWWEWWWWWEWEEEWWWWEEEEWEEEWEWEWWEWWEWEEWEEEWWWEEWWWEEWEWEWEWEWEEWEWEEWWWWEEEWWEWEEWEWWEEWWWWWEWWEWEWEWWWEEEEEEEEEEEWEEEEWEEWEEWWWWEEWWW...
output:
370118869 68690813 515226007 364567815 321309070 771226105 836535077 137549567 825557266 592676526 586020561 400876265 546172140 667508517 949881892 410393758 495806013 112686580 847194282 623388482 564480425 383951352 758536622 22187248 134492891 653514182 237878375 947202223 528832941 884621310 44...
result:
ok 2001 lines
Test #4:
score: 5
Accepted
time: 3ms
memory: 18204kb
input:
2000 2000 WWWEWEWWEEEEWEEWEEWEWWWEWEWEWWWWEEWWWWWEWWEEWWWEEWWEWEWWWEWEEEWWWWWWEWWWEWEWWEEWWEWEEEEEEWWEEWWEEEEEEWWEEWEEEWEWWEEWWEEEWWWWEEEWWEEEWEWEEEWWEEEWWEEEWWWWWWEEEWEEWWEEEEWWEWWEEEEEEWWWEWWEEWEWWWEEEEWWEEEWEWEEEEWEWWWWWEWWWEEWEWEWWWWEWEEWWWEEWWEWEWEWWEEWEEEEWWWEWWEWEEWEEEEEEWEEEWEEEEWWWWEEEEWWWW...
output:
235402133 46717372 503780338 308308218 772158543 569899064 502357027 124712409 981342842 751949499 485455516 876661908 646460084 249933867 888347395 995462419 474758271 420262950 364861313 417481016 254964355 414699082 267901582 760666130 302820744 702265551 337739906 643864972 640560650 347886170 1...
result:
ok 2001 lines
Test #5:
score: 5
Accepted
time: 95ms
memory: 25652kb
input:
100000 100000 WEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWE...
output:
56136314 66655788 66655788 122792102 122792102 189447890 189447890 312239992 312239992 501687882 501687882 813927874 813927874 317371403 317371403 133054924 133054924 450426327 450426327 583481251 583481251 35663225 35663225 619144476 619144476 654807701 654807701 275707824 275707824 930515525 93051...
result:
ok 100001 lines
Test #6:
score: 5
Accepted
time: 169ms
memory: 26244kb
input:
100000 100000 WEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWE...
output:
56136314 66655788 56136314 66655788 66655788 56136314 122792102 66655788 66655788 122792102 66655788 122792102 122792102 189447890 189447890 122792102 122792102 189447890 189447890 122792102 122792102 189447890 189447890 312239992 312239992 501687882 501687882 813927874 813927874 317371403 317371403...
result:
ok 100001 lines
Test #7:
score: 5
Accepted
time: 138ms
memory: 26488kb
input:
100000 100000 WEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWEWE...
output:
56136314 66655788 66655788 122792102 122792102 189447890 189447890 312239992 312239992 501687882 501687882 813927874 813927874 501687882 317371403 813927874 133054924 317371403 450426327 133054924 583481251 450426327 35663225 583481251 619144476 35663225 654807701 619144476 275707824 654807701 93051...
result:
ok 100001 lines
Test #8:
score: 5
Accepted
time: 93ms
memory: 25604kb
input:
100000 100000 EEWWWWWEWEEWEEEWWEEEEEEWEWWEWEWEWWEWEEEWWWEWEWWEWEEEWWEEEWWWEWWEWEEEEEEEWWEWEWEEEWEEWEWWEWWWWEWWWEEEWEWWWWEWEWWEWEWEEWWWEEEEEWEWEWEEEEEWWWWEWEWWEWWEEEWWEEEEEEWEEWWWEWEWWWEWWWEWWWEEWWWWWEWEEWEWWEWWEWWEEWEWWWWEEEEWEEEWEWWEWEEEEWEWWWEWWEEWEWEWWWWWEWWWWEWEEWEWWEWWWEEEWWWEWEWEEWWEEEWEEWEWEE...
output:
463893689 482207361 133609903 435326164 597503592 917533525 63152928 401496533 660656520 320785705 723809448 722282238 786962376 125534418 512527471 847816656 238092566 571854541 750620037 421426844 264903155 270999147 777430626 120571450 44089428 391570597 821520054 512142047 865609482 903712644 90...
result:
ok 100001 lines
Test #9:
score: 5
Accepted
time: 96ms
memory: 25808kb
input:
100000 100000 EEEWWEEWEEWEWEEEWWWEWWWWEEEWWEEEEWWEWWWEEEWWEEWEEEEWWWEEWEWEEWEWEWEEEWEEEEEEEWWWWWEWWEEWEEWWEWEEEWWEWEEWEEEWEWWEEEWWWEWEEWWWWEWWEEWEEEEEWWWEEEWEWWWEWWWWEWWEWWWWWEWWWWWWEWEEWWEEWWWEWEEWEEWWEWEEEWWWWWWWWEWWWWWWWEWEWEWWEEEWEWWEWEWWWEWWEEWEEWEEEWEWEWWWEEWWEEEWWEEWEEWWWWEWWEWWWEWWWWWEEEWEEW...
output:
232304001 75907756 992889884 318082491 755231414 560257226 517572944 802431961 279914474 46362343 42256004 288537078 802841887 530711813 565183417 772886548 369780951 305354008 174378485 836065821 977220372 368533281 153354504 206354749 132330523 574888030 285685027 781242779 418015550 357886456 703...
result:
ok 100001 lines
Test #10:
score: 5
Accepted
time: 88ms
memory: 25656kb
input:
100000 100000 WWWEEWEWWWWEWEEEWWEWWEWWWEWEEEEEEWWEEWWWEWEWEEWEEEEEEWEWEEWWWWEWEEEWWWEEWEEEWWEWEWWEWEEWEEWEWWWEWWEWWEWEEWEWEWEEEWEWEWWEWEEEWEWWWEWEWEWWWWEWEWEWWEWWEEEEEWWWEEEEEWEEEEWWEWWWEWWWWWEWWWWWEWWEWWEWEEWEWEEEWEWWWEEEWWWWWWWEEWEWEWEWEWEWEEWWEEEWWWEEWEWEWWWEWEWWEWWEWEEWEEWWEEWWWEEWWWEWEWWWEWEWWW...
output:
420945641 765038584 287391171 892432660 708336812 659226891 131038100 426021122 551983741 192815353 972929382 957853937 395630670 724648168 816576311 491442399 239277599 258236630 660223240 25030861 82924528 790069445 503870169 556863676 586794697 348688768 92420513 905552444 596290682 464171767 101...
result:
ok 100001 lines
Test #11:
score: 5
Accepted
time: 398ms
memory: 25008kb
input:
100000 100000 WWEEWWWWEEEWWEEWEWWEWEWWEWWEEWWWWEEWEWWEWWEEEWEEEWEWEWWEEEWEWWWEEWEWWWWWWEWWWEWEEEEWWWEEEWEWEWEEWEEEWWWEEEEEWWWEEWWEEWEEWWEWWEEEWEEWWEEWEWWWEWWEEWWEWEWEWWEWWEWWEEEEEEEWWEEWWWEEEWWWWWEEEWWWEWWEEWWEWEWWEEEWEEEEWEWWWEWWEEWEEEEWWEWWEWEEEWEWWWEWWEEWEWWEWWWEWWEWEWWWEWWWEWEWWEWEEEEEWEWEWWWEEW...
output:
875658802 592573622 107467049 537320672 983125851 131649941 92348547 668970613 304992929 22580220 559774284 403514842 814555639 784449464 745131376 570323730 76161451 265915172 988783466 614488749 445885014 266051968 683038847 804863814 901299930 71907187 121316660 337194913 412222592 282172690 6601...
result:
ok 100001 lines
Test #12:
score: 5
Accepted
time: 339ms
memory: 25724kb
input:
100000 100000 WEEEEWWEWEWEWWEEEWWEWEWWWWEWWEEEEWEEEEWEWWWEEEWWWWWEWWWWWWWEWWEEEEWWEEEWEEWEWEEEWWEWEWWEEWEWEEWWEEEEEEEEEEWWWWEWWWWEWWWEEWEEWWWEEEEEEEWEEEWWEWEWWWEWWEEEEWEEWEEWEEEWEEWWWWWWEEEEWEEEEEWEEWEWEEEEEWEWEWEEEWEWEEEEEWEEWEEWEEWEWWEEWEWEEEEEWWEEWEWEEWEEWEWEEWEEEWEEWEWEWWWWWWWWEWEEEEWEEEWEWWEEEW...
output:
203120597 308678726 255563317 282006166 475552576 555331995 228855531 399184286 980402839 243036577 211014017 642220863 439869548 43160796 501804704 568830215 549345256 811098753 52905607 381684615 554710311 950514830 496199602 953313351 375124157 898145865 871323759 853214863 369279008 808283861 86...
result:
ok 100001 lines
Test #13:
score: 5
Accepted
time: 284ms
memory: 25496kb
input:
100000 100000 EEWWWEWWEWEWEEWWWEEWEWWWWEWWWEEWEEWEWEEWWEWWEEEWEWEEWWWEEWWEEWWEEWEEWEEEEWEWWEWEEEWWEEEWEWWEWEEEEEEEEWWWEWEEEEWEEWEWWEWWEWWWWWEWEEWWEWWEWWWWEWWEEEWWWWWWWWWWEEEEWEWWEEEWWEWEWWEEWWWEWEWWEWWWEWEEWEWWEEWWEWEEWEWEEWEWEWWWWWWWWWWEEEWWWEWWEWWEWWEWWEWWWWEEEWWWEWEEEWWEWWWEEWEEEWEWWEWWWEEWEWWWWW...
output:
294324420 215062545 103351065 218239685 333063998 865775288 569553370 221191733 541326116 319271962 790691710 937383211 41812951 557250107 832504661 496388965 232294174 690789064 374340065 892714169 606634239 585258880 838928413 277803591 717305657 500994916 105458468 697918283 822764125 200668846 7...
result:
ok 100001 lines
Test #14:
score: 5
Accepted
time: 240ms
memory: 25872kb
input:
100000 100000 EEWEEWEEEEWWEEWEEEWWEEEEWEEEEEEEWEWWEWWEEEEEEEEWWEEEWEWWWEEEWWEEWWEWEWEEWWWWWWEWEEEWEEEWWEWWWEWEWEWWEEEEEWWWWWEEEWEWEEEEEWWWWWEEEEEWEWWEWWWWWWWWEWEEWEWWEWEWWWWEWEWEWEWWEWEEWWEWEEEWWEWWWWEEEWWEWWEEWWEEEEEEWEEWEEWWWEWWWWEEWWEWWEWEEWWWEWWEEEWEEWWWWEEEEWWEEEWEWWWEWEEWWWEWWEWWEEWEWEEEWWEWWE...
output:
543150472 525576930 902631523 806216968 155976689 583695289 604370339 889096926 54519636 196254210 502913286 501655847 538920249 318554933 910756307 199344037 451432203 517898970 990352452 836453903 531028348 156764483 523136447 993218386 55920442 151738516 586948790 308502999 119732785 465267482 70...
result:
ok 100001 lines
Test #15:
score: 5
Accepted
time: 412ms
memory: 25952kb
input:
100000 100000 WWEEWWWWWEWWWWEEWWEWWEEEEWEWEEWWEEWEWWEEEWWEWWWWWWEEWEEWWEEWWEWEEWWEWWWWWEWEWWEEWEWEWEEWWEEWEEEEEWEEEWWEWWWWWWEEWEEEWWWWEEWEWWEEWEEEEWEWWWWWWWWEWWWEEWWWWEEEEEWEEWEEWEEWEEEEWEWEEWWWEEEWEEEEEEEEEWWWWEEWWWWEWWEWEWEWEEEWEEEEEEEEEWEWWWWWWWWEEWWWEWWEWWWEEWEWWWWEEEEWWWWEEEEEWEWEEWEEEWWEWWWEWE...
output:
738394504 196899806 628252315 480934203 708007509 473282308 338015471 954216511 47778627 429254466 755786136 902536774 813468733 871496311 465034254 401763956 116599775 930275954 604622887 807050782 984730644 730083742 312659278 737561376 917667427 723466314 981557837 538301601 172780314 609494287 8...
result:
ok 100001 lines
Test #16:
score: 5
Accepted
time: 351ms
memory: 26184kb
input:
100000 100000 WEWEEWEEEEEWWWEWEWWWWWWEEEWWEEWWWWWEWEWEWEWWEEWEWEEEEWWEWWWEEWEWWEEEEEEEWWEWWWEEEEWEWEEEEWEWWWWEEWWEEWEEEEWWEWEWWWWWWWEEEWWEWWWWWEWWEEWWWWWEWEWWEEWEWEEEEWEWWWWWWWWWEWEEEEEEWEEWEEEWWEWEEWEWWWEEWEEEWWWEEWEEEWWEEEWEWWWEEEEWEEWWEEWEEEWWWEEEEWWEEWEEWEWWWEWWWEWEEEWEEEEEWEWEEEEEEEWEWEEEWWWWWE...
output:
221881377 64526300 867264922 104966851 895699262 160858486 924133602 216750121 821588511 377608607 224002813 442148058 430544020 52702889 575673161 823359256 331670170 464158708 797643949 571296040 510251131 185938916 222858313 798826145 99553688 290053969 904705569 62913317 657177704 320116308 4862...
result:
ok 100001 lines
Test #17:
score: 5
Accepted
time: 478ms
memory: 25944kb
input:
100000 100000 EEWEEWWEEWWEEEWEEEEEEWEEWEWWWWEEWEEWEWEEWEEEEWWEWWEWEWEWWWEWWWWEEEEEEWWEEWWWEWWEEWWWEWWEEWWEEWWWEWEEWWEEWWEEWWEEEEEEEEWEWEEWWEEWWWWEWWEEEWWEEWEWEEEWWEEEEEWEEEEEEWEWEWWWEWWWWWWWEWEWEWEWWEWWEEWWEEEWWEEWEWWEEWWEWWWWWWWEWEWWWEEWWWEEWEWEWEEEWWWEEEEEWEEEEEEWEWWWEEWEWEEWEEWWWWEWEEWEWEEWEWWWEW...
output:
453792249 419195457 635509442 125271770 348485242 826289385 871179462 952685220 779885962 969532744 18402734 425925227 851196373 662026212 611299288 697053901 108836443 836708452 693246926 794021273 300391905 215225657 597429151 698686793 300028196 860554027 6083087 412972925 707680681 9903684 20621...
result:
ok 100001 lines
Test #18:
score: 5
Accepted
time: 377ms
memory: 26168kb
input:
100000 100000 WEWEEWWWEWWEEWEEEWEEWEEWWEWEEWEWEWWWEWWEWEWEWEEEWWEEEEWEWWEEEEWWWWEWEEEWEWEWEWWWWWEEWEEWEEWEWEEWEEWWEWWWWEEWEWEEWWWEEWEEWWWWEEWWWEEWWWEEWWWEEWWEEWEEEEWWWEWWWEEEWEWEEEEWWEWWEWEEEWWEEWWWWWWWWEWEEWWWEEEWEWEEWEWEWWWEEEWWWWEWEWEEWWEWWWWWWEWWWWWWEEWWWEEWEWEWWEWEWEWWEEWWWWWEWEEWEWEWWEEWEWWEWW...
output:
762638567 681697179 39169027 823655962 58904035 71249595 781775746 645563360 216062286 731858957 698161470 422590424 545096248 427215848 187484712 978815162 87310597 368180733 396876496 266485042 706442395 164789351 17763941 63093660 327329840 959642322 636895739 857946631 964225579 819344600 602876...
result:
ok 100001 lines
Test #19:
score: 5
Accepted
time: 244ms
memory: 26704kb
input:
100000 100000 WWEWEWWWWEWWEEEEWWEWEEEEWEWEEEWEEEWEWEWWWEEWWWWEWEEEEEWEEEEEWWEWWWWWWWWWEEEEWEEEEEEWEEWEWEWWEEEWWEEWEWWWEEEWEEEWWEEEEWEWWEEWWWEEWEEWEWWEWEWWEEEEEWWWWWWEWEWEEWEWWEEEWWEEWWWWWWEWEWWWEWWEEEWWWEWEEEWWEWWWEWEWWWWWWWEWWWEEEWEEEWEEWEEWWWWEWEWEWWEEEEWWEWWEWEEWWWEWEWEEWEWEWEEWEWEWEWEWEEWEEEEEEW...
output:
74681488 836785835 638623812 915677147 895462570 336542170 672404863 195085270 569623080 531627440 325352021 466137176 289556271 216748375 396593283 584704042 686149554 801452417 278494080 349681938 285839947 251563973 293185814 153446008 390887343 303148159 155715876 867442081 882466549 729808149 6...
result:
ok 100001 lines
Test #20:
score: 5
Accepted
time: 306ms
memory: 26756kb
input:
100000 100000 WEEEEEWWEEWEEEWEWWWWEEWWEEEWWEEEWEEWEEEEWWWEWEWWWEWWEWWEEEEWWEWEWWWWWEWEEEEEEEEWWWWEWWEEEEWWEWWWEWEWEWWWWEWEWWWWEWWWEEEWWEEWEWWEWWWEWEEEEWEWEEEWEWEWWWEEWEEWEWEEWWEEEWEWWWWEWWWEWWEWWWEEWEEEEWEWWWEEEEEEWWEEWEEEWWEEWEEEEWEEWEEEWWWWEEWEWWEWEEEEWEEEWWWWEWEEEWWEWEEWWEEWEEEWWWWEWWEEWEEEEEEEEE...
output:
585679563 527550909 301810803 97943174 184888702 250150555 764009299 13962586 892408347 983785319 771792234 757579416 242483451 785888882 459888418 99762025 271456373 608442296 967785092 643292378 48255 339129176 775700305 755289495 553108002 173205461 597638245 363923008 439206085 558514174 3859997...
result:
ok 100001 lines
Extra Test:
score: 0
Extra Test Passed