結果

問題 No.227 簡単ポーカー
ユーザー javyjavy
提出日時 2015-11-14 05:56:12
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 1,813 bytes
コンパイル時間 10,290 ms
コンパイル使用メモリ 433,176 KB
実行使用メモリ 60,384 KB
最終ジャッジ日時 2024-04-30 07:51:13
合計ジャッジ時間 15,173 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 286 ms
60,348 KB
testcase_02 AC 296 ms
60,228 KB
testcase_03 AC 285 ms
60,252 KB
testcase_04 AC 278 ms
60,372 KB
testcase_05 AC 284 ms
60,384 KB
testcase_06 WA -
testcase_07 AC 281 ms
60,360 KB
testcase_08 WA -
testcase_09 AC 280 ms
60,328 KB
testcase_10 AC 277 ms
60,252 KB
testcase_11 AC 297 ms
60,236 KB
testcase_12 AC 289 ms
60,248 KB
testcase_13 AC 288 ms
60,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:6:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

package Yukicoder

/**
 * Created by hichikawa on 2015/11/12.
 */
fun main(args: Array<String>) {
    fun readLineLongArray(): List<Long> {
        val str = readLine() as String
        val arrStr = str.split(" ")
        val ret = arrStr.map { it.toLong() }
        return ret
    }

    fun readLineLong(): Long {
        val str = readLine() as String
        return str.toLong()
    }

    fun readLineInt(): Int {
        val str = readLine() as String
        return str.toInt()
    }

    fun readLineIntArray() : List<Int> {
        val str = readLine() as String
        val arrStr = str.split(" ")
        val ret = arrStr.map { it.toInt() }
        return ret
    }

    fun readLineDoubleArray(): List<Double> {
        val str = readLine() as String
        val arrStr = str.split(" ")
        val ret = arrStr.map { it.toDouble() }
        return ret
    }

    val cards = readLineIntArray().sorted()
    if (cards[0] == cards[2]) {
        if (cards[3] == cards[4]) {
            println("FULL HOUSE")
        } else {
            println("THREE CARD")
        }
    } else if (cards[2] == cards[4]) {
        if (cards[0] == cards[1]) {
            println("FULL HOUSE")
        } else {
            println("THREE CARD")
        }
    } else if (cards[1] == cards[3]) {
        println("THREE CARD")
    } else if (cards[0] == cards[1]) {
        if (cards[2] == cards[3] || cards[3] == cards[4]) {
            println("TWO PAIR")
        } else {
            println("ONE PAIR")
        }
    } else if (cards[1] == cards[2]) {
        if (cards[3] == cards[4]) {
            println("TWO PAIR")
        } else {
            println("ONE PAIR")
        }
    } else if (cards[2] == cards[3] || cards[3] == cards[4]) {
        println("ONE PAIR")
    } else {
        println("NO HAND")
    }
}
0