QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#596622#9432. Permutationucup-team4901#AC ✓304ms4408kbC++173.7kb2024-09-28 16:08:122024-09-28 16:08:15

詳細信息

Test #1:

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

input:

5
0
0
0
2
1
0

output:

0 2 1 1 2 2
0 1 2 1 2 2
0 1 1 1 2 1
0 3 4 3 3 4
0 4 4 3 3 3
0 4 3 3 3 3
1 3 4 2 1 5

result:

ok Accepted

Test #2:

score: 0
Accepted
time: 304ms
memory: 4396kb

input:

1000
1
1
1
2
1
0
0
1
1
1
0
0
1
1
1
1
2
2
0
1
0
0
2
1
1
2
1
0
2
1
1
2
1
1
1
1
0
1
1
1
1
0
1
1
0
2
1
0
1
2
1
2
2
1
1
0
1
0
2
1
1
1
0
2
0
1
1
2
1
0
1
0
0
1
1
1
1
1
0
0
0
2
1
0
2
2
2
0
0
1
1
1
1
0
1
1
1
1
1
1
2
2
0
1
0
1
1
0
0
1
0
1
1
0
1
0
1
0
1
1
1
1
1
1
0
1
2
1
2
2
1
1
2
1
1
0
2
0
1
0
1
1
0
0
2
1
1
1...

output:

0 1 2 2 2 1 2 2 1 2 1 1 1 2 2 1 2 1 2 2 2 1 2 1 1 1 1 2 1 1 2 2 2 1 2 2 1 2 2 1 1 1 1 2 1 1 2 2 2 1 1 1 1 2 2 2 1 1 2 1 2 2 1 2 2 2 1 1 1 2 1 1 2 2 1 1 1 1 1 2 1 2 2 1 1 1 2 2 2 2 2 1 2 2 2 1 1 1 2 2 1 1 2 2 2 2 2 2 2 1 2 2 2 2 1 2 1 2 2 1 1 1 1 1 2 1 2 2 2 2 1 2 1 1 2 1 2 1 1 2 1 1 2 1 1 1 1 1 1 2 ...

result:

ok Accepted

Test #3:

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

input:

1

output:

1 1

result:

ok Accepted

Test #4:

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

input:

2
2

output:

0 2 1
1 2 1

result:

ok Accepted

Test #5:

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

input:

3
0
1
1

output:

0 2 2 1
0 2 1 1
0 2 1 1
1 3 1 2

result:

ok Accepted

Test #6:

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

input:

4
1
2
0
0

output:

0 1 1 2 2
0 1 2 2 1
0 1 2 1 2
0 4 3 3 3
1 3 4 2 1

result:

ok Accepted

Test #7:

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

input:

6
1
0
0
1
0
2
1
1
2

output:

0 2 1 1 1 2 2
0 1 2 1 2 2 1
0 2 2 1 2 1 1
0 1 1 2 2 1 1
0 1 1 1 2 1 1
0 3 4 3 3 3 4
0 3 3 3 3 4 4
0 3 3 3 3 4 3
0 5 5 5 5 6 5
1 3 4 2 1 6 5

result:

ok Accepted

Test #8:

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

input:

7
0
2
0
0
1
0
1
1
2
1
0

output:

0 2 2 1 2 2 1 1
0 2 1 2 1 2 1 1
0 1 1 1 2 1 1 1
0 4 4 3 3 4 3 3
0 4 3 3 3 4 3 4
0 4 3 3 3 4 3 3
0 3 3 3 3 4 3 3
0 3 3 3 3 4 3 3
0 5 6 5 5 6 5 5
0 5 5 5 5 6 6 5
0 5 5 5 5 5 6 5
1 3 7 2 1 6 5 4

result:

ok Accepted

Test #9:

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

input:

8
2
0
1
1
1
2
2
1
0
0
1
1
2

output:

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

result:

ok Accepted

Test #10:

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

input:

9
1
0
0
1
0
1
1
1
1
0
1
0
1
2
0
1
1
0

output:

0 2 2 2 2 1 1 1 1 2
0 1 2 1 2 2 2 1 1 2
0 2 2 1 2 1 2 1 2 1
0 1 2 2 2 1 1 1 1 1
0 1 2 1 2 1 1 1 1 1
0 1 2 1 1 1 1 1 1 1
0 1 2 1 1 1 1 1 1 1
0 4 3 3 3 3 4 4 4 3
0 1 3 1 1 3 1 1 1 3
0 4 3 3 3 3 3 3 4 3
0 4 3 3 3 3 3 4 3 3
0 4 3 3 3 3 3 3 3 3
0 5 6 5 5 6 5 5 6 5
0 1 1 1 1 1 5 1 1 5
0 5 5 5 5 5 6 5 5 5
...

result:

ok Accepted

Test #11:

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

input:

10
2
0
0
2
2
1
1
0
1
1
2
1
0
0
2
0

output:

0 2 1 2 1 2 1 1 2 1 2
0 1 1 2 2 2 2 1 1 2 1
0 2 1 1 2 1 2 1 1 1 1
0 1 1 1 1 1 2 1 1 1 2
0 3 4 3 3 4 3 4 4 3 3
0 3 3 4 3 4 3 3 4 4 3
0 3 3 4 3 3 3 3 3 4 3
0 4 4 3 3 3 3 3 3 3 3
0 5 5 6 5 5 6 5 5 6 5
0 1 5 1 1 5 1 1 5 1 1
0 5 5 6 5 5 5 5 5 6 5
0 5 5 5 5 5 6 5 5 6 5
0 5 5 5 5 5 6 5 5 5 5
0 7 8 7 7 8 7 ...

result:

ok Accepted

Test #12:

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

input:

11
1
0
1
1
0
0
0
1
0
1
1
1
1
1
1
2
2
1
0
2
0

output:

0 2 1 2 1 2 1 2 1 2 1 2
0 1 1 2 2 2 2 1 2 2 1 1
0 1 1 2 1 2 1 2 1 2 1 2
0 1 1 2 1 2 1 1 1 2 1 1
0 2 1 1 2 1 1 1 2 1 1 1
0 1 2 1 2 1 1 1 1 1 1 1
0 4 3 4 3 4 3 3 4 4 3 3
0 4 3 3 3 3 3 4 4 4 3 4
0 4 3 3 3 3 3 3 4 4 3 3
0 3 3 3 3 3 3 3 4 4 3 4
0 3 3 3 3 3 3 3 4 4 3 3
0 5 6 6 5 5 6 5 5 6 5 5
0 1 1 1 1 5 ...

result:

ok Accepted

Test #13:

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

input:

12
2
0
1
1
1
0
2
1
0
2
0
1
1
1
0
0
0
2
2
2
2

output:

0 1 2 2 1 1 1 1 1 2 2 2 2
0 2 1 2 2 1 1 2 1 2 1 1 2
0 2 1 1 1 1 1 2 1 1 1 2 1
0 2 1 1 1 1 1 2 1 1 1 1 1
0 1 1 1 2 1 1 1 1 1 2 1 1
0 1 1 1 2 1 1 1 1 1 1 1 1
0 3 4 3 3 4 3 4 4 3 3 3 4
0 4 3 4 3 4 4 4 3 3 3 3 3
0 4 3 4 3 3 4 3 3 3 3 3 3
0 3 3 4 3 3 4 4 3 3 3 3 3
0 5 5 6 5 5 6 5 6 5 5 6 5
0 5 6 6 5 6 5 ...

result:

ok Accepted

Test #14:

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

input:

13
1
1
2
2
1
0
0
1
2
0
0
1
1
0
1
1
1
0
1
1
0
2
0
1
0
0
2
1
0

output:

0 2 2 2 2 1 1 1 1 1 2 2 2 1
0 1 1 1 2 2 1 1 2 2 2 2 1 2
0 2 2 1 1 1 1 2 2 2 2 2 1 1
0 2 1 2 1 2 1 1 1 1 2 2 1 2
0 1 1 1 2 1 2 1 1 1 2 1 1 1
0 1 1 1 2 1 2 1 1 1 1 1 1 1
0 1 1 1 2 1 1 1 1 1 1 1 1 1
0 4 3 4 3 4 3 3 4 4 3 4 3 3
0 1 3 1 1 1 3 3 1 1 1 1 3 3
0 3 4 3 3 3 4 3 3 3 3 3 3 4
0 3 4 3 3 3 3 3 3 3 ...

result:

ok Accepted

Test #15:

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

input:

14
1
2
0
1
1
1
0
0
1
0
1
1
0
0
1
1
2
0
1
1
1
0
1
1
2
0
0
1
0
0

output:

0 1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
0
0
2
2
2
1
1
0
1
0
0
...

output:

0 2 2 1 2 1 1 1 2 1 1 2 2 2 1 2 1 1 1 2 2 1 1 2 2 1 1 1 1 2 1 2 2 1 2 1 1 2 1 1 2 2 1 1 1 2 2 1 1 2 1 2 2 1 1 2 2 1 2 1 2 1 1 1 2 1 2 1 1 1 2 1 2 1 2 2 1 1 1 1 2 1 2 1 2 1 2 1 1 2 1 2 1 2 2 1 2 2 2 2 1 2 2 1 1 1 2 1 1 1 1 1 2 1 1 2 1 2 2 2 2 2 1 1 1 1 1 1 2 2 2 1 2 1 2 2 2 2 1 2 1 2 1 1 2 2 2 2 2 1 ...

result:

ok Accepted

Test #40:

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

input:

998
2
1
1
0
1
1
1
0
2
2
1
1
2
1
0
2
1
1
1
1
1
1
0
0
1
0
2
2
1
1
1
1
0
1
0
1
0
1
1
1
1
2
1
1
0
1
1
1
1
1
1
1
1
2
2
0
0
0
0
1
1
1
1
1
2
1
2
2
0
1
0
2
1
1
1
1
0
0
0
2
1
0
0
1
0
1
0
1
0
1
1
1
1
1
1
1
1
1
1
1
2
0
0
2
0
1
0
0
2
0
0
2
0
1
1
0
1
0
1
1
2
0
2
1
0
1
1
0
0
1
1
2
1
1
1
0
0
0
1
1
0
2
1
1
2
2
0
1
...

output:

0 1 2 2 1 1 1 2 1 1 1 1 1 1 1 2 1 1 1 1 2 1 1 1 2 1 2 2 2 1 2 1 1 1 2 1 2 1 1 2 1 2 1 2 1 1 1 2 2 1 2 2 1 2 2 1 2 2 1 1 1 1 1 1 2 1 1 1 2 1 2 1 1 2 2 1 2 2 2 2 1 2 2 2 1 1 2 2 2 2 1 1 1 1 2 1 2 1 2 2 2 2 1 1 1 1 2 2 1 2 1 1 1 2 2 2 1 2 1 1 1 1 1 2 1 2 1 1 1 2 2 2 1 1 2 1 1 1 2 1 2 2 2 1 2 1 2 2 2 2 ...

result:

ok Accepted

Test #41:

score: 0
Accepted
time: 267ms
memory: 4116kb

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