cp-library

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub kobejean/cp-library

:warning: cp_library/alg/divcon/bisect_right_fn.py

Code

import cp_library.__header__
import cp_library.alg.__header__
import cp_library.alg.divcon.__header__

def bisect_right(A, x, l, r):
    while l<r:
        if x<A[m:=(l+r)>>1]:r=m
        else:l=m+1
    return l
'''
╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
             https://kobejean.github.io/cp-library               
'''



def bisect_right(A, x, l, r):
    while l<r:
        if x<A[m:=(l+r)>>1]:r=m
        else:l=m+1
    return l
Back to top page