結果

問題 No.871 かえるのうた
コンテスト
ユーザー na-sh
提出日時 2019-09-03 14:18:33
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
RE  
実行時間 -
コード長 345 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 56 ms
コンパイル使用メモリ 14,848 KB
実行使用メモリ 28,144 KB
最終ジャッジ日時 2026-10-06 21:52:46
合計ジャッジ時間 21,816 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 11 RE * 11 TLE * 4 -- * 18
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N, K = map(int, input().split())
X = list(map(int, input().split()))
A = list(map(int, input().split()))

hear = [K-1]
cried = set()
while len(hear):
    h = hear.pop()
    cried.add(h)
    for i, c in enumerate(X):
        if X[h] - A[h] <= c <= X[h] + A[h] and i not in cried:
            hear.append(i)
            X.pop(i)
print(len(cried))
0