結果

問題 No.1304 あなたは基本が何か知っていますか?私は知っています.
ユーザー KKT89KKT89
提出日時 2020-12-01 18:12:08
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 1,625 bytes
コンパイル時間 3,356 ms
コンパイル使用メモリ 68,520 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-03 03:31:17
合計ジャッジ時間 10,903 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 3 ms
4,380 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 1 ms
4,384 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 5 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,384 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 3 ms
4,380 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 4 ms
4,376 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 3 ms
4,376 KB
testcase_24 AC 3 ms
4,376 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 5 ms
4,380 KB
testcase_27 AC 5 ms
4,380 KB
testcase_28 AC 5 ms
4,380 KB
testcase_29 AC 4 ms
4,384 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 AC 5 ms
4,384 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 AC 5 ms
4,376 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 2 ms
4,380 KB
testcase_37 AC 2 ms
4,380 KB
testcase_38 AC 2 ms
4,380 KB
testcase_39 AC 1 ms
4,380 KB
testcase_40 AC 2 ms
4,380 KB
testcase_41 AC 1 ms
4,380 KB
testcase_42 AC 2 ms
4,376 KB
testcase_43 AC 2 ms
4,376 KB
testcase_44 AC 1 ms
4,380 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 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
#include <stdio.h>
typedef long long int ll;

// struct fastI{
//     char in[1<<26];
//     char const*o;
//     fastI(){
//         o = in; 
//         in[fread(in,1,sizeof(in)-4,stdin)]=0;
//     }
//     fastI& operator>>(char& c){
//         while(*o&&*o<=32)++o;
//         c=*o++;
//         return *this;
//     }
//     fastI& operator>>(int& u){
//         u=0; 
//         unsigned s=0;
//         while(*o&&*o<=32)++o;
//         if (*o == '-')s = ~s, ++o; else if (*o == '+')++o;
//         while('0'<=*o && *o<='9')u = (u<<3) + (u << 1) + (*o++ - '0');
//         (u^=s)+=!!s;
//         return *this;
//     }
//     fastI& operator>>(long long& u){
//         u=0;
//         uint64_t s=0;
//         while(*o&&*o<=32)++o;
//         if (*o == '-')s = ~s, ++o; else if (*o == '+')++o;
//         while('0'<=*o && *o<='9')u = (u<<3) + (u << 1) + (*o++ - '0');
//         (u^=s)+=!!s;
//         return *this;
//     }
// } fin;

const ll mod=998244353;
const int N=1024;

int A[1024];
ll dp[42][1024];
int n,k,m,x,y,a;

int main(){
    scanf("%d%d%d%d",&n,&m,&x,&y);y++;
    for(int i=0;i<m;i++){
        scanf("%d",&a);
        k+=(A[a]?0:++A[a]);
    }
    dp[0][0]=1;
    for(int i=0;i<n;i++){
        for(int j=0;j<N;j++){
            if(dp[i][j]==0)continue;
            for(int l=0;l<N;l++){
                dp[i+1][j^l]+=A[l]*dp[i][j];
            }
            dp[i+2][j]-=dp[i][j]*(k-(i>0));
        }
    }
    ll res=0;
    for(int i=x;;i++){
        if(i==N || i==y)break;
        res+=dp[n][i];
    }
    res%=mod;
    printf("%lld\n",res);
}
0