QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#521519#6601. Mean Streets of GadgetzanZhangYiDeTL 2260ms151800kbC++172.9kb2024-08-16 11:44:172024-08-16 11:44:17

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3692kb

input:

3 3
!1
2 -> 1
1 2 -> !3

output:

FFF

result:

ok ok, solution exists

Test #2:

score: 0
Accepted
time: 0ms
memory: 3692kb

input:

6 4
1 -> 2
1 3 -> !2
1 -> 3
4 -> 2
1
2 3 4 -> !1

output:

conflict

result:

ok ok, conflict

Test #3:

score: 0
Accepted
time: 1ms
memory: 3712kb

input:

10 10
2 -> !10
5 -> 1
6
5 4 3 -> 2
6 -> !10
!4
8 -> !9
7
2 -> 3
!10

output:

FFFFFTTFFF

result:

ok ok, solution exists

Test #4:

score: 0
Accepted
time: 0ms
memory: 3684kb

input:

10 20
10 -> 16
11 15 3 9 7 -> 18
!15
7 -> !16
8 13 14 7 -> !3
15 10 7 -> !4
9 13 -> 19
14 -> !3
14 -> !1
7 -> 18

output:

FFFFFFFFFFFFFFFFFFFF

result:

ok ok, solution exists

Test #5:

score: 0
Accepted
time: 0ms
memory: 3692kb

input:

10 20
13 10 14 2 -> !6
15 -> 8
3
6 19 15 17 8 12 -> 9
16 14 20 3 8 10 -> !2
13 7 -> !17
!20
13 5 -> !6
7
19 -> !8

output:

FFTFFFTFFFFFFFFFFFFF

result:

ok ok, solution exists

Test #6:

score: 0
Accepted
time: 2260ms
memory: 60376kb

input:

100 1000000
94429 320635 508720 700200 130270 957386 590664 803356 809301 99923 743100 401943 305947 20978 576651 500522 625937 650963 413199 399941 858783 764652 465792 274530 785897 932255 67829 185129 466497 816582 46596 340513 678257 310188 915049 10553 569860 251293 592857 249320 652729 229483 ...

output:

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...

result:

ok ok, solution exists

Test #7:

score: 0
Accepted
time: 2120ms
memory: 58712kb

input:

100 1000000
75280 10272 135675 853058 733070 255536 129337 75800 494611 651189 588621 752428 438214 661170 870566 574009 501654 560553 197175 754534 452429 325335 27138 883558 800265 727572 26165 899875 924252 933827 758011 880427 509798 544385 662165 547716 748628 769327 19666 607200 823036 29276 2...

output:

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...

result:

ok ok, solution exists

Test #8:

score: 0
Accepted
time: 369ms
memory: 58276kb

input:

1000 1000000
387098 313593 390216 685206 204015 462730 797205 91487 74360 142337 169639 782862 287191 26170 95833 975936 452601 659382 201543 664471 738121 321120 640755 709821 980365 257128 376894 680469 147871 432587 225927 406173 433925 307453 349499 350268 333345 623893 569060 821761 972304 4179...

output:

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...

result:

ok ok, solution exists

Test #9:

score: 0
Accepted
time: 274ms
memory: 58624kb

input:

3000 1000000
204 483492 327568 34073 808153 700428 795524 668587 565522 579402 807039 468388 310302 876099 477269 657266 208409 195058 830503 197328 757607 284017 440454 703204 642284 620152 517113 761081 914884 815156 284278 775797 117873 890126 177646 294376 157448 861227 999412 401045 869983 8151...

output:

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...

result:

ok ok, solution exists

Test #10:

score: 0
Accepted
time: 220ms
memory: 59008kb

input:

10000 1000000
850836 692036 570734 303842 739441 15517 18792 894659 778754 264865 388381 78765 953843 273070 194004 470690 807127 256979 107484 700448 212264 393908 631518 842148 632690 129611 227709 52409 96368 420993 456096 140019 357433 328448 789131 707372 560820 120742 994443 856300 396463 7035...

output:

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...

result:

ok ok, solution exists

Test #11:

score: 0
Accepted
time: 195ms
memory: 60080kb

input:

30000 1000000
121088 541150 909159 305585 915837 918070 84828 336736 597040 624545 701741 951449 846844 184297 748127 599159 522177 531950 32744 210713 -> !224134
748299 878582 671289 338716 28388 725620 505497 744155 471444 485498 361842 293013 626199 41806 903990 237816 926870 266543 97469 916797 ...

output:

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...

result:

ok ok, solution exists

Test #12:

score: 0
Accepted
time: 203ms
memory: 64684kb

input:

100000 1000000
230849 838777 792974 528083 890193 775000 874435 490314 982983 30987 887735 240045 331792 135258 768631 459953 181791 83311 747797 865390 854153 774139 883180 572448 262720 937896 376290 719871 71346 820714 360464 247706 483716 811679 893011 -> 738203
528726 208193 465325 -> !358150
5...

output:

conflict

result:

ok ok, conflict

Test #13:

score: 0
Accepted
time: 273ms
memory: 77264kb

input:

300000 1000000
14392 777667 774124 406586 996229 729385 44438 303684 -> 72393
120357 -> !264353
254628 481510 -> 707605
604965 -> 526732
227850 753868 134932 217979 503573 353184 -> 569871
!981658
!982704
886961 803184 732294 408659 116554 38373 396539 525215 657369 611479 -> !459109
!422395
481659 ...

output:

conflict

result:

ok ok, conflict

Test #14:

score: 0
Accepted
time: 399ms
memory: 117700kb

input:

1000000 1000000
!934772
639145
839227
15139 -> !167634
968025 268827 -> !643521
531777 526219 -> !824701
400945 -> !809686
!623402
854050 749037 -> 500448
!888319
390701 674586 -> 992466
!866666
890011 27918 479072 644597 963879 203274 -> 28926
723500 -> 424124
!134904
225803 -> !227216
281728 22361...

output:

conflict

result:

ok ok, conflict

Test #15:

score: 0
Accepted
time: 159ms
memory: 53048kb

input:

97421 1000000
282062 560023 612737 396497 829426 290763 564218 563022 698760 32591 547281 -> !152116
259644 490819 18621 702511 880133 672975 643187 496894 683646 18367 351236 734792 289343 144937 253081 852290 256595 -> !637229
653659 801351 -> 295402
279438 350915 618536 20053 520226 95075 844184 ...

output:

conflict

result:

ok ok, conflict

Test #16:

score: 0
Accepted
time: 179ms
memory: 64884kb

input:

259866 1000000
289491 -> 325978
20344 46598 728897 936444 889610 337634 -> 381547
135383
220146 346012 -> 893629
411120 975014 382433 -> 192632
922418 16262 -> !371548
411705 901195 692842 921887 556253 723992 703044 210120 651765 124146 -> 309566
622255 648406 707667 252784 -> 135267
123197
831371 ...

output:

conflict

result:

ok ok, conflict

Test #17:

score: 0
Accepted
time: 205ms
memory: 66132kb

input:

261089 1000000
429818 781220 752288 497885 208586 736388 566546 255108 349098 782499 337379 350794 -> 977652
544581
519653 996274 -> !262337
786371
136780 195375 -> 50743
702759 309243 144651 683536 286185 419559 856688 -> 150989
594693 680105 715548 890956 407227 -> 935288
164578 812403 199877 -> 4...

output:

conflict

result:

ok ok, conflict

Test #18:

score: 0
Accepted
time: 121ms
memory: 82180kb

input:

1000000 1000000
748487
545185
533853
902865
754349
686265
274002
681282
578008
134311
198931
442271
480056
205364
988535
501498
847882
313193
866259
389862
385540
629
96612
539100
679844
651403
369936
213723
817020
378005
388509
677518
358244
537019
645635
292924
29409
821188
224680
966912
463035
68...

output:

TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT...

result:

ok ok, solution exists

Test #19:

score: 0
Accepted
time: 180ms
memory: 66572kb

input:

320858 1000000
224471 775989 -> 362949
957889
952531
808309 283885 338458 760360 494204 -> 627493
261649
472968
494204 755879 775989 -> 964319
289993 283885 -> 161095
755879 -> 63734
494204 -> 601979
882336
775989 -> 710117
478620 376754 515238 289993 -> !822911
239442 337205 338458 -> 922832
678132...

output:

conflict

result:

ok ok, conflict

Test #20:

score: 0
Accepted
time: 253ms
memory: 69312kb

input:

260874 1000000
579606 935344 966395 294401 249023 636277 315392 -> 328216
560756 -> 28236
574021
317238 413707 772270 716907 860030 -> 143638
137881
266285 283680 926449 361445 390898 -> 923540
646936 47885 99997 518611 596175 697349 892780 287886 -> 112039
738500 202452 629358 932178 -> 433740
6842...

output:

FTTFFFFTFTTFFFTFTTFFFTFTFFFTFFFFFFFTFFFTFFTFFTFFFTFFFFFFFFFFFFFFFFFFTTFFTFFTFFFFFFFFFTFTTFTTFFFTTFFTFFFFFTFFFFTFFFFFTFFFFFFTFFFFFFFFFFFFFTFTFFTTTFFTFFFFFTFTTFFTTFTFFFFFTFFTFFFFFFTFFFTFFFFFTTFFFFFFFFFTFTFFFTFFFFFFFFFTFTTTFFTFTFTFFFFFFFFFFFFFTFFTFFTFFFTFFFFFFTFFTFFFTTFTFFFFFFFTFFFTFFFFFFFTFFFFFFFFTFFF...

result:

ok ok, solution exists

Test #21:

score: 0
Accepted
time: 319ms
memory: 88556kb

input:

568607 1000000
660283
704155 62427 -> 303672
413003 697078 508835 825003 -> 42102
594390
818884 749081 -> 69621
8277 -> 646140
714270 547199 -> 106076
596064
71875 838581 436637 806115 -> 472512
651669
213912 173390 -> 708984
679314
671176 422165 711345 -> 311899
234913 -> 189755
332847
515178 69895...

output:

conflict

result:

ok ok, conflict

Test #22:

score: 0
Accepted
time: 164ms
memory: 44848kb

input:

1530 1000000
391977 126749 179051 653179 18996 422181 869896 923870 965481 49194 382688 557733 338420 134968 951863 7311 11916 357381 229918 155367 883701 257375 251728 305371 133466 577766 722259 759053 432023 409477 408431 805200 143087 352289 359835 42395 722506 915209 791290 101498 285396 29528 ...

output:

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFTFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...

result:

ok ok, solution exists

Test #23:

score: 0
Accepted
time: 149ms
memory: 44900kb

input:

1502 1000000
962646 106520 679440 354237 571305 601888 2164 608701 261594 370718 504890 552897 136390 428446 134099 463673 395545 604924 996428 405411 713821 477520 157255 609264 428375 628016 642261 380841 933978 771810 874945 957308 130720 885724 6435 539325 765749 212224 248985 276542 242585 6963...

output:

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...

result:

ok ok, solution exists

Test #24:

score: 0
Accepted
time: 158ms
memory: 45168kb

input:

1420 1000000
796600 829122 906736 749381 477725 637407 102680 770005 589688 202726 515849 523693 97348 136158 711413 33364 208806 72613 586981 237307 703515 647789 99359 580824 345407 456957 868539 19719 848219 782690 319434 785335 462935 675885 138908 832206 964954 515754 516175 246355 675124 50236...

output:

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...

result:

ok ok, solution exists

Test #25:

score: 0
Accepted
time: 124ms
memory: 45520kb

input:

2424 1000000
297542 404585 852504 635373 745278 51077 137747 813141 451236 482440 839898 968827 675815 232844 495865 701675 155112 842399 619446 600264 545242 355885 778377 380126 106776 840419 901661 130565 619477 214044 538376 544660 762319 91818 146801 214450 528347 189091 948758 239809 436377 49...

output:

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFTFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...

result:

ok ok, solution exists

Test #26:

score: 0
Accepted
time: 143ms
memory: 44924kb

input:

1501 1000000
386798 742147 170249 397282 808171 327365 752723 585186 203563 250642 10624 695256 434513 539084 812890 963118 94695 360999 464280 897320 411212 920219 874613 371002 328234 187879 325436 586809 948569 64890 227381 548452 791325 746405 262467 897447 324552 839718 761528 75417 513588 7005...

output:

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFTFFFFFFFFFFFFFFFFFFFFFFF...

result:

ok ok, solution exists

Test #27:

score: 0
Accepted
time: 300ms
memory: 151672kb

input:

1000000 999999
1 -> 2
2 -> 3
3 -> 4
4 -> 5
5 -> 6
6 -> 7
7 -> 8
8 -> 9
9 -> 10
10 -> 11
11 -> 12
12 -> 13
13 -> 14
14 -> 15
15 -> 16
16 -> 17
17 -> 18
18 -> 19
19 -> 20
20 -> 21
21 -> 22
22 -> 23
23 -> 24
24 -> 25
25 -> 26
26 -> 27
27 -> 28
28 -> 29
29 -> 30
30 -> 31
31 -> 32
32 -> 33
33 -> 34
34 ->...

output:

TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT...

result:

ok ok, solution exists

Test #28:

score: 0
Accepted
time: 276ms
memory: 151800kb

input:

1000000 999999
1 -> 2
2 -> 3
3 -> 4
4 -> 5
5 -> 6
6 -> 7
7 -> 8
8 -> 9
9 -> 10
10 -> 11
11 -> 12
12 -> 13
13 -> 14
14 -> 15
15 -> 16
16 -> 17
17 -> 18
18 -> 19
19 -> 20
20 -> 21
21 -> 22
22 -> 23
23 -> 24
24 -> 25
25 -> 26
26 -> 27
27 -> 28
28 -> 29
29 -> 30
30 -> 31
31 -> 32
32 -> 33
33 -> 34
34 ->...

output:

conflict

result:

ok ok, conflict

Test #29:

score: 0
Accepted
time: 456ms
memory: 136720kb

input:

1000000 1000000
181663 -> 602022
602022 -> 948300
181663 -> 124026
602022 -> 761351
602022 -> 775925
948300 -> 955337
948300 -> 130482
181663 -> 550425
124026 -> 775567
602022 -> 484530
130482 -> 608812
761351 -> 272840
124026 -> 307940
484530 -> 732460
775925 -> 850847
608812 -> 99140
484530 -> 818...

output:

TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT...

result:

ok ok, solution exists

Test #30:

score: 0
Accepted
time: 443ms
memory: 136416kb

input:

1000000 1000000
681725 -> 167465
681725 -> 162093
167465 -> 194552
167465 -> 43475
194552 -> 405489
194552 -> 206319
206319 -> 17054
162093 -> 131330
194552 -> 356962
206319 -> 850354
681725 -> 993070
405489 -> 791081
162093 -> 857729
681725 -> 384182
384182 -> 513105
850354 -> 76700
356962 -> 74545...

output:

TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT...

result:

ok ok, solution exists

Test #31:

score: 0
Accepted
time: 440ms
memory: 136728kb

input:

1000000 1000000
781850 -> 937984
781850 -> 245717
781850 -> 623539
937984 -> 282095
282095 -> 607498
781850 -> 226927
226927 -> 310731
623539 -> 362587
245717 -> 937900
245717 -> 105656
937900 -> 768859
105656 -> 722346
226927 -> 392156
937900 -> 675683
937984 -> 449169
781850 -> 834338
449169 -> 59...

output:

TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT...

result:

ok ok, solution exists

Test #32:

score: 0
Accepted
time: 277ms
memory: 124168kb

input:

899999 1000000
315297
315297 -> 112160
315297 -> 868918
315297 -> 803155
315297 -> 60144
315297 -> 103432
315297 -> 893582
315297 -> 632646
315297 -> 203197
315297 -> 733785
315297 -> 981810
315297 -> 112409
315297 -> 612061
315297 -> 851763
315297 -> 188580
315297 -> 608717
315297 -> 428436
315297 ...

output:

TTFTTFFTTFTTTTFTTFFTFFFTFTTTFFTFFTFTFFFFFFFTTFTTFTTFTFFTFTTFFTFTFFTFTTFFTTFFFTTFFTTFFTTFFFFTTTTTTTFFFTFTTTFTFTTTTFTFFTFFTFTFTTTFFTFTFFFFTTTTFTFFFFTTTTTTFTTFFFTTTTFFFTTFTFTTFTTTFTTFTFTTFFFFTTTTFFTTTFTFFTTFFFTFFFFFFTFFTFFFTTTTFTTTTFTFFFTTFTTFFTTTTTTTFFTTTFTTFTFFTTFTTTTTTFFFTFFFTTFFTTFFTTFTFFTFTFFFFTFT...

result:

ok ok, solution exists

Test #33:

score: -100
Time Limit Exceeded

input:

600000 300003
10615
10615 -> 9561
10615 -> 8685
10615 -> 32600
10615 -> 119971
10615 -> 261156
10615 -> 83118
10615 -> 126022
10615 -> 277524
10615 -> 264030
10615 -> 114016
10615 -> 259543
10615 -> 167671
10615 -> 110159
10615 -> 235900
10615 -> 288252
10615 -> 178405
10615 -> 8140
10615 -> 130506
...

output:


result: