Submission #18589483
Source Code Expand
n,*P=map(int,open(j:=0).read().split())
A=[]
for i in range(n):
if P[i]!=i+1:
while j<n and P[j]!=i+1:j+=1
P=P[:i]+[i+1]+P[i:j]+P[j+1:]
A+=[*range(j,i,-1)]
print(A if len(A)==n-1else-1)
Submission Info
| Submission Time | |
|---|---|
| Task | C - Exoswap |
| User | snowrabbit |
| Language | Python (3.8.2) |
| Score | 0 |
| Code Size | 206 Byte |
| Status | WA |
| Exec Time | 2267 ms |
| Memory | 1890364 KiB |
Judge Result
| Set Name | All | Sample | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 500 | 0 / 0 | ||||||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| All | sample_01.txt, sample_02.txt, testcase_1.txt, testcase_10.txt, testcase_11.txt, testcase_12.txt, testcase_13.txt, testcase_14.txt, testcase_15.txt, testcase_16.txt, testcase_17.txt, testcase_18.txt, testcase_19.txt, testcase_2.txt, testcase_20.txt, testcase_21.txt, testcase_22.txt, testcase_23.txt, testcase_24.txt, testcase_25.txt, testcase_26.txt, testcase_27.txt, testcase_28.txt, testcase_29.txt, testcase_3.txt, testcase_30.txt, testcase_31.txt, testcase_32.txt, testcase_33.txt, testcase_34.txt, testcase_35.txt, testcase_36.txt, testcase_37.txt, testcase_38.txt, testcase_39.txt, testcase_4.txt, testcase_40.txt, testcase_41.txt, testcase_42.txt, testcase_43.txt, testcase_44.txt, testcase_45.txt, testcase_46.txt, testcase_47.txt, testcase_48.txt, testcase_49.txt, testcase_5.txt, testcase_50.txt, testcase_51.txt, testcase_52.txt, testcase_53.txt, testcase_54.txt, testcase_55.txt, testcase_56.txt, testcase_57.txt, testcase_6.txt, testcase_7.txt, testcase_8.txt, testcase_9.txt |
| Sample | sample_01.txt, sample_02.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| sample_01.txt | WA | 30 ms | 8908 KiB |
| sample_02.txt | AC | 21 ms | 8896 KiB |
| testcase_1.txt | AC | 18 ms | 8892 KiB |
| testcase_10.txt | TLE | 2267 ms | 1800352 KiB |
| testcase_11.txt | TLE | 2265 ms | 1766156 KiB |
| testcase_12.txt | TLE | 2265 ms | 1791748 KiB |
| testcase_13.txt | TLE | 2267 ms | 1890364 KiB |
| testcase_14.txt | TLE | 2206 ms | 31564 KiB |
| testcase_15.txt | TLE | 2206 ms | 31408 KiB |
| testcase_16.txt | TLE | 2206 ms | 31372 KiB |
| testcase_17.txt | TLE | 2206 ms | 31564 KiB |
| testcase_18.txt | TLE | 2206 ms | 31384 KiB |
| testcase_19.txt | TLE | 2206 ms | 31500 KiB |
| testcase_2.txt | WA | 26 ms | 8828 KiB |
| testcase_20.txt | TLE | 2206 ms | 31532 KiB |
| testcase_21.txt | TLE | 2206 ms | 31388 KiB |
| testcase_22.txt | TLE | 2206 ms | 31432 KiB |
| testcase_23.txt | TLE | 2206 ms | 31408 KiB |
| testcase_24.txt | TLE | 2206 ms | 31396 KiB |
| testcase_25.txt | TLE | 2206 ms | 31428 KiB |
| testcase_26.txt | TLE | 2206 ms | 31544 KiB |
| testcase_27.txt | TLE | 2206 ms | 31388 KiB |
| testcase_28.txt | TLE | 2206 ms | 23000 KiB |
| testcase_29.txt | WA | 109 ms | 9272 KiB |
| testcase_3.txt | AC | 26 ms | 8796 KiB |
| testcase_30.txt | TLE | 2206 ms | 30024 KiB |
| testcase_31.txt | TLE | 2206 ms | 28364 KiB |
| testcase_32.txt | TLE | 2206 ms | 14000 KiB |
| testcase_33.txt | TLE | 2206 ms | 27916 KiB |
| testcase_34.txt | TLE | 2206 ms | 31564 KiB |
| testcase_35.txt | TLE | 2206 ms | 31416 KiB |
| testcase_36.txt | TLE | 2206 ms | 31408 KiB |
| testcase_37.txt | TLE | 2206 ms | 31464 KiB |
| testcase_38.txt | TLE | 2206 ms | 31548 KiB |
| testcase_39.txt | TLE | 2206 ms | 31376 KiB |
| testcase_4.txt | AC | 24 ms | 8892 KiB |
| testcase_40.txt | TLE | 2206 ms | 31620 KiB |
| testcase_41.txt | TLE | 2206 ms | 15700 KiB |
| testcase_42.txt | TLE | 2206 ms | 26268 KiB |
| testcase_43.txt | TLE | 2206 ms | 23812 KiB |
| testcase_44.txt | TLE | 2206 ms | 31416 KiB |
| testcase_45.txt | TLE | 2206 ms | 31456 KiB |
| testcase_46.txt | TLE | 2206 ms | 31392 KiB |
| testcase_47.txt | TLE | 2206 ms | 31448 KiB |
| testcase_48.txt | TLE | 2206 ms | 31524 KiB |
| testcase_49.txt | TLE | 2206 ms | 31516 KiB |
| testcase_5.txt | AC | 20 ms | 8864 KiB |
| testcase_50.txt | TLE | 2206 ms | 31428 KiB |
| testcase_51.txt | TLE | 2206 ms | 14192 KiB |
| testcase_52.txt | TLE | 2206 ms | 13336 KiB |
| testcase_53.txt | TLE | 2206 ms | 13972 KiB |
| testcase_54.txt | WA | 146 ms | 31540 KiB |
| testcase_55.txt | TLE | 2206 ms | 31384 KiB |
| testcase_56.txt | AC | 88 ms | 31412 KiB |
| testcase_57.txt | TLE | 2262 ms | 1676788 KiB |
| testcase_6.txt | WA | 22 ms | 8788 KiB |
| testcase_7.txt | WA | 19 ms | 8792 KiB |
| testcase_8.txt | AC | 26 ms | 8952 KiB |
| testcase_9.txt | TLE | 2262 ms | 1636952 KiB |