Skip to content

Instantly share code, notes, and snippets.

View shimada-shunsuke's full-sized avatar

SHIMADA, Shunsuke shimada-shunsuke

  • Japan
View GitHub Profile
abstract class Process {
public abstract void run() throws ProcessFailure;
public Process and(final Process other) {
final Process self = this;
return new Process() {
public void run() throws ProcessFailure {
self.run();
other.run();
}
list = 1 : [x * 3 + y | x <- list, y <- [0,1]]
main = mapM_ print $ take 100 list
@shimada-shunsuke
shimada-shunsuke / pumpkin.hs
Created November 7, 2013 14:00
CodeIQ カボチャの種を数えて! https://codeiq.jp/ace/ozy_halloween/q516 の解答
module Main where
(^..^) = QB
($^-^) = Mami
(@.@=) = Charlotte
(?) = App
main = print $ eval
(((^..^)?((((^..^)?(@.@=))?((($^-^)?((((^..^)?((((^..^)
?((((^..^)?((((^..^)?((((^..^)?(@.@=))?((($^-^)?((((^..^)
{-# LANGUAGE MultiParamTypeClasses, TypeFamilies #-}
import Data.List as L
import Data.Heap as H
import Control.Parallel
import Control.Parallel.Strategies
import Control.DeepSeq
{-
■ プログラムの実行結果(参考 data0 + 解答 data1 data2)
data0.ans (priority queue):
192.343054
35.179325 136.925993
34.681261 135.509801
34.538272 135.536512
34.695124 135.197852
data1.ans (priority queue):