結果
問題 | No.871 かえるのうた |
ユーザー |
|
提出日時 | 2020-09-23 05:08:09 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 571 bytes |
コンパイル時間 | 650 ms |
コンパイル使用メモリ | 10,884 KB |
実行使用メモリ | 24,828 KB |
最終ジャッジ日時 | 2023-09-09 14:08:32 |
合計ジャッジ時間 | 6,352 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 16 ms
7,928 KB |
testcase_01 | WA | - |
testcase_02 | AC | 16 ms
8,044 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
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 | AC | 75 ms
22,804 KB |
testcase_18 | AC | 26 ms
10,944 KB |
testcase_19 | WA | - |
testcase_20 | AC | 25 ms
9,884 KB |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | AC | 16 ms
8,008 KB |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | AC | 46 ms
15,164 KB |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | AC | 31 ms
12,464 KB |
testcase_35 | WA | - |
testcase_36 | AC | 66 ms
20,952 KB |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | AC | 16 ms
8,096 KB |
testcase_42 | AC | 76 ms
17,844 KB |
testcase_43 | WA | - |
testcase_44 | WA | - |
testcase_45 | WA | - |
testcase_46 | AC | 15 ms
7,984 KB |
testcase_47 | AC | 15 ms
7,884 KB |
testcase_48 | AC | 16 ms
8,036 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 = n-1 rprev = -1 left = 0 right = n-1 while not (lprev <= left and right <= rprev): left = bisect.bisect_left(X,min(L)) right = bisect.bisect_right(X,max(R))-bisect.bisect_right(X,min(L)) L = [] R = [] for i in range(left,min(n,right+1)): r[i] = 1 L.append(X[i]-A[i]) R.append(X[i]+A[i]) lprev = left rprev = right print(sum(r))