提出 #32728086


ソースコード 拡げる

import numpy as np

n, k, q = map(int, input().strip().split())

A = [int(a) for a in input().strip().split()]

L = [int(l) for l in input().strip().split()]

masu = [0]*n

for i, a in enumerate(A):
    masu[a-1] = 1

masu = np.array(masu)
if n==k:
    pass
else:

    for l in L:
        P = [r for r in np.nonzero(masu)[0]]
        #print(*[1+t for t in np.nonzero(masu)])
        p = P[l-1]
        if p+1==n:
            continue
        if masu[p+1]==0:
            masu[p+1]=1
            masu[p]=0
      
print(" ".join([str(1+t) for t in np.nonzero(masu)[0]]))

提出情報

提出日時
問題 B - 1D Pawn
ユーザ rsypoz
言語 Python (3.8.2)
得点 200
コード長 600 Byte
結果 AC
実行時間 137 ms
メモリ 27188 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 19
セット名 テストケース
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 131 ms 26972 KiB
example_01.txt AC 120 ms 26796 KiB
example_02.txt AC 121 ms 26804 KiB
hand_00.txt AC 121 ms 26832 KiB
hand_01.txt AC 132 ms 26960 KiB
hand_02.txt AC 137 ms 27188 KiB
hand_03.txt AC 123 ms 26856 KiB
hand_04.txt AC 123 ms 26900 KiB
hand_05.txt AC 124 ms 26664 KiB
random_00.txt AC 125 ms 27028 KiB
random_01.txt AC 128 ms 26920 KiB
random_02.txt AC 128 ms 26800 KiB
random_03.txt AC 126 ms 26612 KiB
random_04.txt AC 124 ms 26616 KiB
random_05.txt AC 129 ms 26792 KiB
random_06.txt AC 130 ms 26620 KiB
random_07.txt AC 129 ms 26996 KiB
random_08.txt AC 129 ms 27120 KiB
random_09.txt AC 133 ms 26796 KiB