about summary refs log tree commit diff
path: root/others/other/kite.py
blob: 0330b019bb005aa0c930d5e7fa9c308cd0662d1c (plain) (blame)
1
2
3
4
5
6
7
8
9
#!/usr/bin/env python3
from bisect import bisect_left, insort

with open('KITE.INP') as inp, open('KITE.OUT', 'w') as out:
    n, a = inp.readline(), []
    for line in inp:
        x = -int(line)
        insort(a, x)
        print(bisect_left(a, x) + 1, file=out)