Submission #41278934


Source Code Expand

input()
A=list(map(int,input().split()))

i=0
while i<len(A)-1:
  if abs(A[i]-A[i+1])!=1:
    if A[i]<A[i+1]:
      A.insert(i+1,A[i]+1)
    elif A[i]>A[i+1]:
      A.insert(i+1,A[i]-1)
  i+=1

print(*A)

Submission Info

Submission Time
Task B - Fill the Gaps
User kyopro_friends
Language PyPy3 (7.3.0)
Score 200
Code Size 215 Byte
Status AC
Exec Time 96 ms
Memory 74448 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 10
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 96 ms 74384 KiB
random_02.txt AC 68 ms 72156 KiB
random_03.txt AC 73 ms 74412 KiB
random_04.txt AC 75 ms 74028 KiB
random_05.txt AC 76 ms 74448 KiB
random_06.txt AC 73 ms 73824 KiB
random_07.txt AC 52 ms 61836 KiB
random_08.txt AC 50 ms 61576 KiB
sample_01.txt AC 53 ms 61732 KiB
sample_02.txt AC 53 ms 61804 KiB