結果

問題 No.201 yukicoderじゃんけん
ユーザー くわいくわい
提出日時 2015-11-11 00:41:58
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 942 ms / 5,000 ms
コード長 642 bytes
コンパイル時間 11,701 ms
コンパイル使用メモリ 238,216 KB
実行使用メモリ 61,772 KB
最終ジャッジ日時 2023-09-11 21:21:57
合計ジャッジ時間 32,416 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 922 ms
61,156 KB
testcase_01 AC 942 ms
61,772 KB
testcase_02 AC 925 ms
61,148 KB
testcase_03 AC 928 ms
61,588 KB
testcase_04 AC 933 ms
61,248 KB
testcase_05 AC 937 ms
61,256 KB
testcase_06 AC 925 ms
61,172 KB
testcase_07 AC 912 ms
61,068 KB
testcase_08 AC 915 ms
61,472 KB
testcase_09 AC 937 ms
61,416 KB
testcase_10 AC 927 ms
61,412 KB
testcase_11 AC 931 ms
61,364 KB
testcase_12 AC 922 ms
61,192 KB
testcase_13 AC 921 ms
61,288 KB
testcase_14 AC 931 ms
61,580 KB
testcase_15 AC 932 ms
61,188 KB
testcase_16 AC 936 ms
61,580 KB
testcase_17 AC 931 ms
61,236 KB
testcase_18 AC 929 ms
61,264 KB
testcase_19 AC 926 ms
61,188 KB
権限があれば一括ダウンロードができます

ソースコード

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