結果

問題 No.586 ダブルブッキング
ユーザー ichibanshiboriichibanshibori
提出日時 2018-05-03 18:02:38
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 298 ms / 2,000 ms
コード長 378 bytes
コンパイル時間 12,853 ms
コンパイル使用メモリ 427,776 KB
実行使用メモリ 53,076 KB
最終ジャッジ日時 2023-08-12 23:34:09
合計ジャッジ時間 16,190 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 292 ms
52,696 KB
testcase_01 AC 291 ms
52,624 KB
testcase_02 AC 290 ms
52,788 KB
testcase_03 AC 297 ms
52,804 KB
testcase_04 AC 290 ms
52,672 KB
testcase_05 AC 298 ms
53,076 KB
testcase_06 AC 290 ms
52,792 KB
testcase_07 AC 292 ms
52,600 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args : Array<String>) {
         ^

ソースコード

diff #

fun main(args : Array<String>) {
	val p1 = (readLine() ?: "").run { toInt() }
	val p2 = (readLine() ?: "").run { toInt() }
	val n = (readLine() ?: "").run { toInt() }
	val rLst = IntRange(1, n).map { readLine() ?: "" }.map { it.toInt() }

	val dupNum = rLst
		.groupBy { it }
		.filter { it.value.size > 1 }
		.map { it.value.size - 1 }
		.sum()
	
	println((p1 + p2) * dupNum)
}
0