about summary refs log tree commit diff
path: root/others/other/kite.py
diff options
context:
space:
mode:
authorRaphael McSinyx <vn.mcsinyx@gmail.com>2017-07-24 02:23:37 +0700
committerRaphael McSinyx <vn.mcsinyx@gmail.com>2017-07-24 02:26:15 +0700
commitce427c0741ff51539e5410710dd04a11d8d22b4f (patch)
tree7b12163e0a665ae8d9cb3e482257062457619aa1 /others/other/kite.py
parent1ceb9227cb48d50f57343fa42c32815b94855488 (diff)
downloadcp-ce427c0741ff51539e5410710dd04a11d8d22b4f.tar.gz
Add others/other/{cube,kite}.py
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)