結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー HujiLeeHujiLee
提出日時 2016-11-26 00:35:58
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 989 ms / 2,000 ms
コード長 659 bytes
コンパイル時間 12,549 ms
コンパイル使用メモリ 244,604 KB
実行使用メモリ 61,868 KB
最終ジャッジ日時 2023-09-12 07:40:27
合計ジャッジ時間 25,167 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 913 ms
61,492 KB
testcase_01 AC 919 ms
61,648 KB
testcase_02 AC 912 ms
61,604 KB
testcase_03 AC 936 ms
61,744 KB
testcase_04 AC 934 ms
61,796 KB
testcase_05 AC 928 ms
61,752 KB
testcase_06 AC 936 ms
61,612 KB
testcase_07 AC 919 ms
61,356 KB
testcase_08 AC 926 ms
61,868 KB
testcase_09 AC 916 ms
61,516 KB
testcase_10 AC 989 ms
61,632 KB
testcase_11 AC 903 ms
61,532 KB
testcase_12 AC 896 ms
61,700 KB
testcase_13 AC 897 ms
61,832 KB
testcase_14 AC 908 ms
61,700 KB
testcase_15 AC 908 ms
61,640 KB
testcase_16 AC 929 ms
61,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import scala.io.StdIn

/**
  * Created by Administrator on 2016/11/25 0025.
  */
object Main extends App {
  def ng(): Unit = {
    println("NG")
  }

  def ok(): Unit = {
    println("OK")
  }

  def leadingZero(str:String):Boolean={
    return (str.charAt(0)=='0'&&str.length>1)
  }

  try {
    var A = StdIn.readLine()
    var B = StdIn.readLine()
    if (leadingZero(A)||leadingZero(B)) {
      throw new Exception("leading zero")
    }
    var (a, b) = (A.toInt, B.toInt)
    if (math.max(a, b) > 12345) {
      throw new Exception("> 12345")
    }
    ok()

  } catch {
    case ex: Exception => {
      Console.err.println(ex)
      ng()
    }
  }


}
0