結果

問題 No.208 王将
ユーザー ともき
提出日時 2015-07-18 17:27:15
言語 Scala(Beta)
(3.6.2)
結果
AC  
実行時間 902 ms / 1,000 ms
コード長 1,430 bytes
コンパイル時間 11,698 ms
コンパイル使用メモリ 270,468 KB
実行使用メモリ 64,904 KB
最終ジャッジ日時 2024-06-29 02:29:11
合計ジャッジ時間 34,820 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

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