結果
| 問題 |
No.29 パワーアップ
|
| コンテスト | |
| ユーザー |
t_murano
|
| 提出日時 | 2016-07-10 17:08:46 |
| 言語 | Go (1.23.4) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 528 bytes |
| コンパイル時間 | 12,322 ms |
| コンパイル使用メモリ | 255,176 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-10-24 20:57:58 |
| 合計ジャッジ時間 | 13,147 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
package main
import (
"bufio"
"fmt"
"log"
"os"
"strconv"
)
func nextInt(sc *bufio.Scanner) int {
sc.Scan()
i, err := strconv.Atoi(sc.Text())
if err != nil {
log.Fatal(err)
}
return i
}
func main() {
sc := bufio.NewScanner(os.Stdin)
sc.Split(bufio.ScanWords)
n := nextInt(sc)
var counter [11]int
for i := 0; i < n*3; i++ {
counter[nextInt(sc)] += 1
}
powerUp := 0
remaining := 0
for _, c := range counter {
powerUp += c / 2
remaining += c % 2
}
powerUp += remaining / 4
fmt.Println(powerUp)
}
t_murano