Created
April 17, 2016 16:36
-
-
Save cr0sh/d9073fbe19a8e723374c83fe222a5678 to your computer and use it in GitHub Desktop.
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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"math/big" | |
"os" | |
"strconv" | |
"time" | |
) | |
func main() { | |
n, err := strconv.ParseInt(os.Args[1], 10, 64) | |
if err != nil { | |
panic(err) | |
} | |
r := big.NewInt(1) | |
start := time.Now() | |
r.MulRange(1,n) | |
fmt.Println("Elapsed:", time.Since(start)) | |
ioutil.WriteFile("result.txt", []byte(r.String()), 0644) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment