結果

問題 No.201 yukicoderじゃんけん
ユーザー くわいくわい
提出日時 2015-11-11 00:41:58
言語 Scala(Beta)
(3.6.2)
結果
AC  
実行時間 878 ms / 5,000 ms
コード長 642 bytes
コンパイル時間 10,120 ms
コンパイル使用メモリ 238,932 KB
実行使用メモリ 62,708 KB
最終ジャッジ日時 2024-06-29 11:06:16
合計ジャッジ時間 26,995 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import scala.io.StdIn

object Problem201 {

  def proc(a: Array[String], b: Array[String]): String = {
    val (nameA, pointA) = (a(0), a(1))
    val (nameB, pointB) = (b(0), b(1))

    pointA.length == pointB.length match {
      case true => pointA.compareTo(pointB) match {
        case 0 => "-1"
        case x if x > 0 => nameA
        case x if x < 0 => nameB
      }
      case false => if (pointA.length > pointB.length) nameA else nameB
    }
  }

  def main(args: Array[String]): Unit = {
    val a = StdIn.readLine().split(" ")
    val b = StdIn.readLine().split(" ")

    val result: String = proc(a, b)
    println(result)
  }
}
0