結果
問題 |
No.91 赤、緑、青の石
|
ユーザー |
|
提出日時 | 2015-02-24 21:25:41 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 64 ms / 5,000 ms |
コード長 | 736 bytes |
コンパイル時間 | 17,647 ms |
コンパイル使用メモリ | 227,248 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-24 06:47:00 |
合計ジャッジ時間 | 12,688 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 28 |
ソースコード
package main import ( "bufio" "os" "strconv" "sort" "fmt" ) var s = bufio.NewScanner(os.Stdin) func next() string { s.Scan() return s.Text() } func nextInt() int { i, e := strconv.Atoi(next()) if e != nil { panic(e) } return i } func nextLong() int64 { i, e := strconv.ParseInt(next(), 10, 64) if e != nil { panic(e) } return i } func main() { s.Split(bufio.ScanWords) list := []int{nextInt(), nextInt(), nextInt()} sort.Ints(list) count := list[0] for i, _ := range list { list[i]-=count } for list[1] >= 1 && list[2] >= 3 { count+=1 list[1]-=1 list[2]-=3 sort.Ints(list) } var a = list[1] / 5 count+= a list[1]-=a var b = list[2] / 5 count+= b list[2]-=b fmt.Println(count) }