結果

問題 No.871 かえるのうた
ユーザー titiatitia
提出日時 2019-08-30 22:18:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 327 ms / 2,000 ms
コード長 512 bytes
コンパイル時間 445 ms
コンパイル使用メモリ 86,612 KB
実行使用メモリ 96,200 KB
最終ジャッジ日時 2023-08-20 09:20:09
合計ジャッジ時間 9,217 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,116 KB
testcase_01 AC 75 ms
71,224 KB
testcase_02 AC 80 ms
71,184 KB
testcase_03 AC 88 ms
75,732 KB
testcase_04 AC 83 ms
75,936 KB
testcase_05 AC 84 ms
75,492 KB
testcase_06 AC 82 ms
75,720 KB
testcase_07 AC 84 ms
75,600 KB
testcase_08 AC 95 ms
76,320 KB
testcase_09 AC 94 ms
76,396 KB
testcase_10 AC 82 ms
75,900 KB
testcase_11 AC 86 ms
76,136 KB
testcase_12 AC 117 ms
79,152 KB
testcase_13 AC 100 ms
76,532 KB
testcase_14 AC 223 ms
94,728 KB
testcase_15 AC 238 ms
95,056 KB
testcase_16 AC 262 ms
95,996 KB
testcase_17 AC 213 ms
93,896 KB
testcase_18 AC 110 ms
79,132 KB
testcase_19 AC 278 ms
96,200 KB
testcase_20 AC 101 ms
76,440 KB
testcase_21 AC 169 ms
86,780 KB
testcase_22 AC 82 ms
75,716 KB
testcase_23 AC 76 ms
75,364 KB
testcase_24 AC 75 ms
70,776 KB
testcase_25 AC 90 ms
75,988 KB
testcase_26 AC 109 ms
76,324 KB
testcase_27 AC 106 ms
77,652 KB
testcase_28 AC 78 ms
75,520 KB
testcase_29 AC 170 ms
94,180 KB
testcase_30 AC 227 ms
95,764 KB
testcase_31 AC 90 ms
75,992 KB
testcase_32 AC 251 ms
95,904 KB
testcase_33 AC 233 ms
94,520 KB
testcase_34 AC 118 ms
80,860 KB
testcase_35 AC 176 ms
94,144 KB
testcase_36 AC 200 ms
94,488 KB
testcase_37 AC 168 ms
88,408 KB
testcase_38 AC 253 ms
94,144 KB
testcase_39 AC 327 ms
93,184 KB
testcase_40 AC 205 ms
94,512 KB
testcase_41 AC 72 ms
71,112 KB
testcase_42 AC 199 ms
94,108 KB
testcase_43 AC 74 ms
71,164 KB
testcase_44 AC 79 ms
75,696 KB
testcase_45 AC 93 ms
76,452 KB
testcase_46 AC 76 ms
71,040 KB
testcase_47 AC 75 ms
70,972 KB
testcase_48 AC 75 ms
71,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

K-=1
ANS=[0]*N
PLUS=X[K]+A[K]
MINUS=X[K]-A[K]

for roop in range(100):

    for i in range(N):
        if X[i]<=PLUS and X[i]>=MINUS:
            ANS[i]=1
            PLUS=max(PLUS,X[i]+A[i])
            MINUS=min(MINUS,X[i]-A[i])

    for i in range(N-1,-1,-1):
        if X[i]<=PLUS and X[i]>=MINUS:
            ANS[i]=1
            PLUS=max(PLUS,X[i]+A[i])
            MINUS=min(MINUS,X[i]-A[i])

print(sum(ANS))
0