結果
問題 | No.871 かえるのうた |
ユーザー | yakeshiba |
提出日時 | 2020-09-23 05:37:45 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 601 bytes |
コンパイル時間 | 72 ms |
コンパイル使用メモリ | 10,812 KB |
実行使用メモリ | 24,664 KB |
最終ジャッジ日時 | 2023-09-09 15:18:44 |
合計ジャッジ時間 | 4,005 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 16 ms
8,200 KB |
testcase_01 | WA | - |
testcase_02 | AC | 16 ms
8,268 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 15 ms
8,140 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | AC | 16 ms
8,392 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | AC | 83 ms
24,164 KB |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | AC | 77 ms
22,844 KB |
testcase_18 | AC | 27 ms
10,968 KB |
testcase_19 | WA | - |
testcase_20 | RE | - |
testcase_21 | WA | - |
testcase_22 | RE | - |
testcase_23 | AC | 16 ms
8,212 KB |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | AC | 16 ms
8,240 KB |
testcase_29 | AC | 46 ms
15,164 KB |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | AC | 32 ms
12,500 KB |
testcase_35 | WA | - |
testcase_36 | AC | 66 ms
20,848 KB |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | AC | 16 ms
8,040 KB |
testcase_42 | RE | - |
testcase_43 | WA | - |
testcase_44 | WA | - |
testcase_45 | WA | - |
testcase_46 | AC | 16 ms
8,252 KB |
testcase_47 | AC | 15 ms
8,268 KB |
testcase_48 | AC | 16 ms
8,212 KB |
ソースコード
import bisect n, k = map(int,input().split()) X = list(map(int,input().split())) A = list(map(int,input().split())) r = [0]*n r[k-1] = 1 L = [X[k-1]-A[k-1]] R = [X[k-1]+A[k-1]] lprev, rprev = n-1, 0 left, right = 0, n-1 while not (lprev == left and right == rprev): left = bisect.bisect_left(X,min(L)) right = bisect.bisect_left(X,max(R)) if X[right] != max(R): right -= 1 L = [] R = [] for i in range(left,right+1): r[i] = 1 L.append(X[i]-A[i]) R.append(X[i]+A[i]) lprev = min(lprev,left) rprev = max(rprev,right) print(sum(r))