結果

問題 No.29 パワーアップ
ユーザー tsuchinagatsuchinaga
提出日時 2019-02-20 23:50:58
言語 Go
(1.22.1)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 311 bytes
コンパイル時間 11,835 ms
コンパイル使用メモリ 199,568 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-08-07 19:25:30
合計ジャッジ時間 13,124 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,356 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 2 ms
4,360 KB
testcase_03 AC 2 ms
4,356 KB
testcase_04 AC 1 ms
4,352 KB
testcase_05 AC 2 ms
4,356 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,352 KB
testcase_08 AC 1 ms
4,356 KB
testcase_09 AC 1 ms
4,352 KB
testcase_10 AC 2 ms
4,356 KB
testcase_11 AC 2 ms
4,352 KB
testcase_12 AC 1 ms
4,352 KB
testcase_13 AC 2 ms
4,352 KB
testcase_14 AC 2 ms
4,352 KB
testcase_15 AC 2 ms
4,352 KB
testcase_16 AC 1 ms
4,352 KB
testcase_17 AC 2 ms
4,356 KB
testcase_18 AC 2 ms
4,356 KB
testcase_19 AC 2 ms
4,352 KB
testcase_20 AC 1 ms
4,352 KB
testcase_21 AC 1 ms
4,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import "fmt"

func main() {
	var n, a, p int
	_, _ = fmt.Scan(&n)
	items := make([]int, 10)
	for i := 0; i < n*3; i++ {
		_, _ = fmt.Scan(&a)

		items[a-1]++
		if items[a-1] >= 2 {
			p++
			items[a-1] -= 2
		}
	}

	t := 0
	for _, num := range items {
		t += num
	}
	p += t / 4

	fmt.Println(p)
}
0