Submission #3724040
Source Code Expand
s = input() K = int(input()) dict1 = {} for i in range(len(s)): if s[i] in dict1: continue else: dict1[s[i]] = len(s) - i dict1 = list(dict1.items()) dict1.sort() count = 0 for e in dict1: count += e[1] if count >= K: note = e[0] break part_list = [] for i in range(len(s)): if ord(s[i]) <= ord(note): for j in range(i+1,len(s)+1): part = s[i:j] part_list.append(part) part_list = list(set(part_list)) part_list.sort() ans = part_list[K-1] print(ans)
Submission Info
Submission Time | |
---|---|
Task | C - K-th Substring |
User | pynomi |
Language | Python (3.4.3) |
Score | 200 |
Code Size | 559 Byte |
Status | TLE |
Exec Time | 2330 ms |
Memory | 935652 KB |
Judge Result
Set Name | Sample | Subtask | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | 0 / 100 | ||||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt, 0_002.txt |
Subtask | 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt |
All | 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 2_011.txt, 2_012.txt, 2_013.txt, 2_014.txt, 2_015.txt, 2_016.txt, 2_017.txt, 2_018.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | AC | 17 ms | 3064 KB |
0_001.txt | AC | 17 ms | 3064 KB |
0_002.txt | AC | 17 ms | 3064 KB |
1_003.txt | AC | 17 ms | 3064 KB |
1_004.txt | AC | 17 ms | 3064 KB |
1_005.txt | AC | 17 ms | 3064 KB |
1_006.txt | AC | 18 ms | 3064 KB |
1_007.txt | AC | 17 ms | 3064 KB |
1_008.txt | AC | 17 ms | 3064 KB |
1_009.txt | AC | 17 ms | 3064 KB |
1_010.txt | AC | 17 ms | 3064 KB |
2_011.txt | TLE | 2202 ms | -606196 KB |
2_012.txt | TLE | 2330 ms | -606100 KB |
2_013.txt | AC | 1809 ms | 622928 KB |
2_014.txt | TLE | 2161 ms | 935652 KB |
2_015.txt | AC | 989 ms | 326720 KB |
2_016.txt | TLE | 2153 ms | 814436 KB |
2_017.txt | TLE | 2152 ms | 781028 KB |
2_018.txt | TLE | 2155 ms | 839524 KB |