Task: | Ruudukko |
Sender: | FSMnArmosta |
Submission time: | 2018-01-07 21:02:59 +0200 |
Language: | Python3 |
Status: | READY |
Result: | 59 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 17 |
#2 | ACCEPTED | 42 |
#3 | RUNTIME ERROR | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.06 s | 1 | details |
#2 | ACCEPTED | 0.08 s | 1 | details |
#3 | ACCEPTED | 0.06 s | 1 | details |
#4 | ACCEPTED | 0.07 s | 1 | details |
#5 | ACCEPTED | 0.07 s | 1 | details |
#6 | ACCEPTED | 0.07 s | 2 | details |
#7 | ACCEPTED | 0.07 s | 2 | details |
#8 | ACCEPTED | 0.07 s | 2 | details |
#9 | ACCEPTED | 0.08 s | 2 | details |
#10 | ACCEPTED | 0.10 s | 2 | details |
#11 | RUNTIME ERROR | 0.33 s | 3 | details |
#12 | RUNTIME ERROR | 0.34 s | 3 | details |
#13 | RUNTIME ERROR | 0.41 s | 3 | details |
#14 | RUNTIME ERROR | 0.33 s | 3 | details |
#15 | RUNTIME ERROR | 0.35 s | 3 | details |
Code
n = int(input()) table = [] fcache = [] for t in range(n): table.append(input()) for t in range(n): fcache.append([None]*n) def f(x, y): if fcache[x][y] == None: result = "" if x == (n-1) and y == (n-1): result = table[x][y] elif x == (n-1): result = table[x][y] + f(x, y+1) elif y == (n-1): result = table[x][y] + f(x+1, y) else: a, b = f(x+1, y), f(x, y+1) result = table[x][y] + min(a, b) fcache[x][y] = result return fcache[x][y] print(f(0, 0))
Test details
Test 1
Group: 1
Verdict: ACCEPTED
input |
---|
5 ILRBG SBRHV PAGKM YKKNG ... |
correct output |
---|
ILBAGKMGQ |
user output |
---|
ILBAGKMGQ |
Test 2
Group: 1
Verdict: ACCEPTED
input |
---|
5 KQQBB IWDQN TENSD PGXMV ... |
correct output |
---|
KITEGMIWH |
user output |
---|
KITEGMIWH |
Test 3
Group: 1
Verdict: ACCEPTED
input |
---|
5 DSWIO RWFDY ISZRK GBVYS ... |
correct output |
---|
DRIGBJDLU |
user output |
---|
DRIGBJDLU |
Test 4
Group: 1
Verdict: ACCEPTED
input |
---|
5 VGQFP FTISL QCLYU EYNZZ ... |
correct output |
---|
VFQCLNRZP |
user output |
---|
VFQCLNRZP |
Test 5
Group: 1
Verdict: ACCEPTED
input |
---|
5 WCSNV UWNDB WDHZA XGRBQ ... |
correct output |
---|
WCSNDBAQW |
user output |
---|
WCSNDBAQW |
Test 6
Group: 2
Verdict: ACCEPTED
input |
---|
100 WFNOQZOAMZPHFRDYGXQNUPWVMFDNJF... |
correct output |
---|
WFAHHJDEVFSGGOGMIFDEEDKPSHBBRX... |
user output |
---|
WFAHHJDEVFSGGOGMIFDEEDKPSHBBRX... |
Test 7
Group: 2
Verdict: ACCEPTED
input |
---|
100 UEOPTOSBCABXIPUOQRKWKMZRGRZUSS... |
correct output |
---|
UEGHLIWDHDVKTECPACBJABFMBOASOF... |
user output |
---|
UEGHLIWDHDVKTECPACBJABFMBOASOF... |
Test 8
Group: 2
Verdict: ACCEPTED
input |
---|
100 XCKBHDFAPMFZNJANJUENHGXYBBHFJR... |
correct output |
---|
XCCENJBCBUFBIOJOJDREIBGRUKVRQS... |
user output |
---|
XCCENJBCBUFBIOJOJDREIBGRUKVRQS... |
Test 9
Group: 2
Verdict: ACCEPTED
input |
---|
100 YEBXYYLVUDYIHNUMRCUTAYVTNLMEZL... |
correct output |
---|
YDJNBALIRDOVFBKDDJDFNSSMIDMFRM... |
user output |
---|
YDJNBALIRDOVFBKDDJDFNSSMIDMFRM... |
Test 10
Group: 2
Verdict: ACCEPTED
input |
---|
100 MVONBCDHJUKRKDGPNYSYGRXBLZOMLD... |
correct output |
---|
MMSJFIKBSFCUMBBLXJCOUIRAPOKEJS... |
user output |
---|
MMSJFIKBSFCUMBBLXJCOUIRAPOKEJS... |
Test 11
Group: 3
Verdict: RUNTIME ERROR
input |
---|
2500 LKEFOYQTRZJHADSYBRGQCUDOPMGYOF... |
correct output |
---|
LDHPNOFPFOCGKPNCEQKANCJCBLGDKC... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 27, in <module> print(f(0, 0)) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f...
Test 12
Group: 3
Verdict: RUNTIME ERROR
input |
---|
2500 UGPBLFMZGVIANZLHRTPJIHMUZWOXKA... |
correct output |
---|
UGLSEBMGHSONFJBGOJJAGBJCLFAHAP... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 27, in <module> print(f(0, 0)) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f...
Test 13
Group: 3
Verdict: RUNTIME ERROR
input |
---|
2500 YRUOZBRTLLMMAHNIHQLZHBYCDHTHMS... |
correct output |
---|
YELLJAAKETHCOWAJNDGJBOFNTCCEDA... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 27, in <module> print(f(0, 0)) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f...
Test 14
Group: 3
Verdict: RUNTIME ERROR
input |
---|
2500 RXZEOTVYZBQUOJJFLCJCYCZDONBLUR... |
correct output |
---|
RTDHUEBGLTKRHKIQLGKILATNHWPIBO... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 27, in <module> print(f(0, 0)) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f...
Test 15
Group: 3
Verdict: RUNTIME ERROR
input |
---|
2500 IOTRAMNHKWWBVPQPPWTTBHOYDFXPOX... |
correct output |
---|
IOTQTIDOBFMJBDNOFEFGGIBGAGQBIC... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 27, in <module> print(f(0, 0)) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f(x, y+1) File "input/code.py", line 22, in f a, b = f(x+1, y), f...