結果

問題 No.208 王将
ユーザー ともきともき
提出日時 2015-07-18 17:27:15
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 961 ms / 1,000 ms
コード長 1,430 bytes
コンパイル時間 10,510 ms
コンパイル使用メモリ 258,016 KB
実行使用メモリ 62,476 KB
最終ジャッジ日時 2023-09-11 11:55:21
合計ジャッジ時間 36,690 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 948 ms
62,072 KB
testcase_01 AC 940 ms
62,092 KB
testcase_02 AC 932 ms
62,040 KB
testcase_03 AC 952 ms
61,952 KB
testcase_04 AC 953 ms
61,972 KB
testcase_05 AC 946 ms
61,992 KB
testcase_06 AC 937 ms
62,216 KB
testcase_07 AC 935 ms
62,320 KB
testcase_08 AC 948 ms
62,148 KB
testcase_09 AC 956 ms
62,376 KB
testcase_10 AC 961 ms
62,120 KB
testcase_11 AC 944 ms
62,476 KB
testcase_12 AC 941 ms
62,024 KB
testcase_13 AC 946 ms
62,440 KB
testcase_14 AC 940 ms
62,144 KB
testcase_15 AC 934 ms
62,444 KB
testcase_16 AC 944 ms
62,264 KB
testcase_17 AC 942 ms
62,064 KB
testcase_18 AC 943 ms
62,108 KB
testcase_19 AC 950 ms
62,144 KB
testcase_20 AC 943 ms
62,360 KB
testcase_21 AC 946 ms
62,096 KB
testcase_22 AC 935 ms
62,108 KB
testcase_23 AC 949 ms
61,952 KB
testcase_24 AC 926 ms
61,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import scala.io.StdIn.readLine
import scala.collection.mutable.PriorityQueue
import scala.annotation.tailrec

// PriorityQueue[Long]()(scala.math.Ordering.Long.reverse)
package net.pushl {
  package number {
    // Prime  (Prime.scala)
    // Number (Number.scala)
  }
  package string {
    // RollingHash (RollingHash.scala)
  }
  package geometry {
    // Point
    // Segment
    // Line
  }
  object EnRich {
    implicit class AString(val self : String) extends AnyVal {
      def splitToIntVector    = self.split(" ").map(_.toInt).toVector
      def splitToDoubleVector = self.split(" ").map(_.toDouble).toVector

      def splitToDoubleTuple2 = splitTuple2(() => splitToDoubleVector)
      def splitToIntTuple2    = splitTuple2(() => splitToIntVector)
      def splitToDoubleTuple3 = splitTuple3(() => splitToDoubleVector)
      def splitToIntTuple3    = splitTuple3(() => splitToIntVector)

      private def splitTuple2[X](splitTo: () => Vector[X]) = {
        val ab = splitTo()
        (ab(0),ab(1))
      }
      private def splitTuple3[X](splitTo: () => Vector[X]) = {
        val abc = splitTo()
        (abc(0),abc(1),abc(2))
      }
    }
  }
}

import net.pushl.EnRich._
object Main {
  def main(args : Array[String]) : Unit = {
    val (x,y)   = readLine.splitToIntTuple2
    val (x2,y2) = readLine.splitToIntTuple2
    if(x == y && x2 == y2 && x2 < x)
      println(x+1)
    else
      println(x max y)
  }
}

0