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
terms = [None] * 1000001 | |
maxterms = 0 | |
maxtermsNum = 0 | |
for i in range(1,1000001): | |
c = i | |
count = 1 | |
while c > 1: | |
if c % 2 == 0: |
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
package main | |
import "fmt" | |
func main() { | |
terms := make([]int16, 1000001) | |
maxterms := int16(0) | |
maxtermsNum := 0 | |
for i := range terms { |
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
// quick hack, too lazy to fix this properly. | |
// Yes, I know scoring logic coded here is wrong for the following format: | |
// "make the best hand using exactly two of the dealt cards and three community cards." | |
package main | |
import ( | |
"bufio" | |
"fmt" | |
"log" |
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
// https://forum.lowyat.net/topic/3852732 | |
// Quick and Dirty hack | |
// angch's go kata | |
// Original idea was to scale up and use Go channels, but we can't do | |
// priority queue that way. | |
package main |
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
// https://forum.lowyat.net/topic/3852732 | |
// Quick and Dirty hack | |
// angch's go kata | |
// Original idea was to scale up and use Go channels, but we can't do | |
// priority queue that way. | |
package main |
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
// https://forum.lowyat.net/topic/3765924/+0 | |
package main | |
import "fmt" | |
/* | |
1. A vase that weights 3 pounds and is worth 50 dollars. | |
2. A silver nugget that weights 6 pounds and is worth 30 dollars. | |
3. A painting that weights 4 pounds and is worth 40 dollars. | |
4. A mirror that weights 5 pounds and is worth 10 dollars. |
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
// quickie rewrite of http://www.giantflyingsaucer.com/blog/?p=5557 in Go | |
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
) | |
func fetch_page(url string) chan bool { |
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
package main | |
import ( | |
"bufio" | |
"bytes" | |
"fmt" | |
"io" | |
"log" | |
"math/rand" | |
"os" |
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
package main | |
import ( | |
"bufio" | |
"bytes" | |
"fmt" | |
"io" | |
"log" | |
"math/rand" | |
"os" |
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
package main | |
import ( | |
"bufio" | |
"bytes" | |
"fmt" | |
"io" | |
"regexp" | |
"strconv" | |
) |