提出 #920034
ソースコード 拡げる
def func(s, di):
ret = 0
for i, c in enumerate(s[::-1]):
if c in di:
ret += (27 ** i) * di[c]
return ret
n = input()
ss = [raw_input() for i in range(n)]
q = input()
same_len = max([len(s) for s in ss])
same_len_ss = [s.ljust(same_len, "0") for s in ss]
# print same_len_ss
for i in range(q):
k, ps = raw_input().split()
di = {ps[i]: i + 1 for i in range(26)}
numerized = [func(same_len_s, di) for same_len_s in same_len_ss]
# print numerized[k - 1]
print sorted(numerized).index(numerized[int(k) - 1]) + 1
提出情報
| 提出日時 | |
|---|---|
| 問題 | E - Lexicographical disorder |
| ユーザ | gamma1129 |
| 言語 | Python (2.7.6) |
| 得点 | 0 |
| コード長 | 583 Byte |
| 結果 | TLE |
| 実行時間 | 6303 ms |
| メモリ | 24264 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 0 / 1100 | ||||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | s1.txt, s2.txt |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 27.txt, 28.txt, 29.txt, 30.txt, 31.txt, 32.txt, 33.txt, 34.txt, 35.txt, 36.txt, 37.txt, 38.txt, 39.txt, 40.txt, s1.txt, s2.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 01.txt | TLE | 6303 ms | 24248 KiB |
| 02.txt | TLE | 6303 ms | 24260 KiB |
| 03.txt | TLE | 6303 ms | 24256 KiB |
| 04.txt | TLE | 6303 ms | 24264 KiB |
| 05.txt | TLE | 6303 ms | 11400 KiB |
| 06.txt | TLE | 6302 ms | 7496 KiB |
| 07.txt | TLE | 6302 ms | 7088 KiB |
| 08.txt | TLE | 6302 ms | 6660 KiB |
| 09.txt | TLE | 6302 ms | 6276 KiB |
| 10.txt | TLE | 6302 ms | 6404 KiB |
| 11.txt | TLE | 6303 ms | 12940 KiB |
| 12.txt | TLE | 6303 ms | 14404 KiB |
| 13.txt | TLE | 6303 ms | 16824 KiB |
| 14.txt | TLE | 6302 ms | 7496 KiB |
| 15.txt | TLE | 6302 ms | 6276 KiB |
| 16.txt | TLE | 6302 ms | 6404 KiB |
| 17.txt | TLE | 6302 ms | 6912 KiB |
| 18.txt | TLE | 6303 ms | 8188 KiB |
| 19.txt | TLE | 6302 ms | 8136 KiB |
| 20.txt | TLE | 6303 ms | 8192 KiB |
| 21.txt | TLE | 6303 ms | 8188 KiB |
| 22.txt | TLE | 6303 ms | 8160 KiB |
| 23.txt | TLE | 6303 ms | 13404 KiB |
| 24.txt | TLE | 6303 ms | 12932 KiB |
| 25.txt | TLE | 6303 ms | 14100 KiB |
| 26.txt | TLE | 6303 ms | 8324 KiB |
| 27.txt | TLE | 6303 ms | 8276 KiB |
| 28.txt | TLE | 6303 ms | 8848 KiB |
| 29.txt | TLE | 6302 ms | 7684 KiB |
| 30.txt | TLE | 6303 ms | 11000 KiB |
| 31.txt | TLE | 6303 ms | 7904 KiB |
| 32.txt | TLE | 6302 ms | 6916 KiB |
| 33.txt | TLE | 6302 ms | 6916 KiB |
| 34.txt | TLE | 6302 ms | 6916 KiB |
| 35.txt | TLE | 6302 ms | 6788 KiB |
| 36.txt | TLE | 6303 ms | 19828 KiB |
| 37.txt | TLE | 6302 ms | 6524 KiB |
| 38.txt | TLE | 6302 ms | 6524 KiB |
| 39.txt | AC | 16 ms | 2692 KiB |
| 40.txt | AC | 16 ms | 2692 KiB |
| s1.txt | AC | 16 ms | 2692 KiB |
| s2.txt | AC | 16 ms | 2692 KiB |