結果

問題 No.1238 選抜クラス
ユーザー aqua_tenhouaqua_tenhou
提出日時 2020-09-25 22:31:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 537 bytes
コンパイル時間 348 ms
コンパイル使用メモリ 87,208 KB
実行使用メモリ 310,516 KB
最終ジャッジ日時 2023-09-10 15:51:03
合計ジャッジ時間 23,067 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,280 KB
testcase_01 AC 72 ms
71,360 KB
testcase_02 AC 83 ms
75,944 KB
testcase_03 WA -
testcase_04 AC 70 ms
71,520 KB
testcase_05 AC 69 ms
71,444 KB
testcase_06 AC 70 ms
71,400 KB
testcase_07 AC 82 ms
76,200 KB
testcase_08 AC 89 ms
76,648 KB
testcase_09 AC 89 ms
76,372 KB
testcase_10 AC 85 ms
76,524 KB
testcase_11 AC 86 ms
76,488 KB
testcase_12 AC 86 ms
76,372 KB
testcase_13 AC 84 ms
76,376 KB
testcase_14 AC 84 ms
76,028 KB
testcase_15 AC 87 ms
76,472 KB
testcase_16 AC 87 ms
76,368 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 1,225 ms
304,348 KB
testcase_20 WA -
testcase_21 AC 1,015 ms
277,200 KB
testcase_22 WA -
testcase_23 AC 82 ms
76,236 KB
testcase_24 TLE -
testcase_25 TLE -
testcase_26 WA -
testcase_27 AC 1,353 ms
304,964 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 113 ms
78,312 KB
testcase_31 WA -
testcase_32 AC 541 ms
130,616 KB
testcase_33 AC 84 ms
76,248 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 96 ms
76,744 KB
testcase_37 WA -
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
a = list(map(int,input().split()))
a = sorted(a)

s = sum(a)
d = [[0 for j in range(s+1)] for i in range(n+1)]
d[0][0] = 1

for x in a:
    d_next = [[0 for j in range(s+1)] for i in range(n+1)]
    d[0][0] = 1
    for i in range(n):
        for j in range(s):
            d_next[i][j] += d[i][j]
            if j+x <= s:
                d_next[i+1][j+x] += d[i][j]
    d = d_next

        
ans = 0
for i in range(s+1):
    for j in range(1,n+1):
        if i >= j*k:
            ans += d[j][i]
print(ans)
0