結果

問題 No.11 カードマッチ
ユーザー バカらっくバカらっく
提出日時 2019-08-31 10:21:37
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 339 ms / 5,000 ms
コード長 569 bytes
コンパイル時間 14,961 ms
コンパイル使用メモリ 438,912 KB
実行使用メモリ 52,000 KB
最終ジャッジ日時 2024-05-03 06:53:09
合計ジャッジ時間 21,812 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 320 ms
51,600 KB
testcase_01 AC 320 ms
51,624 KB
testcase_02 AC 323 ms
51,696 KB
testcase_03 AC 325 ms
51,620 KB
testcase_04 AC 335 ms
51,720 KB
testcase_05 AC 314 ms
51,696 KB
testcase_06 AC 334 ms
51,860 KB
testcase_07 AC 334 ms
51,760 KB
testcase_08 AC 335 ms
51,868 KB
testcase_09 AC 329 ms
51,756 KB
testcase_10 AC 329 ms
51,884 KB
testcase_11 AC 331 ms
51,760 KB
testcase_12 AC 329 ms
51,752 KB
testcase_13 AC 332 ms
51,940 KB
testcase_14 AC 337 ms
51,920 KB
testcase_15 AC 334 ms
51,864 KB
testcase_16 AC 328 ms
52,000 KB
testcase_17 AC 330 ms
51,680 KB
testcase_18 AC 339 ms
51,876 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>){
         ^

ソースコード

diff #

fun main(args: Array<String>){
    val symbolCount = readLine()!!.toLong()
    val numberCount = readLine()!!.toLong()
    val cardCount = readLine()!!.toInt()
    val symbolList = mutableMapOf<Long, Boolean>()
    val numberList = mutableMapOf<Long, Boolean>()
    for(i in 1..cardCount) {
        val (s,k) = readLine()!!.trim().split(" ").map { it.toLong() }
        symbolList[s] = true
        numberList[k] = true
    }
    val ans = symbolList.size * numberCount + symbolCount * numberList.size - symbolList.size * numberList.size - cardCount
    println(ans)
}
0