提出 #41278934


ソースコード 拡げる

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)

提出情報

提出日時
問題 B - Fill the Gaps
ユーザ kyopro_friends
言語 PyPy3 (7.3.0)
得点 200
コード長 215 Byte
結果 AC
実行時間 96 ms
メモリ 74448 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 2
AC × 10
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
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