diff options
author | Raphael McSinyx <vn.mcsinyx@gmail.com> | 2017-07-24 02:23:37 +0700 |
---|---|---|
committer | Raphael McSinyx <vn.mcsinyx@gmail.com> | 2017-07-24 02:26:15 +0700 |
commit | ce427c0741ff51539e5410710dd04a11d8d22b4f (patch) | |
tree | 7b12163e0a665ae8d9cb3e482257062457619aa1 /others/other/kite.py | |
parent | 1ceb9227cb48d50f57343fa42c32815b94855488 (diff) | |
download | cp-ce427c0741ff51539e5410710dd04a11d8d22b4f.tar.gz |
Add others/other/{cube,kite}.py
Diffstat (limited to 'others/other/kite.py')
-rwxr-xr-x | others/other/kite.py | 9 |
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) |