結果

問題 No.29 パワーアップ
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2018-09-29 00:03:00
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 287 ms / 5,000 ms
コード長 333 bytes
コンパイル時間 12,345 ms
コンパイル使用メモリ 442,400 KB
実行使用メモリ 57,104 KB
最終ジャッジ日時 2024-04-30 19:20:49
合計ジャッジ時間 17,126 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 272 ms
56,992 KB
testcase_01 AC 270 ms
56,972 KB
testcase_02 AC 279 ms
56,836 KB
testcase_03 AC 266 ms
56,932 KB
testcase_04 AC 261 ms
56,916 KB
testcase_05 AC 276 ms
57,020 KB
testcase_06 AC 278 ms
57,076 KB
testcase_07 AC 277 ms
57,104 KB
testcase_08 AC 273 ms
56,952 KB
testcase_09 AC 275 ms
56,932 KB
testcase_10 AC 281 ms
56,984 KB
testcase_11 AC 287 ms
56,948 KB
testcase_12 AC 283 ms
56,932 KB
testcase_13 AC 277 ms
56,992 KB
testcase_14 AC 275 ms
56,904 KB
testcase_15 AC 277 ms
56,900 KB
testcase_16 AC 277 ms
56,992 KB
testcase_17 AC 267 ms
57,000 KB
testcase_18 AC 270 ms
56,972 KB
testcase_19 AC 276 ms
56,992 KB
testcase_20 AC 278 ms
56,964 KB
testcase_21 AC 260 ms
56,788 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 = mutableSetOf<Int>()
	var cnt = 0

	for (i in 0 until N) {
		val abc = readLine()!!.split(" ").map { it.toInt() }
		abc.forEach { v ->
			if (v !in dic) {
				dic.add(v)
			} else {
				cnt += 1
				dic.remove(v)
			}
		}
	}
	cnt += dic.size / 4
	println(cnt)
}
0