Skip to content

Instantly share code, notes, and snippets.

@yasukotelin
Created June 14, 2020 10:38
Show Gist options
  • Save yasukotelin/c9d99442644f6a3cc9a30d74a2d57c24 to your computer and use it in GitHub Desktop.
Save yasukotelin/c9d99442644f6a3cc9a30d74a2d57c24 to your computer and use it in GitHub Desktop.
main.go for AtCorder
package main
import (
"bufio"
"fmt"
"os"
"strconv"
)
var scanner = bufio.NewScanner(os.Stdin)
func main() {
var a, b int
fmt.Scanf("%d %d", &a, &b)
row := readline()
numbers := convStringsToInts(readline())
}
func readline() string {
scanner.Scan()
return scanner.Text()
}
func convStringsToInts(strings []string) []int {
ints := make([]int, len(strings))
for i, v := range strings {
num, _ := strconv.Atoi(v)
ints[i] = num
}
return ints
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment