| Task: | Find a Word |
| Sender: | DROP TABLE |
| Submission time: | 2018-05-26 15:05:34 +0300 |
| Language: | Python3 |
| Status: | READY |
| Result: | TIME LIMIT EXCEEDED |
| test | verdict | time | |
|---|---|---|---|
| #1 | ACCEPTED | 0.04 s | details |
| #2 | ACCEPTED | 0.05 s | details |
| #3 | ACCEPTED | 0.04 s | details |
| #4 | ACCEPTED | 0.02 s | details |
| #5 | ACCEPTED | 0.05 s | details |
| #6 | ACCEPTED | 0.04 s | details |
| #7 | ACCEPTED | 0.05 s | details |
| #8 | ACCEPTED | 0.04 s | details |
| #9 | ACCEPTED | 0.05 s | details |
| #10 | ACCEPTED | 0.04 s | details |
| #11 | TIME LIMIT EXCEEDED | -- | details |
| #12 | TIME LIMIT EXCEEDED | -- | details |
| #13 | TIME LIMIT EXCEEDED | -- | details |
| #14 | TIME LIMIT EXCEEDED | -- | details |
| #15 | TIME LIMIT EXCEEDED | -- | details |
| #16 | TIME LIMIT EXCEEDED | -- | details |
Code
WORDS = [] table = [] n, k = map(int, input().split()) wordLen = 2*n - 1 #print(n,k) def rec(y, x, curWord = ""): if x >= n or y >= n: return curWord += table[y][x] #print(curWord, y, x) if y == n - 1 and x == n - 1: WORDS.append(curWord) return rec(y, x + 1, curWord) rec(y + 1, x, curWord) for _ in range(n): table.append(input().rstrip()) #print(table) rec(0,0) ##print(sorted(WORDS)) print(sorted(WORDS)[k - 1])
Test details
Test 1
Verdict: ACCEPTED
| input |
|---|
| 4 1 AAAA AAAA AAAA AAAA |
| correct output |
|---|
| AAAAAAA |
| user output |
|---|
| AAAAAAA |
Test 2
Verdict: ACCEPTED
| input |
|---|
| 4 2 AAAA AAAA AAAA AAAA |
| correct output |
|---|
| AAAAAAA |
| user output |
|---|
| AAAAAAA |
Test 3
Verdict: ACCEPTED
| input |
|---|
| 4 10 AAAA AAAA AAAA AAAA |
| correct output |
|---|
| AAAAAAA |
| user output |
|---|
| AAAAAAA |
Test 4
Verdict: ACCEPTED
| input |
|---|
| 4 19 AAAA AAAA AAAA AAAA |
| correct output |
|---|
| AAAAAAA |
| user output |
|---|
| AAAAAAA |
Test 5
Verdict: ACCEPTED
| input |
|---|
| 4 20 AAAA AAAA AAAA AAAA |
| correct output |
|---|
| AAAAAAA |
| user output |
|---|
| AAAAAAA |
Test 6
Verdict: ACCEPTED
| input |
|---|
| 4 1 QNJP EVJU XHZF RXCV |
| correct output |
|---|
| QEVHXCV |
| user output |
|---|
| QEVHXCV |
Test 7
Verdict: ACCEPTED
| input |
|---|
| 4 2 QNJP EVJU XHZF RXCV |
| correct output |
|---|
| QEVHZCV |
| user output |
|---|
| QEVHZCV |
Test 8
Verdict: ACCEPTED
| input |
|---|
| 4 10 QNJP EVJU XHZF RXCV |
| correct output |
|---|
| QEXRXCV |
| user output |
|---|
| QEXRXCV |
Test 9
Verdict: ACCEPTED
| input |
|---|
| 4 19 QNJP EVJU XHZF RXCV |
| correct output |
|---|
| QNVJZCV |
| user output |
|---|
| QNVJZCV |
Test 10
Verdict: ACCEPTED
| input |
|---|
| 4 20 QNJP EVJU XHZF RXCV |
| correct output |
|---|
| QNVJZFV |
| user output |
|---|
| QNVJZFV |
Test 11
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 30 1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ... |
| correct output |
|---|
| AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
| user output |
|---|
| (empty) |
Test 12
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 30 15033633249770520 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ... |
| correct output |
|---|
| AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
| user output |
|---|
| (empty) |
Test 13
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 30 30067266499541040 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ... |
| correct output |
|---|
| AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
| user output |
|---|
| (empty) |
Test 14
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 30 1 QNJPEVJUXHZFRXCVKBSJKUURVPLYUI RXLGFBNQPBKQQRQFHLXUIUPLUOUOQW FZNNUBMTLXUMTSJOOGBDBEVEYVWOLP WYLTEQJBJRPSEMPOESVKFTQKEMSIAP ... |
| correct output |
|---|
| QNJLGFBBMJBHCCBOCEFBPLDCFGDJKB... |
| user output |
|---|
| (empty) |
Test 15
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 30 15033633249770520 QNJPEVJUXHZFRXCVKBSJKUURVPLYUI RXLGFBNQPBKQQRQFHLXUIUPLUOUOQW FZNNUBMTLXUMTSJOOGBDBEVEYVWOLP WYLTEQJBJRPSEMPOESVKFTQKEMSIAP ... |
| correct output |
|---|
| QNXZYLYURTAYRYZQUKZCYOPKYKLQPX... |
| user output |
|---|
| (empty) |
Test 16
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 30 30067266499541040 QNJPEVJUXHZFRXCVKBSJKUURVPLYUI RXLGFBNQPBKQQRQFHLXUIUPLUOUOQW FZNNUBMTLXUMTSJOOGBDBEVEYVWOLP WYLTEQJBJRPSEMPOESVKFTQKEMSIAP ... |
| correct output |
|---|
| QRXZYLYURTAYRYZQUKZCYOPKYKLQPX... |
| user output |
|---|
| (empty) |
