Submission #2119939
Source Code Expand
package main import ( "bufio" "fmt" "math" "os" "strconv" ) func max(vals ...int) (max int) { max = 0 for i := 0; i < len(vals); i++ { max = int(math.Max(float64(max), float64(vals[i]))) } return } func main() { scanner := bufio.NewScanner(os.Stdin) scanner.Split(bufio.ScanWords) var N int scanner.Scan() N, _ = strconv.Atoi(scanner.Text()) var A [][]int = make([][]int, 2) for i := 0; i < 2; i++ { A[i] = make([]int, N) } for j := 0; j < 2; j++ { for i := 0; i < N; i++ { scanner.Scan() A[j][i], _ = strconv.Atoi(scanner.Text()) } } for i := 1; i < N; i++ { A[0][i] += A[0][i-1] A[1][N-i-1] += A[1][N-i] } var B []int = make([]int, N) for i := 0; i < N; i++ { B[i] = A[0][i] + A[1][i] } fmt.Println(max(B...)) }
Submission Info
Submission Time | |
---|---|
Task | C - Candies |
User | gidoichi |
Language | Go (1.6) |
Score | 300 |
Code Size | 806 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 640 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample01.txt, sample02.txt, sample03.txt, sample04.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, sample01.txt, sample02.txt, sample03.txt, sample04.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 1 ms | 640 KB |
02.txt | AC | 1 ms | 640 KB |
03.txt | AC | 1 ms | 640 KB |
04.txt | AC | 1 ms | 640 KB |
05.txt | AC | 1 ms | 640 KB |
06.txt | AC | 1 ms | 640 KB |
07.txt | AC | 1 ms | 640 KB |
08.txt | AC | 1 ms | 640 KB |
09.txt | AC | 1 ms | 640 KB |
10.txt | AC | 1 ms | 640 KB |
11.txt | AC | 1 ms | 640 KB |
12.txt | AC | 1 ms | 640 KB |
sample01.txt | AC | 1 ms | 640 KB |
sample02.txt | AC | 1 ms | 640 KB |
sample03.txt | AC | 1 ms | 640 KB |
sample04.txt | AC | 1 ms | 640 KB |