about summary refs log tree commit diff
path: root/others/other/kite.py
diff options
context:
space:
mode:
Diffstat (limited to 'others/other/kite.py')
-rwxr-xr-xothers/other/kite.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/others/other/kite.py b/others/other/kite.py
new file mode 100755
index 0000000..0330b01
--- /dev/null
+++ b/others/other/kite.py
@@ -0,0 +1,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)