結果
問題 | No.1304 あなたは基本が何か知っていますか?私は知っています. |
ユーザー | kappybar |
提出日時 | 2020-12-05 20:42:47 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
MLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 2,838 bytes |
コンパイル時間 | 1,388 ms |
コンパイル使用メモリ | 171,532 KB |
実行使用メモリ | 696,468 KB |
最終ジャッジ日時 | 2024-06-12 16:14:15 |
合計ジャッジ時間 | 46,171 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 114 ms
355,248 KB |
testcase_01 | MLE | - |
testcase_02 | AC | 112 ms
353,748 KB |
testcase_03 | MLE | - |
testcase_04 | AC | 112 ms
355,372 KB |
testcase_05 | MLE | - |
testcase_06 | AC | 115 ms
353,740 KB |
testcase_07 | MLE | - |
testcase_08 | AC | 166 ms
353,616 KB |
testcase_09 | MLE | - |
testcase_10 | AC | 112 ms
353,692 KB |
testcase_11 | MLE | - |
testcase_12 | AC | 112 ms
355,180 KB |
testcase_13 | AC | 113 ms
348,056 KB |
testcase_14 | AC | 115 ms
348,244 KB |
testcase_15 | AC | 114 ms
348,196 KB |
testcase_16 | AC | 110 ms
348,248 KB |
testcase_17 | AC | 139 ms
348,364 KB |
testcase_18 | AC | 110 ms
348,212 KB |
testcase_19 | AC | 110 ms
348,164 KB |
testcase_20 | AC | 111 ms
348,048 KB |
testcase_21 | AC | 135 ms
348,184 KB |
testcase_22 | AC | 111 ms
348,292 KB |
testcase_23 | AC | 111 ms
348,372 KB |
testcase_24 | AC | 112 ms
348,192 KB |
testcase_25 | AC | 239 ms
348,276 KB |
testcase_26 | AC | 161 ms
348,192 KB |
testcase_27 | AC | 164 ms
348,204 KB |
testcase_28 | AC | 190 ms
348,192 KB |
testcase_29 | AC | 161 ms
348,188 KB |
testcase_30 | AC | 215 ms
348,228 KB |
testcase_31 | AC | 295 ms
348,216 KB |
testcase_32 | AC | 160 ms
348,288 KB |
testcase_33 | AC | 241 ms
348,216 KB |
testcase_34 | AC | 167 ms
348,204 KB |
testcase_35 | AC | 212 ms
348,184 KB |
testcase_36 | AC | 270 ms
348,136 KB |
testcase_37 | AC | 218 ms
348,268 KB |
testcase_38 | AC | 218 ms
348,316 KB |
testcase_39 | AC | 322 ms
348,384 KB |
testcase_40 | AC | 213 ms
348,184 KB |
testcase_41 | AC | 318 ms
348,160 KB |
testcase_42 | AC | 212 ms
348,160 KB |
testcase_43 | AC | 213 ms
348,276 KB |
testcase_44 | AC | 267 ms
348,196 KB |
04_evil_A_01 | WA | - |
04_evil_A_02 | WA | - |
04_evil_A_03 | WA | - |
04_evil_A_04 | WA | - |
04_evil_A_05 | WA | - |
04_evil_A_06 | WA | - |
04_evil_A_07 | WA | - |
04_evil_A_08 | WA | - |
04_evil_A_09 | WA | - |
04_evil_A_10 | WA | - |
05_evil_B_01 | WA | - |
05_evil_B_02 | WA | - |
05_evil_B_03 | WA | - |
05_evil_B_04 | WA | - |
05_evil_B_05 | WA | - |
05_evil_B_06 | WA | - |
05_evil_B_07 | WA | - |
05_evil_B_08 | WA | - |
05_evil_B_09 | WA | - |
05_evil_B_10 | WA | - |
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 | MLE | - |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) #define chmin(x,y) x = min((x),(y)); #define chmax(x,y) x = max((x),(y)); using namespace std; using ll = long long ; using P = pair<int,int> ; using pll = pair<long long,long long>; const int INF = 1e9; const long long LINF = 1e17; //const int MOD = 1000000007; const int MOD = 998244353; const double PI = 3.14159265358979323846; template<int mod> struct ModInt{ long long x=0; constexpr ModInt(long long x=0):x((x%mod+mod)%mod){} constexpr ModInt operator+(const ModInt& r)const{return ModInt(*this)+=r;} constexpr ModInt operator-(const ModInt& r)const{return ModInt(*this)-=r;} constexpr ModInt operator*(const ModInt& r)const{return ModInt(*this)*=r;} constexpr ModInt operator/(const ModInt& r)const{return ModInt(*this)/=r;} constexpr ModInt& operator+=(const ModInt& r){ if((x+=r.x)>=mod) x-=mod; return *this;} constexpr ModInt& operator-=(const ModInt& r){ if((x-=r.x)<0) x+=mod; return *this;} constexpr ModInt& operator*=(const ModInt& r){ if((x*=r.x)>=mod) x%=mod; return *this;} constexpr ModInt& operator/=(const ModInt& r){ return *this*=r.inv();} ModInt inv() const { long long s=x,sx=1,sy=0,t=mod,tx=0,ty=1; while(s%t!=0){ long long temp=s/t,u=s-t*temp,ux=sx-temp*tx,uy=sy-temp*ty; s=t;sx=tx;sy=ty; t=u;tx=ux;ty=uy; } return ModInt(tx); } ModInt pow(long long n) const { ModInt a=1; ModInt b=*this; while(n>0){ if(n&1) a*=b; b*=b; n>>=1; } return a; } friend constexpr ostream& operator<<(ostream& os,const ModInt<mod>& a) {return os << a.x;} friend constexpr istream& operator>>(istream& is,ModInt<mod>& a) {return is >> a.x;} }; using mint = ModInt<MOD>; mint dp[42][1025][1025]; mint a[2000]; int main(){ rep(i,42)rep(j,1025)rep(k,1025) dp[i][j][k] = 0; rep(i,2000) a[i] = 0; int n,K; cin >> n >> K; ll x,y; cin >> x >> y; rep(i,K){ int b; cin >> b; a[b] = mint(1); } vector<mint> dpp(1024,0); for(int i=0;i<1024;i++){ for(int j=0;j<1024;j++){ if(i == j) continue; dp[1][i^j][j] += (a[i] * a[j]); dpp[i^j] += (a[i] * a[j]); } } for(int i=1;i<n-1;i++){ vector<mint> new_dpp(1024,0); for(int j=0;j<1024;j++){ for(int k=0;k<1024;k++){ dp[i+1][k][j^k] += (dpp[j] - dp[i][j][j^k]) * a[j^k]; new_dpp[k] += (dpp[j] - dp[i][j][j^k]) * a[j^k]; } } swap(new_dpp,dpp); } mint ans = 0; for(ll i=x;i<=min(y,1024LL);i++){ for(int j=0;j<1024;j++) ans += dp[n-1][i][j]; } cout << ans << endl; return 0; }