This file contains hidden or 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
#define Q(X)p=#X;X | |
Q(char s[999];n;main(i){for(sprintf(s,"#define Q(X)p=#X;X\nQ(%s)",p);s[n];p&&putchar(s[n]),n++)for(p=n<2,i=1;++i<n;p+=!(n%i));}) |
This file contains hidden or 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 Data.List(sortBy) | |
import Data.Ord(comparing) | |
main :: IO () | |
main = interact $ unlines . take 1 . map (show . uncurry enumFromTo) . zzubzzif . lines | |
zzubzzif :: [String] -> [(Int,Int)] | |
zzubzzif [] = [] |
This file contains hidden or 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 RecordWildCards, TupleSections #-} | |
module Main where | |
import Data.List(partition) | |
import GTA.Data.JoinList(Semiring, JoinList, JoinListAlgebra(..), | |
joinize, dejoinize, maxsumsolutionWith) | |
import GTA.Core(GenericSemiring(..), CommutativeMonoid(..), Bag(..), | |
hom, oplus, identity, (<.>), filterBy, aggregateBy) | |
import Data.Vector.Bit(packInteger, pad) | |
import Data.Bits(bit, (.|.), (.&.)) |
This file contains hidden or 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
@echo off | |
REM どうすんだこれ;; | |
REM for /f "delims=" %%i in ( %~1 ) do ( | |
REM if "%%i" == "@echo off" ( | |
REM echo @echo on | |
REM ) else ( | |
REM echo %%i | |
REM ) | |
REM ) |
This file contains hidden or 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
main = interact $ 値を文字列に変換する . | |
最大値だけを取りだす . | |
最大値プラスアルファを求める . | |
各文字を数値に変換する . | |
各行の文字列を一つに繋げる | |
各行の文字列を一つに繋げる = concat . lines | |
各文字を数値に変換する = map 文字一つを数値に変換する |
This file contains hidden or 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
#!/bin/sh | |
# | |
# emerge -vp hoogle の後,hoogle-build-localdbを走らせろと言われるが, | |
# それを無視してコッチのスクリプトを走らせるとローカルにインストールしたパッケージのhaddock等を参照するhoogle DBが作られる. | |
# そのままで hoogle server すると file:/// とローカルドキュメントへのファイルURLが検索結果に出るようになる. | |
# また, hoogle server -l すると http://localhost:port/file//usr/share/doc のような,hoogle serverがstatic fileとして処理ってくれるURLになって, | |
# Haskell環境はVMの中(でホストからputty等で接続してるだけ)だけどブラウザはホストから使いたいようなケースでもOKになる. | |
# | |
ROOT="/" |
This file contains hidden or 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 PFAD1 where | |
open import Function | |
open import Coinduction | |
open import Data.Bool | |
open import Data.List | |
open import Data.Colist | |
open import Data.Nat | |
open import Data.Product | |
open import Relation.Binary.PropositionalEquality using (_≡_; refl; cong; sym) |
This file contains hidden or 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 PFAD2 where | |
open import Function | |
open import Relation.Binary | |
module Ord {t₁ t₂ t₃} (T : DecTotalOrder t₁ t₂ t₃) where | |
open import Data.List.NonEmpty | |
open import Relation.Nullary | |
open Relation.Binary.DecTotalOrder T |
This file contains hidden or 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 PFAD3 where | |
open import Data.Nat | |
open import Data.Product | |
open import Relation.Binary.PropositionalEquality using (_≡_) | |
open import Function | |
infixr 2 _かつ_ | |
_かつ_ = _×_ |
This file contains hidden or 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
-- see. http://www.nicovideo.jp/watch/sm17339259 | |
module RS3 where | |
open import Function | |
open import Function.Equivalence using (_⇔_; equivalence) | |
open import Data.Bool | |
open import Data.Nat | |
open import Data.Nat.DivMod | |
open import Data.Product | |
import Relation.Binary.PropositionalEquality as PropEq |
OlderNewer