結果

問題 No.733 分身並列コーディング
ユーザー togetogehattogetogehat
提出日時 2018-09-09 18:44:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 482 bytes
コンパイル時間 822 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 76,324 KB
最終ジャッジ日時 2023-08-25 13:23:14
合計ジャッジ時間 7,210 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,116 KB
testcase_01 AC 70 ms
70,828 KB
testcase_02 AC 69 ms
70,984 KB
testcase_03 AC 72 ms
70,948 KB
testcase_04 AC 78 ms
75,668 KB
testcase_05 AC 71 ms
71,196 KB
testcase_06 AC 72 ms
71,220 KB
testcase_07 AC 70 ms
71,348 KB
testcase_08 AC 71 ms
71,116 KB
testcase_09 WA -
testcase_10 AC 78 ms
75,796 KB
testcase_11 AC 76 ms
75,768 KB
testcase_12 AC 77 ms
75,612 KB
testcase_13 AC 77 ms
75,428 KB
testcase_14 AC 76 ms
75,780 KB
testcase_15 AC 77 ms
75,644 KB
testcase_16 AC 79 ms
75,820 KB
testcase_17 AC 78 ms
75,652 KB
testcase_18 AC 75 ms
75,636 KB
testcase_19 AC 79 ms
75,804 KB
testcase_20 WA -
testcase_21 AC 80 ms
75,672 KB
testcase_22 AC 80 ms
75,728 KB
testcase_23 AC 79 ms
75,728 KB
testcase_24 WA -
testcase_25 AC 77 ms
75,796 KB
testcase_26 AC 77 ms
75,652 KB
testcase_27 AC 77 ms
75,752 KB
testcase_28 AC 81 ms
75,740 KB
testcase_29 AC 81 ms
75,744 KB
testcase_30 AC 78 ms
75,576 KB
testcase_31 AC 81 ms
75,820 KB
testcase_32 AC 76 ms
75,684 KB
testcase_33 AC 80 ms
75,728 KB
testcase_34 WA -
testcase_35 AC 72 ms
75,636 KB
testcase_36 AC 79 ms
75,764 KB
testcase_37 AC 71 ms
70,996 KB
testcase_38 AC 80 ms
75,984 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 74 ms
75,532 KB
testcase_43 AC 78 ms
75,940 KB
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 80 ms
75,724 KB
testcase_47 WA -
testcase_48 AC 83 ms
75,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t = int(input())
n = int(input())
a = [int(input()) for _ in range(n)]
v = set()
for r in range(n):
    dp = [-1]*(t+1)
    dp[0] = 0
    for i in range(n):
        if i in v:
            continue
        for j in range(a[i], t+1)[::-1]:
            if dp[j]<0 and dp[j-a[i]]>=0:
                dp[j] = i
    for i in range(t+1)[::-1]:
        if dp[i] >= 0:
            break
    while i > 0:
        v.add(dp[i])
        i -= a[dp[i]]
    if len(v) == n:
        break
print(r+1)
0