Submission #3816995


Source Code Expand

N,M,D=map(int,input().split())
A=list(map(int,input().split()))
INI=list(range(N))
P=list(range(N))

for a in A:
    P[a],P[a-1]=P[a-1],P[a]

T=P
#print(T)

R=[None]*N
for i in range(N):
    R[P[i]]=i

#print(R)
    
def NEXT(P):
    ANS=[None]*N
    for i in range(N):
        ANS[T[i]]=P[i]

    return ANS

NOW=list(range(N))
for i in range(10**10):
    NOW=NEXT(NOW)
    #print(NOW)
    if NOW==INI:
        rep=i+1
        break

rest=D%rep

P=list(range(N))
for i in range(rest):
    P=NEXT(P)

for p in P:
    print(p+1)

Submission Info

Submission Time
Task D - 阿弥陀
User titia
Language Python (3.4.3)
Score 20
Code Size 566 Byte
Status TLE
Exec Time 4205 ms
Memory 31956 KB

Judge Result

Set Name Subtask1 Subtask2 Subtask3 Subtask4
Score / Max Score 0 / 10 0 / 20 20 / 20 0 / 50
Status
AC × 5
TLE × 4
AC × 7
TLE × 11
AC × 18
AC × 4
TLE × 25
Set Name Test Cases
Subtask1 sample_1.txt, 01_i.txt, 01_random01.txt, 01_random02.txt, 01_random03.txt, 01_random04.txt, 01_random05.txt, 01_random06.txt, 01_random07.txt
Subtask2 sample_1.txt, sample_2.txt, sample_3.txt, 02_i.txt, 02_p.txt, 02_random01.txt, 02_random02.txt, 02_random03.txt, 02_random04.txt, 02_random05.txt, 02_random06.txt, 02_random07.txt, 02_random08.txt, 02_rp01.txt, 02_rp02.txt, 02_rp03.txt, 02_rp04.txt, 02_rp05.txt
Subtask3 sample_1.txt, sample_2.txt, 03_i.txt, 03_random01.txt, 03_random02.txt, 03_random03.txt, 03_random04.txt, 03_random05.txt, 03_random06.txt, 03_random07.txt, 03_random08.txt, 03_random09.txt, 03_random10.txt, 03_random11.txt, 03_random12.txt, 03_random13.txt, 03_random14.txt, 03_random15.txt
Subtask4 sample_1.txt, sample_2.txt, sample_3.txt, 04_i.txt, 04_p1.txt, 04_p2.txt, 04_random01.txt, 04_random02.txt, 04_random03.txt, 04_random04.txt, 04_random05.txt, 04_random06.txt, 04_random07.txt, 04_random08.txt, 04_random09.txt, 04_random10.txt, 04_random11.txt, 04_random12.txt, 04_random13.txt, 04_rp01.txt, 04_rp02.txt, 04_rp03.txt, 04_rp04.txt, 04_rp05.txt, 04_rp06.txt, 04_rp07.txt, 04_rp08.txt, 04_rp09.txt, 04_rp10.txt
Case Name Status Exec Time Memory
01_i.txt AC 242 ms 31956 KB
01_random01.txt AC 17 ms 3064 KB
01_random02.txt AC 17 ms 3064 KB
01_random03.txt AC 17 ms 3064 KB
01_random04.txt TLE 4204 ms 4212 KB
01_random05.txt TLE 4205 ms 21080 KB
01_random06.txt TLE 4205 ms 26376 KB
01_random07.txt TLE 4204 ms 29932 KB
02_i.txt AC 19 ms 3444 KB
02_p.txt TLE 4203 ms 3188 KB
02_random01.txt AC 17 ms 3064 KB
02_random02.txt AC 17 ms 3064 KB
02_random03.txt TLE 4204 ms 3444 KB
02_random04.txt AC 18 ms 3316 KB
02_random05.txt TLE 4204 ms 5100 KB
02_random06.txt TLE 4204 ms 12772 KB
02_random07.txt TLE 4204 ms 22732 KB
02_random08.txt TLE 4204 ms 23404 KB
02_rp01.txt TLE 4203 ms 3188 KB
02_rp02.txt TLE 4203 ms 3188 KB
02_rp03.txt TLE 4203 ms 3188 KB
02_rp04.txt TLE 4204 ms 3188 KB
02_rp05.txt TLE 4203 ms 3188 KB
03_i.txt AC 17 ms 3064 KB
03_random01.txt AC 25 ms 3316 KB
03_random02.txt AC 92 ms 6392 KB
03_random03.txt AC 80 ms 5964 KB
03_random04.txt AC 78 ms 5840 KB
03_random05.txt AC 29 ms 3776 KB
03_random06.txt AC 29 ms 3700 KB
03_random07.txt AC 35 ms 3880 KB
03_random08.txt AC 18 ms 3064 KB
03_random09.txt AC 40 ms 4108 KB
03_random10.txt AC 58 ms 5284 KB
03_random11.txt AC 91 ms 6328 KB
03_random12.txt AC 91 ms 6416 KB
03_random13.txt AC 81 ms 5656 KB
03_random14.txt AC 63 ms 5304 KB
03_random15.txt AC 35 ms 3880 KB
04_i.txt AC 236 ms 31640 KB
04_p1.txt TLE 4205 ms 23988 KB
04_p2.txt TLE 4205 ms 19280 KB
04_random01.txt TLE 4204 ms 16344 KB
04_random02.txt TLE 4204 ms 12132 KB
04_random03.txt TLE 4204 ms 14476 KB
04_random04.txt TLE 4204 ms 23112 KB
04_random05.txt TLE 4204 ms 19412 KB
04_random06.txt TLE 4204 ms 16336 KB
04_random07.txt TLE 4204 ms 22964 KB
04_random08.txt TLE 4204 ms 20964 KB
04_random09.txt TLE 4204 ms 24484 KB
04_random10.txt TLE 4204 ms 17400 KB
04_random11.txt TLE 4205 ms 27632 KB
04_random12.txt TLE 4204 ms 30748 KB
04_random13.txt TLE 4205 ms 27632 KB
04_rp01.txt TLE 4205 ms 24036 KB
04_rp02.txt TLE 4205 ms 23676 KB
04_rp03.txt TLE 4205 ms 24148 KB
04_rp04.txt TLE 4205 ms 24036 KB
04_rp05.txt TLE 4205 ms 23676 KB
04_rp06.txt TLE 4204 ms 26188 KB
04_rp07.txt TLE 4205 ms 23676 KB
04_rp08.txt TLE 4205 ms 23676 KB
04_rp09.txt TLE 4204 ms 26164 KB
04_rp10.txt TLE 4205 ms 24036 KB
sample_1.txt AC 17 ms 3064 KB
sample_2.txt AC 17 ms 3064 KB
sample_3.txt AC 17 ms 3064 KB