1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | import Data.List import qualified Data.ByteString.Char8 as BS convertBase :: Integer -> [Integer] convertBase 0 = [] convertBase n = (mod n 5) : convertBase ( div n 5 ) readInt :: BS.ByteString -> Integer readInt x = case BS.readInteger x of Just ( i , _ ) -> i Nothing -> error " upseperable ints " solve :: Integer -> Integer solve 0 = 1 solve 1 = 1 solve n = mod ( 6*fst a ) 10 where a = foldl (\(acc , i ) x -> ( mod ( acc * product [1..x] * 2^(i*x) ) 10 , i + 1 ) ) ( 1 , 0 ) $ convertBase n main = BS.interact $ BS.unlines. map ( BS.pack . show . solve ) . map readInt. BS.lines |
-
upload with new input
-
result: Success time: 0.01s memory: 3616 kB returned value: 0
654654113565465411356546541135654654113565465411356546541135654654113565465411356546541135654654119
2
-
result: Success time: 0.02s memory: 3616 kB returned value: 0
1311541112032102065465411355465461321314684684064987498074984021320468504 5454351213216576818842650646846056654798784984165146974985414196581489641614 651651618651465168419874895626545121654654514864115154584789 66562323265633113654649797646131115448979461316464969989656164995696185159753
4 4 4 2
-
result: Success time: 0.02s memory: 3616 kB returned value: 0
45 29216 24198 17795 29484 19650 14590 26431 10705 18316 5557 28189 12652 606 32153 17829 29813 30367 6658 28961 11039 30085 18917 7167 14895 23440 5962 2424 29711 7512 8448 10095 28702 4489 19599 18588 27723 7212 21614 18921 27874 7976 1654 10012 3749 21512 18071 17079 16159 29438 10698 25884 20277 19240 15686 14069 5118 12307 19959 15059 2517 24702 17452 2581 11692 19040 26512 22796 163 20524 8027 1629 27097 29523 713 14758 27265 2058 19916 21860 22585 22095 3581 16404 4504 19494 7129 18584 24838 9513 13354 10717 465 11071 17859 29115 31613 29868 18288
6 4 2 2 4 6 4 8 8 8 4 4 6 2 4 2 4 2 8 6 6 2 6 6 4 2 6 6 2 6 2 8 2 2 6 4 4 6 8 4 6 8 4 8 2 6 8 4 2 2 8 8 4 2 4 6 4 2 4 6 4 2 6 2 2 8 2 6 6 4 2 6 2 4 2 6 2 2 4 6 4 6 2 2 8 4 6 4 2 2 2 4 4 6 4 6 2 8 6
-
result: Success time: 0.01s memory: 3616 kB returned value: 0
45 29216 24198 17795 29484 19650 14590 26431 10705 18316 5557 28189 12652 606 32153 17829 29813 30367 6658 28961 11039 30085 18917 7167 14895 23440 5962 2424 29711 7512 8448 10095 28702 4489 19599 18588 27723 7212 21614 18921 27874 7976 1654 10012 3749 21512 18071 17079 16159 29438 10698 25884 20277 19240 15686 14069 5118 12307 19959 15059 2517 24702 17452 2581 11692 19040 26512 22796 163 20524 8027 1629 27097 29523 713 14758 27265 2058 19916 21860 22585 22095 3581 16404 4504 19494 7129 18584 24838 9513 13354 10717 465 11071 17859 29115 31613 29868 18288
6



