結果

問題 No.1304 あなたは基本が何か知っていますか?私は知っています.
ユーザー chocoruskchocorusk
提出日時 2020-12-01 19:29:28
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 1,593 bytes
コンパイル時間 1,318 ms
コンパイル使用メモリ 135,492 KB
実行使用メモリ 39,500 KB
最終ジャッジ日時 2023-09-03 03:34:31
合計ジャッジ時間 36,085 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
39,412 KB
testcase_01 AC 12 ms
24,452 KB
testcase_02 AC 8 ms
24,144 KB
testcase_03 AC 59 ms
27,048 KB
testcase_04 AC 17 ms
39,308 KB
testcase_05 AC 14 ms
24,224 KB
testcase_06 AC 8 ms
26,884 KB
testcase_07 AC 19 ms
24,256 KB
testcase_08 AC 16 ms
24,444 KB
testcase_09 AC 18 ms
24,312 KB
testcase_10 AC 16 ms
24,248 KB
testcase_11 AC 19 ms
26,864 KB
testcase_12 AC 16 ms
24,136 KB
testcase_13 AC 14 ms
24,156 KB
testcase_14 AC 16 ms
24,184 KB
testcase_15 AC 15 ms
39,500 KB
testcase_16 AC 16 ms
24,304 KB
testcase_17 AC 14 ms
19,920 KB
testcase_18 AC 15 ms
19,748 KB
testcase_19 AC 12 ms
19,760 KB
testcase_20 AC 9 ms
19,764 KB
testcase_21 AC 16 ms
19,828 KB
testcase_22 AC 17 ms
19,776 KB
testcase_23 AC 19 ms
19,804 KB
testcase_24 AC 21 ms
19,756 KB
testcase_25 AC 26 ms
19,940 KB
testcase_26 AC 19 ms
19,752 KB
testcase_27 AC 20 ms
19,780 KB
testcase_28 AC 22 ms
19,752 KB
testcase_29 AC 17 ms
19,768 KB
testcase_30 AC 24 ms
19,752 KB
testcase_31 AC 33 ms
19,872 KB
testcase_32 AC 18 ms
19,768 KB
testcase_33 AC 26 ms
19,804 KB
testcase_34 AC 17 ms
19,744 KB
testcase_35 AC 25 ms
19,920 KB
testcase_36 AC 30 ms
19,740 KB
testcase_37 AC 24 ms
19,760 KB
testcase_38 AC 22 ms
19,744 KB
testcase_39 AC 35 ms
19,740 KB
testcase_40 AC 24 ms
19,748 KB
testcase_41 AC 39 ms
19,748 KB
testcase_42 AC 28 ms
19,756 KB
testcase_43 AC 29 ms
19,768 KB
testcase_44 AC 30 ms
19,776 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 TLE -
06_evil_C_02 TLE -
06_evil_C_03 TLE -
06_evil_C_04 TLE -
06_evil_C_05 TLE -
06_evil_C_06 TLE -
06_evil_C_07 TLE -
06_evil_C_08 TLE -
06_evil_C_09 TLE -
06_evil_C_10 AC 4 ms
16,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#define popcount __builtin_popcount
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

int main()
{
    int n, k, x, y;
    cin>>n>>k>>x>>y;
    vector<int> a(k);
    for(int i=0; i<k; i++){
        cin>>a[i];
    }
    sort(a.begin(), a.end());
    a.erase(unique(a.begin(), a.end()), a.end());
    k=a.size();
    const ll MOD=998244353;
    ll dp[1<<10][1<<10]={};
    for(int i=0; i<k; i++){
        dp[a[i]][i]=1;
    }
    for(int i=0; i<n-1; i++){
        ll dps[1<<10]={};
        for(int j=0; j<(1<<10); j++){
            for(int l=0; l<k; l++){
                dps[j]+=dp[j][l];
            }
        }
        ll dp2[1<<10][1<<10]={};
        for(int j=0; j<(1<<10); j++){
            for(int l=0; l<k; l++){
                dp2[j^a[l]][l]+=dps[j];
            }
        }
        for(int j=0; j<(1<<10); j++){
            for(int l=0; l<k; l++){
                dp2[j^a[l]][l]-=dp[j][l];
            }
        }
        swap(dp, dp2);
    }
    ll ans=0;
    for(int i=x; i<=min(y, (1<<10)-1); i++){
        for(int j=0; j<k; j++){
            ans+=dp[i][j];
        }
    }
    cout<<ans%MOD<<endl;
    return 0;
}
0