Submission #3598828
Source Code Expand
package main import( "bufio" "fmt" "os" "strconv" "sort" ) type Interface interface { Len() int Less(i, j int) bool Swap(i, j int) } func main(){ var n int ans := 0 fmt.Scan(&n) a := make([]int, 3 * n) for i:=0; i<n*3; i++ { var tmp int a[i]=fmt.Scan(&tmp) } cnt := 0 for i:=3*n-2; i>=0; i-=2 { if cnt == n { break; } ans+=a[i] cnt++; } fmt.Println(ans) } //==== ↓↓↓ template functions ↓↓↓ ====================== func min(a, b int64) int64{ if a < b { return a } return b } func max(a, b int64) int64{ if a > b { return a } return b } func abs(x int64) int64{ if x < 0 { return -x } return x } func gcd(a, b int64) int64{ if b == 0 { return a }else{ return gcd(b, a%b) } } func lcm(a, b int64) int64{ return a*b/gcd(a, b); }
Submission Info
Submission Time | |
---|---|
Task | A - AtCoder Group Contest |
User | asdf1 |
Language | Go (1.6) |
Score | 0 |
Code Size | 933 Byte |
Status | CE |
Compile Error
# command-line-arguments ./Main.go:5: imported and not used: "bufio" ./Main.go:7: imported and not used: "os" ./Main.go:8: imported and not used: "strconv" ./Main.go:9: imported and not used: "sort" ./Main.go:25: multiple-value fmt.Scan() in single-value context