回答編集履歴
1
対応関係
answer
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
lower_boundはbisect_leftに
|
1
|
+
lower_boundはpythonでいうとbisect_leftにあたります。
|
2
|
+
なので、```A.begin() - lower_bound(A.begin(), A.begin()+i, v)```は```- bisect.bisect_left(A[0:i], v)```に対応します。
|
3
|
+
|
2
4
|
```python
|
3
5
|
import bisect
|
4
6
|
cnt += i - bisect.bisect_left(A[0:i], v)
|