結果

問題 No.1825 Except One
ユーザー boatmusclesboatmuscles
提出日時 2022-01-28 22:37:38
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 807 bytes
コンパイル時間 408 ms
コンパイル使用メモリ 45,044 KB
実行使用メモリ 101,604 KB
最終ジャッジ日時 2023-08-28 20:57:18
合計ジャッジ時間 8,473 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,136 KB
testcase_01 AC 3 ms
7,156 KB
testcase_02 AC 4 ms
11,232 KB
testcase_03 AC 768 ms
101,288 KB
testcase_04 AC 219 ms
54,204 KB
testcase_05 AC 55 ms
18,076 KB
testcase_06 AC 8 ms
5,252 KB
testcase_07 AC 645 ms
93,940 KB
testcase_08 AC 643 ms
94,360 KB
testcase_09 AC 7 ms
15,348 KB
testcase_10 AC 388 ms
73,408 KB
testcase_11 AC 90 ms
40,148 KB
testcase_12 AC 234 ms
48,388 KB
testcase_13 AC 130 ms
42,436 KB
testcase_14 AC 2 ms
4,944 KB
testcase_15 AC 6 ms
5,000 KB
testcase_16 AC 6 ms
5,000 KB
testcase_17 AC 3 ms
4,940 KB
testcase_18 AC 2 ms
5,004 KB
testcase_19 AC 5 ms
5,004 KB
testcase_20 AC 5 ms
5,008 KB
testcase_21 AC 3 ms
5,004 KB
testcase_22 AC 4 ms
4,940 KB
testcase_23 AC 4 ms
5,004 KB
testcase_24 AC 94 ms
24,840 KB
testcase_25 AC 105 ms
30,796 KB
testcase_26 AC 13 ms
7,384 KB
testcase_27 AC 504 ms
81,300 KB
testcase_28 WA -
testcase_29 AC 13 ms
21,480 KB
testcase_30 AC 15 ms
23,516 KB
testcase_31 AC 49 ms
33,164 KB
testcase_32 AC 700 ms
97,516 KB
testcase_33 AC 11 ms
19,324 KB
testcase_34 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<cstdio>
#include<algorithm>
int dp[51][5001][101];

int main(){
    int N;
    scanf("%d", &N);
    int A[N];
    for(int i = 0; i < N; ++i) scanf("%d", A + i);
    dp[0][0][0] = 1;
    for (int i = 0; i < N; i++)
    {
        for (int j = i; j >= 0; j--)
        {
            for (int k = 0; k <= i*100; k++)
            {
                for (int l = 0; l <= 100; l++)
                {
                    dp[j+1][k + A[i]][std::max(l, A[i])] += dp[j][k][l];
                }
            }
        }
    }
    int answer = 0;
    for (int i = 2; i <= N; i++)
    {
        for (int j = 0; j*(i-1) <= 5000; j++)
        {
            for (int k = 0; k <= j && k <= 100; k++)
            {
                answer += dp[i][j*(i-1)][k];
            }
        }
    }
    printf("%d\n", answer);
}
0