YoshikuniJujo


import Data.List
main=interact$m.lines
m[a,b]|a`isPrefixOf`b=b
m[a:b,c]=a:m[b,c]
Wed Sep 19 10:52:15 2018
haskell
import Data.Char
import Numeric
main=interact$(>>=(map toUpper.c.(`showHex`"").read)).lines
c s=replicate(2-length s)'0'++s
Wed Sep 19 10:51:12 2018
haskell
import Data.Char
import Numeric
main=interact$(>>= (map toUpper.c.(`showHex`"").read)).lines
c s=replicate(2-length s)'0'++s
Wed Sep 19 10:47:44 2018
haskell

FFFF0
instead of
FFFF00
import Data.Char
import Numeric
main=interact$(>>= (map toUpper.(`showHex`"").read)).lines
import Data.Char
main=interact$show.fromEnum.all isLetter
Tue Sep 18 07:19:44 2018
haskell
main=interact$unlines.map(w.i.words).tail.lines
w b|b="true"|0<1="false"
c s@(h:t)=s:c(t++[h])
i[s,t]=elem s$take(length t)$c t
Tue Sep 18 06:54:29 2018
haskell
main=interact$show.c.foldl(\s x->s*2+fromEnum(x=='1'))0
c 197=187;c n=n

67
instead of
134
main=interact$show.c.foldl(\s x->s*2+fromEnum(x=='1'))0.init
c 197=187;c n=n
Tue Sep 18 06:37:55 2018
haskell
main=interact$show.(\(a:_:b)->read a-sum(map read b)).lines
Tue Sep 18 06:30:45 2018
haskell
main=interact$unlines.map(uncurry(:).g.read).tail.lines
g n=(s!!(n-m),' ':s)where((m,_),s)=last.takeWhile((n>=).fst.fst).scanl(\((_,a),_)(b,c)->((a,a+b),c))((0,1),"")$map((\s->(length s,s)).show.(^2))[1..]
Tue Sep 18 06:28:34 2018
haskell

code:2:36: Precedence parsing error cannot mix ‘.’ [infixr 9] and ‘map’ [infixl 9] in the same infix expression

main=interact$unlines.map(uncurry(:).g.read).tail.lines
g n=(s!!(n-m),' ':s)where((m,_),s)=last.takeWhile((n>=).fst.fst).scanl(\((_,a),_)(b,c)->((a,a+b),c))((0,1),"")$(\s->(length s,s)).show.(^2)`map`[1..]
Tue Sep 18 06:27:15 2018
haskell

code:2:140: Not in scope: ‘<$>’

main=interact$unlines.map(uncurry(:).g.read).tail.lines
g n=(s!!(n-m),' ':s)where((m,_),s)=last.takeWhile((n>=).fst.fst).scanl(\((_,a),_)(b,c)->((a,a+b),c))((0,1),"")$(\s->(length s,s)).show.(^2)<$>[1..]
Tue Sep 18 06:26:49 2018
perl

syntax error at ./code line 1, near "(:" Substitution replacement not terminated at ./code line 2.

main=interact$unlines.map(uncurry(:).g.read).tail.lines
g n=(s!!(n-m),' ':s)where((m,_),s)=last.takeWhile((n>=).fst.fst).scanl(\((_,a),_)(b,c)->((a,a+b),c))((0,1),"")$(\s->(length s,s)).show.(^2)<$>[1..]
Wed Aug 2 09:10:24 2017
haskell
main=interact$show.sum.map read.lines
Wed Aug 2 09:06:17 2017
haskell
main=interact$show.(+0).minimum.map read.lines
Wed Aug 2 09:03:25 2017
haskell
main=interact$show.minimum.map((+0).read).lines
Wed Aug 2 08:58:38 2017
haskell
main=interact$show.minimum.tail.(0:).map read.lines
Wed Oct 21 09:15:52 2015
haskell
import Data.List
main=interact$unlines.map(>>=show).(\n->f n n[][][]).read
f _ 0 _ _ _=[[]]
f n i l h s=[q:r|q<-[0..n-1]\\(l++h++s),r<-f n(i-1)(fmap pred$q:l)(q:h)(fmap(+1)$q:s)]
Wed Oct 21 09:12:38 2015
haskell
import Control.Applicative
import Data.List

main :: IO ()
main = interact $ unlines . map (>>= show) . (\n -> queens n n [] [] []) . read

queens :: Int -> Int -> [Int] -> [Int] -> [Int] -> [[Int]]
queens _ 0 _ _ _ = [[]]
queens n i ls hs rs = [ q : qs |
	q <- [0 .. n - 1] \\ (ls ++ hs ++ rs),
	qs <- queens n (i - 1) (pred <$> q : ls) (q : hs) (succ <$> q : rs) ]
Wed Oct 21 08:42:00 2015
haskell
main=interact$unlines.map(b.c.words).tail.lines
b True="true"
b _="false"
c[s,t]=s`elem`t#t
[]#_=[]
(_:d)#a@(x:s)=a:d#(s++[x])