結果

問題 No.1825 Except One
ユーザー yudedakoyudedako
提出日時 2022-01-31 16:48:20
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 997 ms / 3,000 ms
コード長 536 bytes
コンパイル時間 9,450 ms
コンパイル使用メモリ 263,252 KB
実行使用メモリ 63,216 KB
最終ジャッジ日時 2023-09-02 02:20:37
合計ジャッジ時間 46,324 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 945 ms
62,536 KB
testcase_01 AC 952 ms
61,968 KB
testcase_02 AC 951 ms
62,300 KB
testcase_03 AC 993 ms
62,884 KB
testcase_04 AC 984 ms
62,388 KB
testcase_05 AC 974 ms
61,996 KB
testcase_06 AC 961 ms
62,304 KB
testcase_07 AC 989 ms
62,328 KB
testcase_08 AC 997 ms
62,112 KB
testcase_09 AC 957 ms
62,368 KB
testcase_10 AC 974 ms
62,112 KB
testcase_11 AC 954 ms
62,284 KB
testcase_12 AC 976 ms
62,340 KB
testcase_13 AC 992 ms
62,408 KB
testcase_14 AC 958 ms
62,280 KB
testcase_15 AC 950 ms
62,008 KB
testcase_16 AC 960 ms
62,376 KB
testcase_17 AC 950 ms
62,728 KB
testcase_18 AC 953 ms
62,052 KB
testcase_19 AC 951 ms
62,508 KB
testcase_20 AC 941 ms
62,280 KB
testcase_21 AC 950 ms
62,328 KB
testcase_22 AC 935 ms
62,236 KB
testcase_23 AC 930 ms
62,072 KB
testcase_24 AC 952 ms
62,036 KB
testcase_25 AC 964 ms
62,396 KB
testcase_26 AC 961 ms
62,360 KB
testcase_27 AC 976 ms
62,280 KB
testcase_28 AC 963 ms
62,476 KB
testcase_29 AC 964 ms
62,580 KB
testcase_30 AC 958 ms
63,216 KB
testcase_31 AC 956 ms
62,528 KB
testcase_32 AC 965 ms
62,332 KB
testcase_33 AC 937 ms
62,300 KB
testcase_34 AC 961 ms
62,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import scala.io.StdIn.*
import scala.util.chaining.*
import scala.math.*

@main def main =
  val n = readLine().toInt
  val num = readLine().split(' ').map(_.toInt)
  var result = 0L
  for count <- 0 to 200 do
    val minusCount = Array.fill(count + 1){0L}.tap(array => array(0) = 1)
    for a <- num do
      if a <= count then
        val diff = count - a
        for i <- count to diff by -1 do
          minusCount(i) += minusCount(i - diff)
    result += minusCount(count)
  result -= num.count(_ == 0) * 201 + 1
  println(result)
0