結果

問題 No.871 かえるのうた
ユーザー もりをもりを
提出日時 2019-08-30 21:28:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 476 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 82,496 KB
実行使用メモリ 98,944 KB
最終ジャッジ日時 2024-05-01 16:42:32
合計ジャッジ時間 4,378 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,480 KB
testcase_01 WA -
testcase_02 AC 41 ms
51,968 KB
testcase_03 AC 38 ms
51,968 KB
testcase_04 AC 37 ms
52,224 KB
testcase_05 AC 41 ms
51,968 KB
testcase_06 WA -
testcase_07 AC 37 ms
52,096 KB
testcase_08 AC 40 ms
58,752 KB
testcase_09 AC 41 ms
59,648 KB
testcase_10 AC 40 ms
58,368 KB
testcase_11 AC 39 ms
58,624 KB
testcase_12 AC 46 ms
67,584 KB
testcase_13 AC 40 ms
59,904 KB
testcase_14 AC 90 ms
93,428 KB
testcase_15 AC 89 ms
93,452 KB
testcase_16 AC 100 ms
94,248 KB
testcase_17 AC 91 ms
95,032 KB
testcase_18 AC 47 ms
68,096 KB
testcase_19 WA -
testcase_20 AC 47 ms
64,768 KB
testcase_21 AC 67 ms
83,232 KB
testcase_22 AC 36 ms
51,712 KB
testcase_23 AC 36 ms
51,968 KB
testcase_24 AC 37 ms
51,968 KB
testcase_25 AC 43 ms
60,416 KB
testcase_26 AC 44 ms
64,000 KB
testcase_27 AC 43 ms
64,896 KB
testcase_28 AC 36 ms
51,968 KB
testcase_29 AC 62 ms
87,168 KB
testcase_30 AC 83 ms
97,664 KB
testcase_31 AC 39 ms
59,136 KB
testcase_32 AC 78 ms
95,104 KB
testcase_33 WA -
testcase_34 AC 51 ms
70,016 KB
testcase_35 AC 67 ms
88,704 KB
testcase_36 AC 82 ms
98,944 KB
testcase_37 AC 66 ms
84,608 KB
testcase_38 AC 91 ms
95,436 KB
testcase_39 WA -
testcase_40 AC 65 ms
87,680 KB
testcase_41 AC 36 ms
52,096 KB
testcase_42 AC 62 ms
86,928 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 36 ms
52,352 KB
testcase_47 AC 36 ms
52,180 KB
testcase_48 AC 36 ms
51,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
x = list(map(int,input().split()))
a = list(map(int,input().split()))
k -= 1

res = 1

# left
piv = k - 1
til = x[k] - a[k]
while piv >= 0:
    if x[piv] >= til:
        res += 1
        til = min(til, x[piv] - a[piv])
        piv -= 1
    else:
        break

# right
piv = k + 1
til = x[k] + a[k]
while piv < n:
    if x[piv] <= til:
        res += 1
        til = max(til, x[piv] + a[piv])
        piv += 1
    else:
        break

print(res)
0