This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module F05 where | |
import Control.Arrow (first, (&&&)) | |
import Data.Bool | |
import Data.List (sortBy,transpose,intercalate,isPrefixOf) | |
import Data.List.Split (splitOn) | |
import Data.Ord (comparing) | |
import Data.Tuple (swap) | |
rot :: ([String] -> [String], [String] -> [String]) -> [String] -> [String] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import System.IO.Unsafe | |
lazy :: IO a -> IO a | |
lazy = unsafeInterleaveIO | |
main :: IO () | |
main = do | |
{ input1 <- getLine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module F04 where | |
import Data.Bool (bool) | |
import Data.List (sort,unfoldr) | |
import Text.Printf (printf) | |
readDiag :: String -> Word | |
readDiag = read | |
toBin :: Word -> String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module E13 where | |
import Data.List | |
import Data.Maybe | |
type CubeCoord = (Int, Int, Int) | |
cubecoord :: Char -> Maybe CubeCoord | |
cubecoord 'a' = Just (0,0,0) | |
cubecoord 'b' = Just (1,-1,0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module F03 where | |
import Data.Ix (range) | |
import Data.List (sort) | |
import Data.Maybe (mapMaybe) | |
import Data.Tuple (swap) | |
type Index = (Int,Int) | |
type Omino = [Index] | |
type Moves = [Index] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module O24 where | |
import Data.Char (digitToInt) | |
import Data.List (intercalate) | |
type Problem = String | |
type Answer = String | |
o24 :: Problem -> Answer | |
o24 = intercalate "," -- 文字列のリストを "," を挟んで連結する |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module F01 where | |
import Control.Arrow | |
import Numeric | |
import Data.Char | |
import Data.Function | |
import Data.List | |
import Text.Printf | |
import Debug.Trace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleContexts #-} | |
module E11 where | |
import Data.List | |
import Data.Ord | |
import qualified Data.Set as S | |
import Data.Tree | |
import Math.NumberTheory.ArithmeticFunctions | |
type NodeID = Int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module F02 where | |
import Control.Arrow | |
import Data.Ix | |
import Data.List | |
type Range = ((Int,Int),(Int,Int)) | |
readRange :: String -> Range | |
readRange s = case break (','==) s of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Arrow | |
import Data.Char | |
type Field = ([Int],Int) | |
ifield :: Field | |
ifield = (repeat 0,0) | |
data Piece = I | L | O | S | T deriving (Eq,Show,Read) | |
type Pos = Int |