結果
問題 | No.1304 あなたは基本が何か知っていますか?私は知っています. |
ユーザー | leafirby |
提出日時 | 2021-02-01 03:42:20 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,427 bytes |
コンパイル時間 | 1,826 ms |
コンパイル使用メモリ | 176,440 KB |
実行使用メモリ | 281,824 KB |
最終ジャッジ日時 | 2024-06-12 16:37:33 |
合計ジャッジ時間 | 13,371 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 69 ms
52,332 KB |
testcase_01 | AC | 82 ms
68,848 KB |
testcase_02 | AC | 71 ms
52,328 KB |
testcase_03 | AC | 238 ms
281,824 KB |
testcase_04 | AC | 70 ms
52,256 KB |
testcase_05 | AC | 73 ms
52,372 KB |
testcase_06 | AC | 71 ms
52,344 KB |
testcase_07 | AC | 71 ms
52,364 KB |
testcase_08 | WA | - |
testcase_09 | AC | 70 ms
52,400 KB |
testcase_10 | AC | 71 ms
52,264 KB |
testcase_11 | AC | 71 ms
52,224 KB |
testcase_12 | AC | 73 ms
52,252 KB |
testcase_13 | AC | 73 ms
52,424 KB |
testcase_14 | AC | 69 ms
52,308 KB |
testcase_15 | AC | 71 ms
52,260 KB |
testcase_16 | AC | 70 ms
52,348 KB |
testcase_17 | WA | - |
testcase_18 | AC | 71 ms
52,320 KB |
testcase_19 | AC | 72 ms
52,280 KB |
testcase_20 | AC | 68 ms
52,344 KB |
testcase_21 | WA | - |
testcase_22 | AC | 70 ms
52,248 KB |
testcase_23 | AC | 69 ms
52,392 KB |
testcase_24 | AC | 72 ms
52,320 KB |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | AC | 116 ms
118,064 KB |
testcase_31 | AC | 155 ms
167,004 KB |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | AC | 118 ms
117,964 KB |
testcase_39 | AC | 164 ms
183,628 KB |
testcase_40 | WA | - |
testcase_41 | WA | - |
testcase_42 | WA | - |
testcase_43 | AC | 119 ms
118,024 KB |
testcase_44 | AC | 141 ms
150,740 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 | AC | 73 ms
52,352 KB |
04_evil_A_07 | AC | 72 ms
52,344 KB |
04_evil_A_08 | AC | 72 ms
52,356 KB |
04_evil_A_09 | AC | 71 ms
52,372 KB |
04_evil_A_10 | AC | 69 ms
52,516 KB |
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 | 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 | 68 ms
44,172 KB |
ソースコード
#include <bits/stdc++.h> #pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") using namespace std; #define ll long long #define rep(i, m, n) for (ll i = m; i < n; i++) #define mod 998244353 void fwt(vector<ll>& f) { int n = f.size(); for(int i = 1; i < n; i <<= 1) { for(int j = 0; j < n; j++) { if((j & i) == 0) { ll x = f[j], y = f[j | i]; f[j] = x + y, f[j | i] = x - y; } } } } void ifwt(vector<ll>& f) { int n = f.size(); for(int i = 1; i < n; i <<= 1) { for(int j = 0; j < n; j++) { if((j & i) == 0) { ll x = f[j], y = f[j | i]; f[j] = (x + y) / 2, f[j | i] = (x - y) / 2; } } } } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); ll N, K, X, Y; cin >> N >> K >> X >> Y; ll M = 1048576; vector<vector<ll>> dp(N + 2, vector<ll>(M, 1)); vector<ll> H(M); rep(i, 0, K) { ll A; cin >> A; H[A]++; } fwt(H); rep(v, 0, M) dp[1][v] = dp[0][v] * H[v]; rep(v, 0, M) dp[2][v] = dp[1][v] * H[v] - K * dp[0][v]; rep(i, 3, N + 1) rep(v, 0, M) dp[i][v] = (dp[i - 1][v] * H[v] - (K - 1) * dp[i - 2][v] + 10LL * mod) % mod; vector<ll> ep(M); rep(v, 0, M) ep[v] = dp[N][v]; ifwt(ep); ll res=0; rep(v, 0, M) if(X <= v & v <= Y) res = (res + ep[v]) % mod; cout << res % mod << endl; }