QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#602834#1277. PermutationZhangYiDeML 214ms39828kbC++141.6kb2024-10-01 13:04:432024-10-01 13:04:49

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3860kb

input:

2
3
0 0 0
7
1 0 3 0 0 6 0

output:

2
21

result:

ok 2 tokens

Test #2:

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

input:

50
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 50 tokens

Test #3:

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

input:

25
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0
2
0 0

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 25 tokens

Test #4:

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

input:

16
3
0 0 0
3
0 0 0
3
0 0 0
3
0 0 0
3
0 0 0
3
0 0 0
3
0 0 0
3
0 0 0
3
0 0 0
3
0 0 0
3
0 0 0
3
0 0 0
3
0 0 0
3
0 0 0
3
0 0 0
3
0 0 0

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2

result:

ok 16 tokens

Test #5:

score: 0
Accepted
time: 2ms
memory: 3940kb

input:

5
10
0 0 0 0 0 0 0 0 0 0
10
0 0 0 0 0 0 0 0 0 0
10
0 0 0 0 0 0 0 0 0 0
10
0 0 0 0 0 0 0 0 0 0
10
0 0 0 0 0 0 0 0 0 0

output:

3627734
3627734
3627734
3627734
3627734

result:

ok 5 tokens

Test #6:

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

input:

4
11
0 10 11 6 1 0 8 0 0 3 5
11
0 0 0 10 8 5 4 1 0 2 9
11
0 4 0 3 11 0 0 0 7 8 1
11
0 8 0 3 9 0 0 0 7 4 0

output:

24
24
120
720

result:

ok 4 tokens

Test #7:

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

input:

4
12
0 0 11 0 0 6 1 0 4 0 5 8
12
7 0 10 11 4 6 1 8 0 12 0 0
12
0 12 0 0 0 0 5 0 1 0 10 11
12
0 0 4 3 9 12 2 5 1 10 6 0

output:

720
24
5040
6

result:

ok 4 tokens

Test #8:

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

input:

3
13
0 13 6 3 0 11 0 0 0 0 1 2 0
13
9 0 0 0 0 0 8 0 5 7 0 12 0
13
0 0 0 0 0 0 3 10 2 9 0 12 0

output:

5040
40320
40320

result:

ok 3 tokens

Test #9:

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

input:

3
14
0 12 10 9 0 0 11 0 0 1 6 4 8 13
14
0 0 8 0 0 9 14 3 0 0 6 2 0 0
14
13 0 8 0 0 0 0 0 14 7 4 6 0 3

output:

120
40320
5040

result:

ok 3 tokens

Test #10:

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

input:

3
15
8 7 12 14 6 0 0 9 4 0 1 0 0 0 2
15
5 0 0 9 0 7 15 0 13 4 11 0 0 0 2
15
0 0 0 2 0 0 7 0 0 8 0 13 14 10 3

output:

720
5040
40320

result:

ok 3 tokens

Test #11:

score: 0
Accepted
time: 27ms
memory: 6784kb

input:

2
20
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
20
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

output:

143388927
143388927

result:

ok 2 tokens

Test #12:

score: 0
Accepted
time: 78ms
memory: 15980kb

input:

1
30
21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

output:

586750519

result:

ok "586750519"

Test #13:

score: 0
Accepted
time: 212ms
memory: 30504kb

input:

1
40
0 0 0 0 23 26 0 0 0 0 0 0 32 20 33 0 0 0 0 0 0 0 0 0 0 0 0 0 36 0 0 0 0 0 0 0 0 0 0 0

output:

943272305

result:

ok "943272305"

Test #14:

score: 0
Accepted
time: 214ms
memory: 39828kb

input:

1
41
0 0 0 0 0 0 0 0 0 14 38 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 0 0 35 9 0 0

output:

523095984

result:

ok "523095984"

Test #15:

score: 0
Accepted
time: 153ms
memory: 29132kb

input:

1
42
0 0 0 0 0 0 0 0 0 0 0 0 4 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 38 0 0 0 1 0

output:

472948359

result:

ok "472948359"

Test #16:

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

input:

5
10
0 0 7 0 0 0 0 0 0 3
10
0 5 0 0 0 0 0 9 0 0
10
1 6 0 0 0 0 0 5 0 0
10
0 0 4 0 0 0 3 0 1 9
10
0 0 0 0 0 0 0 6 0 0

output:

40320
40320
5040
718
362648

result:

ok 5 tokens

Test #17:

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

input:

5
9
0 6 0 0 0 0 0 0 0
9
6 0 0 0 3 0 0 7 0
9
8 0 0 0 0 0 7 3 4
9
0 0 0 0 0 0 0 0 0
9
0 0 0 0 0 0 8 2 0

output:

40270
720
120
362384
4996

result:

ok 5 tokens

Test #18:

score: -100
Memory Limit Exceeded

input:

1
42
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

output:

94131117

result: