QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#90630#2023. Routing Schemesyouwike100 ✓5ms3812kbC++142.4kb2023-03-24 11:28:502023-03-24 11:28:51

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 4.16667
Accepted
time: 0ms
memory: 3732kb

input:

2

8 0
SS....RR
00100000
00100000
00011000
00000100
00000100
00000011
00000000
00000000

13 0
SSS.RRRSS.RR.
0001000000000
0001000000000
0001000000000
0000111000000
0000000000000
0000000000000
0000000000000
0000000001000
0000000001000
0000000000110
0000000000000
0000000000000
0000000000000

output:

4
12

result:

ok 2 lines

Test #2:

score: 4.16667
Accepted
time: 2ms
memory: 3728kb

input:

2

5 1
SS.RR
00101
00100
10010
00000
00000

6 2
S....R
001000
000100
010001
000010
001000
000000

output:

3
1

result:

ok 2 lines

Test #3:

score: 4.16667
Accepted
time: 2ms
memory: 3524kb

input:

5

3 2
RS.
010
101
100

4 2
.R.S
0100
0010
1000
0100

4 2
.SR.
0000
0011
0100
0010

5 2
.SSRR
01000
10101
01010
00000
00000

6 2
SS..RR
001010
000010
000010
000010
100101
000000

output:

2
1
2
6
24

result:

ok 5 lines

Test #4:

score: 4.16667
Accepted
time: 2ms
memory: 3456kb

input:

20

6 2
SS..RR
000001
001010
000110
000010
010001
001000

6 1
.SS.RR
000000
000010
000011
000000
000001
001000

6 0
.SR.SR
000000
001000
000000
000000
000001
000000

6 2
SS..RR
011100
000110
000010
100001
100000
000000

6 1
SS.RR.
000110
001000
100000
000000
000000
000000

6 0
.SS.RR
000000
001000
0...

output:

24
5
1
24
2
4
12
6
2
14
8
2
8
10
1
6
5
2
46
12

result:

ok 20 lines

Test #5:

score: 4.16667
Accepted
time: 1ms
memory: 3580kb

input:

20

6 2
.SSR.R
000100
001000
000111
001000
000001
100000

6 1
.S.SRR
010000
000110
000000
100010
000001
000000

6 0
S.RSR.
010000
001000
000000
000010
000000
000000

6 2
..SSRR
000000
000010
000100
010011
000001
000100

6 1
S.SR.R
010000
000110
000100
010000
000001
000000

6 0
SRS.R.
010000
000000
0...

output:

16
6
1
16
3
1
52
3
1
48
8
1
28
12
2
50
3
2
26
66

result:

ok 20 lines

Test #6:

score: 4.16667
Accepted
time: 4ms
memory: 3636kb

input:

20

100 0
SSSS..S.S.SR.SSSSSS.SSR..SRS.SS.RSSSSRSSSSSRRRRSRRRRS...R.SRSRRS..S..RRSR...R.RRSRRRRRR.RRR....RRRR.
0000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000
0000100000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

598434032
1327104
576
884736
96
237273118
1536
32
4
27648
8
4608
1536
605079681
41472
6
556485058
3972517
439853547
1

result:

ok 20 lines

Test #7:

score: 4.16667
Accepted
time: 0ms
memory: 3532kb

input:

19

100 0
S.SSSSSSSSSSSSRS.SRSSSSSS.SRSRSSSSSSSR..RSRSSRSSSSRS.SRRRSRSRRSR.RRRRRRRRRRRRS.RRRRSRSRRRRRRSRRRRRRR
0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0010000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

62130475
55296
48
64
4
27648
55296
573308928
477885230
8
95551488
2
2654208
644491483
4
933474442
7962624
112970109
254803968

result:

ok 19 lines

Test #8:

score: 4.16667
Accepted
time: 5ms
memory: 3572kb

input:

19

100 1
SSSSSRSSSSS.RSSSRSSSSSSSSSSSSSRS.RSSSSSSSSSS.SSRSSRSSSRRRRRRSRRRRRRSSRR.RRRRRRRRRRRRRRRRRR..RRRRRRRR
0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0010100000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

689691380
448688154
160
3
1952
30710784
10423296
11776
648576
3
83607552
434872188
126074880
411720392
40
188006400
405930966
85733880
96576

result:

ok 19 lines

Test #9:

score: 4.16667
Accepted
time: 5ms
memory: 3588kb

input:

19

100 1
SSSSSSSSSR.SSSSSSSSRSSSSSRSSSRSSSSSSSRSSSSSSRRSSRSSSRRSSSRRRRRRR.RRRRRRRR.S.RRRRSRRRRRRRRRRRRRRRRRRR
0000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000100000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

90137953
54934394
901518419
178034057
565248
893842573
3
34176
847977096
33696
834388724
204037824
265403599
40
207872
2356128
3984
38
209610728

result:

ok 19 lines

Test #10:

score: 4.16667
Accepted
time: 0ms
memory: 3812kb

input:

20

100 1
SSSS.SSS.SRSSSRSSSSSSS.SSSRRSSSSSSSSSRS.SRSS.S.SSSS.R.SRRSSRSRRR.RRRRRRRRRRRRRRRRRRRRSRRRRR.RRRR..RR
0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000...

output:

503432759
594772364
544942080
36000
302334554
1728
130970091
330786317
570862472
1152
1536
980377003
816
36
741497200
3483648
238016597
2808
1280
534354874

result:

ok 20 lines

Test #11:

score: 4.16667
Accepted
time: 4ms
memory: 3624kb

input:

20

100 1
S.SSS.SSSSRSSSSSS.RS..SSS.SSSRR.SSSRSSSSS.SSS.SR.SRRS.R.RRRRRR..RRRRRSS.RRRRRSRRR...RSRRSSRRRRRRRRRR
0000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

118409422
384
848468894
271953138
80
68832
120
638
44
946471695
46752
489537139
3
276480
68
650455698
2
9953280
16
6

result:

ok 20 lines

Test #12:

score: 4.16667
Accepted
time: 4ms
memory: 3640kb

input:

2

100 1
SSSRSS.SSSSSSSSSSSSSSRSSRSSSSSSSRSSSRSSR.SRRS.SSRSS.RSRRR.SS.RSRRRRRRRSR.RSRRSRRRRRRRRRR.RRRRRRRRRRR
0010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000001000000000000000000000000000000...

output:

840967271
265512588

result:

ok 2 lines

Test #13:

score: 4.16667
Accepted
time: 4ms
memory: 3600kb

input:

19

100 2
SSSSSSSSRSSSSSSSSSSSSSSSSRSRSSSSSRSRRSRRSSSSRSSRRSSSRRSSSRRRSRRSRRRSRRSRRSRRRRRRRRRRSRRRRRRRRRRRRRRR
0000000100000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000
0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

288382526
586884853
620640127
126
840
50688
577482031
217976832
802287906
218
6
86158509
111559680
3072
18
993526011
3696
808254173
25505280

result:

ok 19 lines

Test #14:

score: 4.16667
Accepted
time: 2ms
memory: 3592kb

input:

18

100 2
S.SSSSSS.SRSSSSSSSSSS.SSS.SS.SSSSS.RSSRRR.SRR.SSR.RR.RSSRRSRRSSRRR.RS.RS.RRRRRRRR.RRRR.RR...RRR..RRR
0000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

697195692
618898048
172800
27157804
55406592
128480256
1631616
1121472
873122334
141419520
920
10
271362863
22176
808300753
55172453
1871424
14

result:

ok 18 lines

Test #15:

score: 4.16667
Accepted
time: 1ms
memory: 3540kb

input:

20

100 2
SSSS.S.SS.SS.SSS.SRSS.R.SSSSSS..SSSS.RRSSSRS..SS...RS.RS.RSRRRRRR.SRRRRR.SRRRRRRR..RR...RSRRRRRRRR..
0100000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000
0011000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

482364841
46
30301483
886937551
533292954
477411877
14616576
161792
438755707
282222897
1329024
1162656
655637728
152098340
564
186654173
2736
85561990
273888
6768

result:

ok 20 lines

Test #16:

score: 4.16667
Accepted
time: 4ms
memory: 3808kb

input:

19

100 2
SSSSSSSSSSSRSSRSSSSSS.SSSSSSSSSSRSSRR.SSSSSRSSSRRSRRS.SS.RRRRRRRRS.RRSSRRRRRRR.RRSRRRRRRRRRRRRRRRRRR
0000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000
0010000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

799345293
1963584
47921184
31728
503502938
11
43414557
809484678
1180
23520
746898789
4
60692372
1170
480
620165360
825252916
17808249
604800

result:

ok 19 lines

Test #17:

score: 4.16667
Accepted
time: 4ms
memory: 3576kb

input:

20

100 2
.S...SS.SSSSS.S..S..SSSS.S.SS.S.SSRRSRS.RRSR.SR.R.S....RR.R....RR.RR.RRSR.R.S..RRS..RRR.R....R...R.R
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000010000000000000000000000000000000000000000000000000000000...

output:

469006517
29270016
392037224
20
206208
591411456
4106592
9288
342033913
25524
375795687
42
25837056
619991390
139649673
264130863
328
14
4473792
975901937

result:

ok 20 lines

Test #18:

score: 4.16667
Accepted
time: 2ms
memory: 3804kb

input:

19

100 2
.S.S.SS......SS.S..SS.S.S.SS..S...R.SSR.S.SSS.SSS....R.RRRR.....RR.S.R.RRRRRSR.R.RS....R.RR..RRR.R.R
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000100000000000000000000000000000000000000...

output:

682103332
275071534
109983559
76
542216858
578
271872
233280000
251873280
5568
1376
320175888
118034867
170201088
6
4680
17664
823374152
12

result:

ok 19 lines

Test #19:

score: 4.16667
Accepted
time: 4ms
memory: 3800kb

input:

19

100 2
.SSSSS.S..SSSSSSSSSSS.SSSSSS.SSSRSRRSSSR.SSSSSRRRR.SRR.RS.SR...R.RRRR.RRRRR..RRSRRRSSRRRR.RRRRRRRRRR
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000010000000000000000000000000000000000000000000000000000000...

output:

167077449
103022667
991359642
318642285
385920
94
791047322
3408
809988073
134016
384
129408
20160
752574023
775966050
5200
624375289
85
547938585

result:

ok 19 lines

Test #20:

score: 4.16667
Accepted
time: 4ms
memory: 3812kb

input:

19

100 2
SS..SSSS.S.SRSS.SSSR....SS.SS..SS..SRSSRSSRSS.R.RS...S...RSRS.RR.RRRR.RRRSR.RSR.R..SR.R.RRRR.RR..RRR
0000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000010000000000000000000000000000000000000000000000...

output:

624070116
108
697115986
31078372
30912
9114624
643870277
4640
29520
1008
336780288
785664
896
63698746
130914290
942108125
110351390
402689352
906235839

result:

ok 19 lines

Test #21:

score: 4.16667
Accepted
time: 1ms
memory: 3600kb

input:

19

100 2
S...S..S....S.SSS...SSS.S.RSS..R..SR..SSS...R...S...SSS..R.S.SS.S.R.RRR..R..RRRR.S.RRRRR.R..RRRR..RR
0000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

184450660
732005041
480605689
4096
568512
974032746
117460824
278893961
8
1359360
6965760
227367936
529817832
401344
510698770
20483328
17
1291680
861821825

result:

ok 19 lines

Test #22:

score: 4.16667
Accepted
time: 5ms
memory: 3572kb

input:

2

100 2
SRSSSS.SSSSSSSSSRSSSSSSSSRSSSSSRRSSRSSRSRRRS..RSSSSSRSRSRSSRRSSR.RRRSRRRSRRRR.RRRRRRRSRRRRRRRRR.RRRR
0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

968420002
389389747

result:

ok 2 lines

Test #23:

score: 4.16667
Accepted
time: 2ms
memory: 3812kb

input:

2

100 2
SSSSSSSSSSSRSSSSSRSSSSSSSS.SSSSS.SSSSSSSRSSRSRSSSRRRRRRRRR..RRRSRRRR.RRRRRRRSSRRRRR.RSR.RRRRRRR.RRRR
0011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000100000000000000000000000000000000000000000000000...

output:

303488821
183480277

result:

ok 2 lines

Test #24:

score: 4.16667
Accepted
time: 5ms
memory: 3804kb

input:

2

100 2
S.SSSS.SSSSRSSSSSSSSRSSSSSSS.S.RSRSSSRRSSRSS.SSR.RRRRSRRSS.SRRSSRS.RRRRRS.RRRRRR.RR.RRR.R.RRRRRRRRR.
0010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

709758665
79666468

result:

ok 2 lines