結果

問題 No.29 パワーアップ
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2018-09-29 10:02:47
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 298 ms / 5,000 ms
コード長 355 bytes
コンパイル時間 12,971 ms
コンパイル使用メモリ 440,912 KB
実行使用メモリ 60,440 KB
最終ジャッジ日時 2024-04-30 19:21:24
合計ジャッジ時間 17,641 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 290 ms
60,332 KB
testcase_01 AC 287 ms
60,360 KB
testcase_02 AC 280 ms
60,344 KB
testcase_03 AC 286 ms
60,332 KB
testcase_04 AC 282 ms
60,248 KB
testcase_05 AC 291 ms
60,440 KB
testcase_06 AC 287 ms
60,396 KB
testcase_07 AC 281 ms
60,388 KB
testcase_08 AC 289 ms
60,372 KB
testcase_09 AC 289 ms
60,212 KB
testcase_10 AC 287 ms
60,320 KB
testcase_11 AC 288 ms
60,324 KB
testcase_12 AC 284 ms
60,336 KB
testcase_13 AC 294 ms
60,304 KB
testcase_14 AC 285 ms
60,168 KB
testcase_15 AC 281 ms
60,292 KB
testcase_16 AC 287 ms
60,376 KB
testcase_17 AC 284 ms
60,232 KB
testcase_18 AC 291 ms
60,256 KB
testcase_19 AC 298 ms
60,340 KB
testcase_20 AC 280 ms
60,332 KB
testcase_21 AC 282 ms
60,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

fun main(args: Array<String>) {
	val N = readLine()!!.toInt()
	val dic = Array(10) { 0 }
	var cnt = 0

	for (i in 0 until N) {
		val abc = readLine()!!.split(" ").map { it.toInt() }
		for (v in abc) {
			dic[v - 1] += 1
		}
	}

	for (i in 0 until dic.size) {
		while (dic[i] >= 2) {
			dic[i] -= 2
			cnt += 1
		}
	}

	cnt += dic.sum() / 4
	println(cnt)
}
0