結果

問題 No.208 王将
コンテスト
ユーザー ともき
提出日時 2015-07-18 17:27:15
言語 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  
実行時間 364 ms / 1,000 ms
コード長 1,430 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 10,467 ms
コンパイル使用メモリ 270,816 KB
実行使用メモリ 58,648 KB
最終ジャッジ日時 2026-03-09 13:38:46
合計ジャッジ時間 20,799 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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