Skip to content

Instantly share code, notes, and snippets.

View Koitaro's full-sized avatar

Yasusi Koibuti Koitaro

View GitHub Profile
@Koitaro
Koitaro / problem80.go
Created June 11, 2012 22:06
Go: Project Euler 80-89
package main
import (
"fmt"
"math"
"math/big"
"strings"
"time"
)
@Koitaro
Koitaro / problem70.go
Created June 5, 2012 07:03
Go: Project Euler 70-79
package main
import (
"fmt"
"math"
"sort"
"time"
)
func primes(n int) (answer []int) {
@Koitaro
Koitaro / problem60.go
Last active October 4, 2015 13:08
Go: Project Euler 60-69
package main
import (
"fmt"
"math"
"runtime"
"time"
)
func init() {
@Koitaro
Koitaro / problem50.go
Last active October 4, 2015 10:57
Go: Project Euler 50-59
package main
import (
"fmt"
"time"
)
const MAX = 1000000
func is_prime(n int) bool {
@Koitaro
Koitaro / problem40.go
Last active October 4, 2015 05:58
Go: Project Euler 40-49
package main
import (
"fmt"
"math"
"time"
)
func pow(x, y int) int {
return int(math.Pow(float64(x), float64(y)))
@Koitaro
Koitaro / problem30.go
Last active October 3, 2015 16:58
Go: Project Euler 30-39
package main
import (
"fmt"
"math"
"sort"
"time"
)
func pow(x, y int) int {
@Koitaro
Koitaro / problem20.go
Created April 25, 2012 04:49
Go: Project Euler 20-29
package main
import (
"fmt"
"math/big"
"strings"
"time"
)
func problem20() (answer int) {
@Koitaro
Koitaro / problem10.go
Last active October 3, 2015 15:48
Go: Project Euler 10-19
package main
import (
"fmt"
"time"
)
type primes []bool
func newPrimes(n int) (answer primes) {
@Koitaro
Koitaro / problem1.go
Last active October 3, 2015 15:28
Go: Project Euler 1-9
package main
import (
"fmt"
"time"
)
type num int
func (x num) value() (answer num) {
@Koitaro
Koitaro / problem61.erl
Created March 22, 2012 18:32
Erlang : Project Euler 60-69
-module(problem61B).
-include("euler.hrl").
-record(poly, {p,up,lo}).
answer() ->
G = digraph:new(),
try
[make(G,P) || P <- polygonals()],
find(G)
catch