結果

問題 No.1304 あなたは基本が何か知っていますか?私は知っています.
ユーザー junkaijunkai
提出日時 2020-12-02 21:06:18
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 951 bytes
コンパイル時間 1,759 ms
コンパイル使用メモリ 170,024 KB
実行使用メモリ 350,172 KB
最終ジャッジ日時 2023-09-03 04:03:22
合計ジャッジ時間 57,102 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
349,800 KB
testcase_01 AC 150 ms
349,800 KB
testcase_02 AC 119 ms
349,856 KB
testcase_03 AC 534 ms
349,812 KB
testcase_04 WA -
testcase_05 AC 141 ms
349,876 KB
testcase_06 AC 122 ms
349,928 KB
testcase_07 WA -
testcase_08 AC 191 ms
349,808 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 152 ms
349,832 KB
testcase_13 AC 133 ms
349,828 KB
testcase_14 AC 145 ms
349,832 KB
testcase_15 WA -
testcase_16 AC 150 ms
349,828 KB
testcase_17 AC 162 ms
349,864 KB
testcase_18 AC 147 ms
349,836 KB
testcase_19 AC 129 ms
349,876 KB
testcase_20 AC 119 ms
349,804 KB
testcase_21 AC 177 ms
349,868 KB
testcase_22 WA -
testcase_23 AC 163 ms
350,172 KB
testcase_24 WA -
testcase_25 AC 271 ms
349,820 KB
testcase_26 AC 187 ms
350,088 KB
testcase_27 AC 194 ms
349,924 KB
testcase_28 AC 219 ms
349,936 KB
testcase_29 WA -
testcase_30 AC 237 ms
349,812 KB
testcase_31 AC 328 ms
349,808 KB
testcase_32 AC 195 ms
349,804 KB
testcase_33 AC 272 ms
349,812 KB
testcase_34 AC 190 ms
350,032 KB
testcase_35 AC 235 ms
349,812 KB
testcase_36 AC 308 ms
349,996 KB
testcase_37 AC 239 ms
349,816 KB
testcase_38 AC 235 ms
349,944 KB
testcase_39 AC 351 ms
349,800 KB
testcase_40 AC 239 ms
349,856 KB
testcase_41 AC 350 ms
349,864 KB
testcase_42 AC 236 ms
349,812 KB
testcase_43 AC 234 ms
349,856 KB
testcase_44 AC 296 ms
349,804 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 105 ms
349,852 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++)
ll MOD = 998244353;
ll dp[41][1040][1040];
void add(ll &a, ll 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)
        {
            ll 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]);
            }
        }
    }
    ll ans = 0;
    for(int i = x; i <= min(mn, y); i++) for(int j : s) add(ans, dp[n][i][j]);
    add(ans, MOD);
    cout << ans << endl;
}
0