diff options
author | Raphael McSinyx <vn.mcsinyx@gmail.com> | 2017-01-10 21:30:06 +0700 |
---|---|---|
committer | Raphael McSinyx <vn.mcsinyx@gmail.com> | 2017-01-10 21:35:08 +0700 |
commit | 7c9b47ab9149d292d5493c865dfb8742a7450472 (patch) | |
tree | c2b8d9759740b02b9dc157b84f32c2860369bf3b /others/dict/dict.py | |
parent | f4f486fb4b37b72ca345f95881e44043c728b2c3 (diff) | |
download | cp-7c9b47ab9149d292d5493c865dfb8742a7450472.tar.gz |
others/other: Add {bin,game}.pas and move others/dict here
Diffstat (limited to 'others/dict/dict.py')
-rwxr-xr-x | others/dict/dict.py | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/others/dict/dict.py b/others/dict/dict.py deleted file mode 100755 index 76b8414..0000000 --- a/others/dict/dict.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env python3 - -from itertools import islice -from bisect import bisect_left as bisect - - -with open('dict.inp') as fi, open('dict.out', 'w') as fo: - words = list(islice(fi, int(fi.readline()))) - words.sort() - - for _ in range(int(fi.readline())): - s = fi.readline().strip() - i = bisect(words, s) - count = 0 - while i + count < len(words) and words[i + count].startswith(s): - count += 1 - fo.write("{}\n".format(count)) |