結果

問題 No.871 かえるのうた
ユーザー syunsukesyunsuke
提出日時 2019-08-31 21:52:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 445 bytes
コンパイル時間 109 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 27,792 KB
最終ジャッジ日時 2024-05-04 02:44:50
合計ジャッジ時間 4,400 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,752 KB
testcase_01 AC 29 ms
10,880 KB
testcase_02 AC 28 ms
10,880 KB
testcase_03 WA -
testcase_04 AC 27 ms
10,880 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 36 ms
12,188 KB
testcase_21 WA -
testcase_22 AC 25 ms
10,752 KB
testcase_23 WA -
testcase_24 AC 26 ms
10,752 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 26 ms
10,880 KB
testcase_42 AC 85 ms
17,472 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 27 ms
10,752 KB
testcase_47 AC 28 ms
10,752 KB
testcase_48 AC 27 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
P=list(map(int,input().split()))
INF=float('inf')
P=[-INF]+P+[INF]
A=list(map(int,input().split()))
A=[0]+A+[0]


L=-A[K]
R=A[K]

for i in range(10**5+5):
    if L<=P[K-i]:
        if L>P[K-i]-A[K-i]:
            L=P[K-i]-A[K-i]
    else:
        break
#print(i)

for j in range(10**5+5):
    if R>=P[K+j]:
        if R<P[K+j]+A[K+j]:
            R=P[K+j]+A[K+j]
    else:
        break
#print(j)
print(max(i+j-1,1))
0