結果

問題 No.1412 Super Ryuo
ユーザー 👑 yumechiyumechi
提出日時 2021-03-01 00:15:15
言語 Scala(Beta)
(3.3.1)
結果
AC  
実行時間 931 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 8,998 ms
コンパイル使用メモリ 250,740 KB
実行使用メモリ 63,264 KB
最終ジャッジ日時 2023-07-26 13:11:44
合計ジャッジ時間 21,701 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 888 ms
62,748 KB
testcase_01 AC 894 ms
62,792 KB
testcase_02 AC 916 ms
62,876 KB
testcase_03 AC 897 ms
62,796 KB
testcase_04 AC 880 ms
63,264 KB
testcase_05 AC 895 ms
62,788 KB
testcase_06 AC 929 ms
62,848 KB
testcase_07 AC 917 ms
62,768 KB
testcase_08 AC 931 ms
63,140 KB
testcase_09 AC 917 ms
62,840 KB
testcase_10 AC 913 ms
63,188 KB
testcase_11 AC 917 ms
62,796 KB
testcase_12 AC 915 ms
62,756 KB
testcase_13 AC 920 ms
63,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)

  val a = BigInt(sc.nextInt)
  val b = BigInt(sc.nextInt)
  val c = BigInt(sc.nextInt)
  val d = BigInt(sc.nextInt)

  def check(a: BigInt, b: BigInt, c: BigInt, d: BigInt): Boolean = {
    if(a == c || b == d) return true
    if((a - c).abs + (b - d).abs <= 3) return true
    false
  }

  println(if (check(a, b, c, d)) 1 else 2)
}
0