Submission #41278872
Source Code Expand
input()
A=list(map(int,input().split()))
while True:
operated=False
for i in range(len(A)-1):
if abs(A[i]-A[i+1])!=1:
if A[i]<A[i+1]:
A[i+1:i+1]=list(range(A[i]+1,A[i+1]))
elif A[i]>A[i+1]:
A[i+1:i+1]=list(range(A[i]-1,A[i+1],-1))
operated=True
break
if not operated:
break
print(*A)
Submission Info
| Submission Time | |
|---|---|
| Task | B - Fill the Gaps |
| User | kyopro_friends |
| Language | PyPy3 (7.3.0) |
| Score | 200 |
| Code Size | 355 Byte |
| Status | AC |
| Exec Time | 82 ms |
| Memory | 74580 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt |
| All | random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, sample_01.txt, sample_02.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| random_01.txt | AC | 82 ms | 74580 KiB |
| random_02.txt | AC | 67 ms | 74428 KiB |
| random_03.txt | AC | 71 ms | 74516 KiB |
| random_04.txt | AC | 70 ms | 74360 KiB |
| random_05.txt | AC | 72 ms | 74376 KiB |
| random_06.txt | AC | 72 ms | 74424 KiB |
| random_07.txt | AC | 51 ms | 61988 KiB |
| random_08.txt | AC | 48 ms | 61664 KiB |
| sample_01.txt | AC | 49 ms | 61908 KiB |
| sample_02.txt | AC | 46 ms | 61660 KiB |