結果

問題 No.1825 Except One
ユーザー titan23titan23
提出日時 2022-06-14 22:20:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 906 ms / 3,000 ms
コード長 491 bytes
コンパイル時間 221 ms
コンパイル使用メモリ 82,488 KB
実行使用メモリ 224,864 KB
最終ジャッジ日時 2024-04-14 04:10:28
合計ジャッジ時間 12,502 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
78,192 KB
testcase_01 AC 97 ms
78,312 KB
testcase_02 AC 98 ms
78,560 KB
testcase_03 AC 906 ms
224,340 KB
testcase_04 AC 414 ms
149,380 KB
testcase_05 AC 217 ms
106,384 KB
testcase_06 AC 100 ms
83,248 KB
testcase_07 AC 727 ms
214,488 KB
testcase_08 AC 724 ms
213,796 KB
testcase_09 AC 97 ms
82,588 KB
testcase_10 AC 561 ms
181,148 KB
testcase_11 AC 274 ms
118,188 KB
testcase_12 AC 429 ms
151,944 KB
testcase_13 AC 317 ms
125,316 KB
testcase_14 AC 91 ms
77,876 KB
testcase_15 AC 116 ms
81,428 KB
testcase_16 AC 121 ms
81,508 KB
testcase_17 AC 108 ms
78,044 KB
testcase_18 AC 91 ms
78,228 KB
testcase_19 AC 129 ms
78,876 KB
testcase_20 AC 94 ms
78,540 KB
testcase_21 AC 85 ms
78,332 KB
testcase_22 AC 84 ms
78,608 KB
testcase_23 AC 79 ms
78,568 KB
testcase_24 AC 274 ms
117,176 KB
testcase_25 AC 313 ms
125,424 KB
testcase_26 AC 147 ms
88,304 KB
testcase_27 AC 767 ms
201,764 KB
testcase_28 AC 821 ms
224,760 KB
testcase_29 AC 113 ms
84,360 KB
testcase_30 AC 124 ms
88,348 KB
testcase_31 AC 235 ms
103,812 KB
testcase_32 AC 881 ms
221,452 KB
testcase_33 AC 131 ms
83,628 KB
testcase_34 AC 900 ms
224,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda: sys.stdin.readline().rstrip()

##################

n = int(input())
A = list(map(int, input().split()))
A.sort()

dp = [[[0 for _ in range(n+1)] for _ in range(6000)] for _ in range(n+1)]
dp[0][0][0] = 1
ans = 0
for i in range(n):
  for j in range(5001):
    for k in range(n):
      dp[i+1][j][k] += dp[i][j][k]
      dp[i+1][j+A[i]][k+1] += dp[i][j][k]
      if k >= 1:
        if (j + A[i])%k == 0 and k*A[i] <= j+A[i]:
          ans += dp[i][j][k]

print(ans)
0