結果
問題 |
No.45 回転寿司
|
ユーザー |
![]() |
提出日時 | 2019-06-18 13:25:06 |
言語 | Go (1.23.4) |
結果 |
WA
|
実行時間 | - |
コード長 | 490 bytes |
コンパイル時間 | 16,211 ms |
コンパイル使用メモリ | 236,476 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-30 07:48:13 |
合計ジャッジ時間 | 13,053 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 23 WA * 7 |
ソースコード
package main import ( "bufio" "fmt" "math" "os" "strconv" ) func main() { sc := bufio.NewScanner(os.Stdin) sc.Split(bufio.ScanWords) sc.Scan() n, _ := strconv.Atoi(sc.Text()) var a, b, c int // 取った、取った後やから取れへん、取れるけど取らへん for i := 0; i < n; i++ { sc.Scan() v, _ := strconv.Atoi(sc.Text()) // fmt.Println(a, b, c, v) larger := int(math.Max(float64(b), float64(c))) a, b, c = larger+v, a, larger } fmt.Println(a) }