結果

問題 No.1304 あなたは基本が何か知っていますか?私は知っています.
ユーザー ytftytft
提出日時 2021-05-23 01:58:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 876 bytes
コンパイル時間 10,821 ms
コンパイル使用メモリ 375,688 KB
実行使用メモリ 15,592 KB
最終ジャッジ日時 2023-09-03 04:18:08
合計ジャッジ時間 26,465 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 16 ms
15,592 KB
testcase_05 AC 8 ms
8,548 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 13 ms
13,304 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 13 ms
12,244 KB
testcase_10 AC 10 ms
10,216 KB
testcase_11 AC 13 ms
12,864 KB
testcase_12 AC 10 ms
10,656 KB
testcase_13 AC 7 ms
8,020 KB
testcase_14 AC 9 ms
9,780 KB
testcase_15 AC 9 ms
9,512 KB
testcase_16 AC 10 ms
10,444 KB
testcase_17 AC 3 ms
4,488 KB
testcase_18 AC 9 ms
10,120 KB
testcase_19 AC 5 ms
6,684 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 6 ms
5,804 KB
testcase_22 AC 11 ms
10,960 KB
testcase_23 AC 13 ms
12,772 KB
testcase_24 AC 16 ms
15,448 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 3 ms
4,508 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 AC 3 ms
4,376 KB
testcase_33 AC 2 ms
4,380 KB
testcase_34 AC 3 ms
4,380 KB
testcase_35 AC 2 ms
4,376 KB
testcase_36 AC 2 ms
4,376 KB
testcase_37 AC 2 ms
4,376 KB
testcase_38 AC 2 ms
4,376 KB
testcase_39 AC 2 ms
4,376 KB
testcase_40 AC 2 ms
4,376 KB
testcase_41 AC 2 ms
4,376 KB
testcase_42 AC 2 ms
4,376 KB
testcase_43 AC 2 ms
4,380 KB
testcase_44 AC 2 ms
4,376 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 MLE -
05_evil_B_02 MLE -
05_evil_B_03 MLE -
05_evil_B_04 MLE -
05_evil_B_05 MLE -
05_evil_B_06 MLE -
05_evil_B_07 MLE -
05_evil_B_08 MLE -
05_evil_B_09 MLE -
05_evil_B_10 MLE -
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 2 ms
4,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
typedef boost::multiprecision::cpp_int mp;

int main(){
    int N,K,X,Y;
    cin>>N>>K>>X>>Y;
    vector<int> A(K);
    int MOD=998244353;
    vector<vector<vector<int>>> dp(N,vector<vector<int>>(K,vector<int>(1024)));
    vector<vector<int>> dp2(N,vector<int>(1024));
    for(int i=0;i<K;i++){
        cin>>A[i];
        dp[0][i][A[i]]++;
        dp2[0][A[i]]++;
    }
    for(int i=1;i<N;i++){
        for(int j=0;j<K;j++){
            for(int k=0;k<1024;k++){
                dp[i][j][k^A[j]]=(dp[i][j][k^A[j]]+dp2[i-1][k]-dp[i-1][j][k])%MOD;
                dp2[i][k^A[j]]=(dp2[i][k^A[j]]+dp2[i-1][k]-dp[i-1][j][k])%MOD;
            }
        }
    }
    int ans=0;
    for(int i=X;i<=Y;i++){
        ans=(ans+dp2[N-1][i])%MOD;
    }
    while(ans<0)ans+=MOD;
    cout<<ans<<endl;
}
0