結果

問題 No.1304 あなたは基本が何か知っていますか?私は知っています.
ユーザー junkaijunkai
提出日時 2020-12-02 20:56:15
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 938 bytes
コンパイル時間 1,568 ms
コンパイル使用メモリ 171,488 KB
実行使用メモリ 176,840 KB
最終ジャッジ日時 2023-09-03 04:02:27
合計ジャッジ時間 28,901 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
176,644 KB
testcase_01 AC 89 ms
176,516 KB
testcase_02 AC 70 ms
176,532 KB
testcase_03 AC 374 ms
176,636 KB
testcase_04 WA -
testcase_05 AC 77 ms
176,600 KB
testcase_06 AC 78 ms
176,540 KB
testcase_07 WA -
testcase_08 AC 117 ms
176,704 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 85 ms
176,612 KB
testcase_13 AC 75 ms
176,652 KB
testcase_14 AC 82 ms
176,632 KB
testcase_15 WA -
testcase_16 AC 86 ms
176,564 KB
testcase_17 AC 102 ms
176,640 KB
testcase_18 AC 84 ms
176,656 KB
testcase_19 AC 73 ms
176,588 KB
testcase_20 AC 68 ms
176,580 KB
testcase_21 AC 101 ms
176,528 KB
testcase_22 WA -
testcase_23 AC 94 ms
176,684 KB
testcase_24 WA -
testcase_25 AC 178 ms
176,584 KB
testcase_26 AC 115 ms
176,536 KB
testcase_27 AC 122 ms
176,540 KB
testcase_28 AC 137 ms
176,772 KB
testcase_29 WA -
testcase_30 AC 153 ms
176,712 KB
testcase_31 AC 219 ms
176,604 KB
testcase_32 AC 124 ms
176,600 KB
testcase_33 AC 177 ms
176,572 KB
testcase_34 AC 125 ms
176,656 KB
testcase_35 AC 153 ms
176,708 KB
testcase_36 AC 196 ms
176,636 KB
testcase_37 AC 165 ms
176,588 KB
testcase_38 AC 156 ms
176,604 KB
testcase_39 AC 237 ms
176,584 KB
testcase_40 AC 163 ms
176,576 KB
testcase_41 AC 247 ms
176,708 KB
testcase_42 AC 159 ms
176,540 KB
testcase_43 AC 160 ms
176,820 KB
testcase_44 AC 201 ms
176,816 KB
04_evil_A_01 RE -
04_evil_A_02 RE -
04_evil_A_03 RE -
04_evil_A_04 RE -
04_evil_A_05 RE -
04_evil_A_06 RE -
04_evil_A_07 RE -
04_evil_A_08 RE -
04_evil_A_09 RE -
04_evil_A_10 RE -
05_evil_B_01 RE -
05_evil_B_02 RE -
05_evil_B_03 RE -
05_evil_B_04 RE -
05_evil_B_05 RE -
05_evil_B_06 RE -
05_evil_B_07 RE -
05_evil_B_08 RE -
05_evil_B_09 RE -
05_evil_B_10 RE -
06_evil_C_01 RE -
06_evil_C_02 RE -
06_evil_C_03 RE -
06_evil_C_04 RE -
06_evil_C_05 RE -
06_evil_C_06 RE -
06_evil_C_07 RE -
06_evil_C_08 RE -
06_evil_C_09 RE -
06_evil_C_10 AC 57 ms
176,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int MOD = 998244353;
int dp[41][1040][1040];
void add(int &a, int b)
{
    a = (a+b) % MOD;
}
int main()
{
    int n, k, x, y;
    cin >> n >> k >> x >> y;
    set<int> s;
    rep(i, k)
    {
        int a;
        cin >> a;
        s.insert(a);
    }
    memset(dp, 0, sizeof(dp));
    int mn = 1030;
    dp[0][0][0] = 1;
    rep(i, n)
    {
        rep(j, mn)
        {
            int sum = 0;
            rep(t, mn) add(sum, dp[i][j][t]);
            if(sum == 0) continue;
            for(int l : s)
            {
                add(sum, -dp[i][j][l]);
                add(dp[i+1][j^l][l], sum);
                add(sum, dp[i][j][l]);
            }
        }
    }
    int ans = 0;
    for(int i = x; i <= min(1030, y); i++) rep(j, 1030) add(ans, dp[n][i][j]);
    cout << ans << endl;
}
0