結果
| 問題 | No.91 赤、緑、青の石 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-02-24 21:25:41 |
| 言語 | Go (1.23.4) |
| 結果 |
AC
|
| 実行時間 | 67 ms / 5,000 ms |
| コード長 | 736 bytes |
| 記録 | |
| コンパイル時間 | 12,889 ms |
| コンパイル使用メモリ | 238,208 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-12-07 12:21:21 |
| 合計ジャッジ時間 | 14,721 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 29 |
ソースコード
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)
}