This documentation is automatically generated by online-judge-tools/verification-helper
import cp_library.alg.iter.__header__
def argsort_bounded(A, mx):
I, cnt, t = [0]*len(A), [0]*(mx+1), 0
for a in A: cnt[a] += 1
for i in range(mx+1): cnt[i], t = t, t+cnt[i]
for i,a in enumerate(A): I[cnt[a]] = i; cnt[a] += 1
return I
'''
╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
https://kobejean.github.io/cp-library
'''
def argsort_bounded(A, mx):
I, cnt, t = [0]*len(A), [0]*(mx+1), 0
for a in A: cnt[a] += 1
for i in range(mx+1): cnt[i], t = t, t+cnt[i]
for i,a in enumerate(A): I[cnt[a]] = i; cnt[a] += 1
return I