結果

問題 No.1089 三変数方程式
ユーザー 👑 yumechiyumechi
提出日時 2021-03-01 23:41:47
言語 Scala(Beta)
(3.4.0)
結果
TLE  
実行時間 -
コード長 277 bytes
コンパイル時間 10,406 ms
コンパイル使用メモリ 270,624 KB
実行使用メモリ 72,916 KB
最終ジャッジ日時 2024-04-14 04:01:41
合計ジャッジ時間 17,118 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 987 ms
72,428 KB
testcase_01 AC 989 ms
65,376 KB
testcase_02 AC 1,070 ms
65,484 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner

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

  val n = sc.nextInt
  var ans = 0
  for(i <- 0 to n) {
    for(j <- 0 to (n - i)) {
      for(k <- 0 to (n - i -j)) {
        if (i + j + k == n) ans += 1
      }
    }
  }
  println(ans)
}
0