結果

問題 No.1304 あなたは基本が何か知っていますか?私は知っています.
ユーザー kzyKTkzyKT
提出日時 2020-12-01 11:08:30
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,525 bytes
コンパイル時間 3,885 ms
コンパイル使用メモリ 145,100 KB
実行使用メモリ 39,636 KB
最終ジャッジ日時 2023-09-03 03:21:57
合計ジャッジ時間 38,651 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
39,424 KB
testcase_01 AC 29 ms
24,132 KB
testcase_02 AC 25 ms
24,392 KB
testcase_03 AC 102 ms
24,128 KB
testcase_04 WA -
testcase_05 AC 36 ms
26,992 KB
testcase_06 AC 30 ms
39,316 KB
testcase_07 WA -
testcase_08 AC 43 ms
27,016 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 37 ms
24,328 KB
testcase_13 AC 35 ms
24,192 KB
testcase_14 AC 35 ms
39,512 KB
testcase_15 WA -
testcase_16 AC 38 ms
19,756 KB
testcase_17 AC 42 ms
19,796 KB
testcase_18 AC 37 ms
19,752 KB
testcase_19 AC 33 ms
19,748 KB
testcase_20 AC 29 ms
19,808 KB
testcase_21 AC 44 ms
19,804 KB
testcase_22 WA -
testcase_23 AC 38 ms
19,748 KB
testcase_24 WA -
testcase_25 AC 55 ms
19,752 KB
testcase_26 AC 42 ms
19,744 KB
testcase_27 AC 50 ms
19,932 KB
testcase_28 AC 47 ms
19,748 KB
testcase_29 WA -
testcase_30 AC 46 ms
19,812 KB
testcase_31 AC 66 ms
19,752 KB
testcase_32 AC 48 ms
19,812 KB
testcase_33 AC 55 ms
19,752 KB
testcase_34 AC 47 ms
19,744 KB
testcase_35 AC 50 ms
19,928 KB
testcase_36 AC 60 ms
19,812 KB
testcase_37 AC 52 ms
20,036 KB
testcase_38 AC 46 ms
19,740 KB
testcase_39 AC 66 ms
19,864 KB
testcase_40 AC 55 ms
19,808 KB
testcase_41 AC 69 ms
19,744 KB
testcase_42 AC 54 ms
19,740 KB
testcase_43 AC 53 ms
19,740 KB
testcase_44 AC 64 ms
19,796 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 17 ms
22,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}void pr(){ln;}
template<class A,class...B>void pr(const A &a,const B&...b){cout<<a<<(sizeof...(b)?" ":"");pr(b...);}
template<class A>void PR(A a,ll n){rep(i,n)cout<<(i?" ":"")<<a[i];ln;}
const ll MAX=998244353,MAXL=1LL<<61,dx[8]={-1,0,1,0,-1,-1,1,1},dy[8]={0,1,0,-1,-1,1,1,-1};
typedef pair<ll,ll> P;

ll dp[2][1024][1024];

void Main() {
  int n,m,l,r;
  cin >> n >> m >> l >> r;
  ll d[1024];
  mem(d);
  rep(i,m) {
    ll x;
    R x;
    d[x]=1;
  }
  ll t=0;
  dp[0][0][0]=1;
  rep(i,n) {
    rep(j,1024) {
      ll sum=0;
      rep(k,1024) sum+=dp[t][j][k];
      rep(k,1024) {
        if(!d[k]) continue;
        dp[t^1][j^k][k]+=sum-dp[t][j][k]+MAX;
        dp[t^1][j^k][k]%=MAX;
      }
    }
    mem(dp[t]);
    t^=1;
  }
  l=min(l,1024);
  r=min(r,1024);
  ll ans=0;
  REP(j,l,r+1) {
    rep(k,1024) {
      ans+=dp[t][j][k];
      ans%=MAX;
    }
  }
  pr(ans);
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}
0