結果
問題 | No.1304 あなたは基本が何か知っていますか?私は知っています. |
ユーザー | 👑 jupiro |
提出日時 | 2020-12-01 20:20:42 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 36 ms / 2,000 ms |
コード長 | 2,975 bytes |
コンパイル時間 | 1,887 ms |
コンパイル使用メモリ | 142,992 KB |
実行使用メモリ | 31,144 KB |
最終ジャッジ日時 | 2023-09-03 03:35:15 |
合計ジャッジ時間 | 32,659 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
7,592 KB |
testcase_01 | AC | 2 ms
8,768 KB |
testcase_02 | AC | 2 ms
7,716 KB |
testcase_03 | AC | 2 ms
8,764 KB |
testcase_04 | AC | 35 ms
31,144 KB |
testcase_05 | AC | 17 ms
17,648 KB |
testcase_06 | AC | 2 ms
7,600 KB |
testcase_07 | AC | 30 ms
26,896 KB |
testcase_08 | AC | 3 ms
7,692 KB |
testcase_09 | AC | 27 ms
24,720 KB |
testcase_10 | AC | 22 ms
21,952 KB |
testcase_11 | AC | 28 ms
25,576 KB |
testcase_12 | AC | 23 ms
22,156 KB |
testcase_13 | AC | 16 ms
16,608 KB |
testcase_14 | AC | 20 ms
19,724 KB |
testcase_15 | AC | 19 ms
18,808 KB |
testcase_16 | AC | 22 ms
21,112 KB |
testcase_17 | AC | 4 ms
4,384 KB |
testcase_18 | AC | 21 ms
17,036 KB |
testcase_19 | AC | 11 ms
10,412 KB |
testcase_20 | AC | 3 ms
4,380 KB |
testcase_21 | AC | 8 ms
6,504 KB |
testcase_22 | AC | 24 ms
19,392 KB |
testcase_23 | AC | 29 ms
22,260 KB |
testcase_24 | AC | 36 ms
27,628 KB |
testcase_25 | AC | 3 ms
4,384 KB |
testcase_26 | AC | 3 ms
4,384 KB |
testcase_27 | AC | 4 ms
4,384 KB |
testcase_28 | AC | 3 ms
4,384 KB |
testcase_29 | AC | 3 ms
4,384 KB |
testcase_30 | AC | 3 ms
4,384 KB |
testcase_31 | AC | 2 ms
4,384 KB |
testcase_32 | AC | 4 ms
4,384 KB |
testcase_33 | AC | 2 ms
4,384 KB |
testcase_34 | AC | 3 ms
4,380 KB |
testcase_35 | AC | 2 ms
4,380 KB |
testcase_36 | AC | 3 ms
4,380 KB |
testcase_37 | AC | 2 ms
4,380 KB |
testcase_38 | AC | 2 ms
4,380 KB |
testcase_39 | AC | 2 ms
4,384 KB |
testcase_40 | AC | 2 ms
4,380 KB |
testcase_41 | AC | 2 ms
4,380 KB |
testcase_42 | AC | 2 ms
4,384 KB |
testcase_43 | AC | 2 ms
4,384 KB |
testcase_44 | AC | 2 ms
4,380 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 | RE | - |
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 | AC | 2 ms
7,696 KB |
ソースコード
#include <iostream> #include <string> #include <sstream> #include <stack> #include <algorithm> #include <cmath> #include <queue> #include <bitset> #include <iomanip> #include <limits> #include <chrono> #include <random> #include <array> #include <unordered_map> #include <functional> #include <complex> #include <numeric> #include <cctype> #include <map> #include <set> #include <cstdlib> #include <bitset> #include <tuple> #include <assert.h> #include <deque> #include <utility> #include <fstream> using namespace std; typedef long long ll; using ull = unsigned long long; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } //template<typename T> T gcd(T a, T b) { a = abs(a), b = abs(b); while (b > 0) { tie(a, b) = make_pair(b, a % b); }return a; } //mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); constexpr long long INF = 1LL << 60; constexpr int inf = 1000000007; //constexpr long long mod = 1000000007LL; constexpr long long mod = 998244353; struct mint { long long x; mint(long long x = 0) :x((x% mod + mod) % mod) {} mint& operator+=(const mint a) { if ((x += a.x) >= mod) x -= mod; return *this; } mint& operator-=(const mint a) { if ((x += mod - a.x) >= mod) x -= mod; return *this; } mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this; } mint operator+(const mint a) const { mint res(*this); return res += a; } mint operator-(const mint a) const { mint res(*this); return res -= a; } mint operator*(const mint a) const { mint res(*this); return res *= a; } mint pow(ll t) const { if (!t) return 1; mint a = pow(t >> 1); a *= a; if (t & 1) a *= *this; return a; } // for prime mod mint inv() const { return pow(mod - 2); } mint& operator/=(const mint a) { return (*this) *= a.inv(); } mint operator/(const mint a) const { mint res(*this); return res /= a; } }; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n, K, x, y; cin >> n >> K >> x >> y; vector<int> a(K); for (int i = 0; i < K; i++) cin >> a[i]; if (x >= 1024) { cout << 0 << "\n"; return 0; } sort(a.begin(), a.end()); a.erase(unique(a.begin(), a.end()), a.end()); K = a.size(); vector dp(2, vector(1024, vector<mint>(K))); for (int i = 0; i < K; i++) dp[0][a[i]][i] = 1; int cur = 0; int nxt = 1; for (int i = 1; i < n; i++) { for (int j = 0; j < 1024; j++) for (int k = 0; k < K; k++) dp[nxt][j][k] = 0; vector<mint> sum(1024); for (int j = 0; j < 1024; j++) { for (int k = 0; k < K; k++) sum[j] += dp[cur][j][k]; } for (int j = 0; j < 1024; j++) { for (int k = 0; k < K; k++) { mint t = sum[j] - dp[cur][j][k]; dp[nxt][j ^ a[k]][k] += t; } } swap(cur, nxt); } mint res = 0; for (int i = x; i <= min(1023, y); i++) for (int j = 0; j < K; j++) res += dp[cur][i][j]; cout << res.x << "\n"; }