結果

問題 No.201 yukicoderじゃんけん
コンテスト
ユーザー くわい
提出日時 2015-11-11 00:41:58
言語 Scala(Beta)
(3.8.1)
コンパイル:
scalac _filename_
実行:
java -cp .:/home/linuxbrew/.linuxbrew/Cellar/scala/3.8.1/libexec/maven2/org/scala-lang/scala3-library_3/3.8.1/scala3-library_3-3.8.1.jar:/home/linuxbrew/.linuxbrew/Cellar/scala/3.8.1/libexec/maven2/org/scala-lang/scala-library/3.8.1/scala-library-3.8.1.jar _class_
結果
AC  
実行時間 308 ms / 5,000 ms
コード長 642 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 8,091 ms
コンパイル使用メモリ 251,960 KB
実行使用メモリ 54,940 KB
最終ジャッジ日時 2026-03-09 14:18:19
合計ジャッジ時間 15,247 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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