結果

問題 No.208 王将
ユーザー 💕💖💞💕💖💞
提出日時 2016-09-19 23:52:17
言語 Scala(Beta)
(3.4.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 636 bytes
コンパイル時間 5,052 ms
コンパイル使用メモリ 216,908 KB
最終ジャッジ日時 2023-09-12 04:40:11
合計ジャッジ時間 5,625 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
-- [E040] Syntax Error: Main.scala:8:31 ----------------------------------------
8 |  def main(args: Array[String]){
  |                               ^
  |                               '=' expected, but '{' found
-- [E008] Not Found Error: Main.scala:2:34 -------------------------------------
2 |import scala.collection.immutable.StringLike
  |                                  ^^^^^^^^^^
  |            value StringLike is not a member of scala.collection.immutable
-- [E008] Not Found Error: Main.scala:6:37 -------------------------------------
6 |import scala.collection.mutable.{Map,SynchronizedMap, HashMap}
  |                                     ^^^^^^^^^^^^^^^
  |         value SynchronizedMap is not a member of scala.collection.mutable
3 errors found

ソースコード

diff #

import scala.io.StdIn.readLine
import scala.collection.immutable.StringLike
import scala.collection.immutable.Stream
import Math.{sqrt, pow}
import scala.util.control.Breaks
import scala.collection.mutable.{Map,SynchronizedMap, HashMap}
object Main {
  def main(args: Array[String]){
    val ns = (0 to 1).map { x =>  
      readLine().split(" ").map { _.toInt}
    }.flatMap { x => x } 
    val (x, y, x2, y2) = (ns(0), ns(1), ns(2), ns(3))
    val max = List(x, y).max
    if ( x != y ) {
      println(max)
      return
    }
    if ( x == y && x2 < x && x2 == y2)
      println(max+1)              
    else
      println(max)
  }
}
0