1 2 3 4 5 6 7 8 9 10 11 | data Instruction = X | Y deriving Show breadthSearch target ((path, (x,y)):paths) | x == target = reverse path | otherwise = breadthSearch target $ paths ++ [(X:path, (x+y, y)) ,(Y:path, (x, x+y))] main = do value <- getContents print $ breadthSearch (read value) [([],(1,1))] |
-
upload with new input
-
result: Success time: 2.32s memory: 7816 kB returned value: 0
500
[X,X,X,X,Y,X,Y,X,Y,X,Y,X,Y,X]
-
result: Success time: 0.6s memory: 5768 kB returned value: 0
400
[X,X,Y,Y,X,X,Y,X,Y,Y,X,Y,X]
-
result: Success time: 0.64s memory: 5768 kB returned value: 0
300
[X,X,Y,Y,X,Y,Y,X,X,X,Y,Y,X]
-
result: Success time: 0.13s memory: 4744 kB returned value: 0
200
[X,X,Y,X,X,X,Y,Y,X,X,Y,X]
-
result: Success time: 0.02s memory: 3720 kB returned value: 0
100
[X,X,Y,X,X,Y,Y,X,Y,X]
-
result: Success time: 0.02s memory: 3720 kB returned value: 0
4
[X,X,X]
-
result: Success time: 2.33s memory: 7816 kB returned value: 0
500
[X,X,X,X,Y,X,Y,X,Y,X,Y,X,Y,X]
-
result: Success time: 0.02s memory: 3720 kB returned value: 0
100
[X,X,Y,X,X,Y,Y,X,Y,X]
-
result: Time limit exceeded time: 5s memory: 7816 kB signal: 24 (SIGXCPU)
1488
-
result: Time limit exceeded time: 5s memory: 7816 kB signal: 24 (SIGXCPU)
1000
-
result: Time limit exceeded time: 5s memory: 7816 kB signal: 24 (SIGXCPU)
10000
-
result: Success time: 0.02s memory: 3720 kB returned value: 0
34
[X,Y,X,Y,X,Y,X]



