結果

問題 No.632 穴埋め門松列
ユーザー tetsutetsu
提出日時 2018-01-19 21:29:13
言語 Scala(Beta)
(3.3.1)
結果
AC  
実行時間 969 ms / 1,000 ms
コード長 920 bytes
コンパイル時間 7,614 ms
コンパイル使用メモリ 234,616 KB
実行使用メモリ 64,516 KB
最終ジャッジ日時 2023-09-12 15:42:08
合計ジャッジ時間 15,269 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 958 ms
64,516 KB
testcase_01 AC 951 ms
62,360 KB
testcase_02 AC 946 ms
62,724 KB
testcase_03 AC 969 ms
62,292 KB
testcase_04 AC 954 ms
62,464 KB
testcase_05 AC 933 ms
63,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yuki180

import java.util.Scanner

object A {
  def kadomatsu(n1 :Int, n2: Int, n3: Int): Boolean = {
    if(n1 < n2 && n2 > n3) {
      return true
    }
    if(n1 > n2 && n2 < n3) {
      return true
    }
    return false
  }
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val c1, c2, c3 = sc.next()
    if(c1=="?") {
      val n2 = c2.toInt
      val n3 = c3.toInt
      if(kadomatsu(1, n2, n3)) {
        print(1)
      }
      if(kadomatsu(4, n2, n3)) {
        print(4)
      }
    } else if(c2=="?") {
      val n1 = c1.toInt
      val n3 = c3.toInt
      if(kadomatsu(n1, 1, n3)) {
        print(1)
      }
      if(kadomatsu(n1, 4, n3)) {
        print(4)
      }
    } else {
      val n1 = c1.toInt
      val n2 = c2.toInt
      if(kadomatsu(n1, n2, 1)) {
        print(1)
      }
      if(kadomatsu(n1, n2, 4)) {
        print(4)
      }
    }
    println()
  }
}
0