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
// 整数を可逆スクランブルする | |
// http://cs.hatenablog.jp/entry/2013/06/19/135527 | |
func Scramble(v uint32) uint32 { | |
// 奇数その1の乗算 | |
v *= 0x1ca7bc5b | |
// ビット逆順 | |
v = ((v >> 1) & 0x55555555) | ((v & 0x55555555) << 1) | |
v = ((v >> 2) & 0x33333333) | ((v & 0x33333333) << 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
package main | |
import "fmt" | |
func main() { | |
var times, action, grams int | |
var water, coffee float64 | |
fmt.Scanf("%d", ×) | |
for i := 0; i < times; i += 1 { | |
fmt.Scanf("%d %d", &action, &grams) |
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() { | |
var celllen, times, wheel, v int | |
fmt.Scanf("%d", &celllen) | |
cells := make([]int, celllen) | |
for i := 0; i < celllen; i += 1 { | |
fmt.Scanf("%d", &cells[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
package main | |
import ( | |
"fmt" | |
"strconv" | |
) | |
func main() { | |
var in string | |
fmt.Scanf("%s", &in) |
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" | |
"os" | |
"text/scanner" | |
"strconv" | |
) | |
var sc scanner.Scanner | |
func nextInt() int { | |
sc.Scan() |
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" | |
"os" | |
"text/scanner" | |
"strconv" | |
) | |
var sc scanner.Scanner | |
func nextInt() int { | |
sc.Scan() |
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(){ | |
// Here your code ! | |
var num, val int | |
sum := make([]int, 7) | |
fmt.Scanf("%d", &num) | |
for i :=0; i<num; i++{ | |
fmt.Scanf("%d", &val) | |
sum[i%7] += val |
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" | |
"bufio" | |
"os" | |
) | |
func main(){ | |
// Let's challenge in my favorite language!! | |
bio := bufio.NewReader(os.Stdin) | |
line, _, _ := bio.ReadLine() |
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
# coding: utf-8 | |
# Let's challenge in my favorite language!! | |
input_lines = raw_input() | |
tmp = input_lines.split(" ") | |
x = int(tmp[0]) # 3 | |
y = int(tmp[1]) # 4 | |
t = [0] * x | |
for i in xrange(y): | |
input_lines = raw_input() | |
tmp = input_lines.split(" ") |
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
# coding: utf-8 | |
# Let's challenge in my favorite language!! | |
input_lines = raw_input() | |
tmp = input_lines.split(" ") | |
x = int(tmp[0]) | |
y = int(tmp[1]) | |
sel = int(tmp[2]) | |
sq = [] | |
count = 0 | |
for i in xrange(y): |
NewerOlder