diff options
author | Nguyễn Gia Phong <vn.mcsinyx@gmail.com> | 2018-10-20 11:27:47 +0700 |
---|---|---|
committer | Nguyễn Gia Phong <vn.mcsinyx@gmail.com> | 2018-10-20 11:27:47 +0700 |
commit | 4c5ed94087a691ce47882786aea64f7b5bf3c130 (patch) | |
tree | 6ebb9374e9c9e1d867659a1de166fbe8f6481b19 /codechef/qualprel.py | |
parent | 662168dbd56cbeba35bea782d580b0f7cc9a3ac2 (diff) | |
download | cp-4c5ed94087a691ce47882786aea64f7b5bf3c130.tar.gz |
Bon appétit
Diffstat (limited to 'codechef/qualprel.py')
-rwxr-xr-x | codechef/qualprel.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/codechef/qualprel.py b/codechef/qualprel.py new file mode 100755 index 0000000..400974c --- /dev/null +++ b/codechef/qualprel.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python2 +from bisect import bisect_right +from sys import stdin + +for _ in xrange(int(stdin.readline())): + n, k = map(int, stdin.readline().split()) + s = [1000000000 - int(i) for i in stdin.readline().split()] + s.sort() + print bisect_right(s, s[k - 1]) |