結果

問題 No.1304 あなたは基本が何か知っていますか?私は知っています.
ユーザー mfbgjsczmfbgjscz
提出日時 2020-12-01 01:29:35
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,819 bytes
コンパイル時間 2,305 ms
コンパイル使用メモリ 214,280 KB
実行使用メモリ 8,768 KB
最終ジャッジ日時 2023-09-03 03:07:17
合計ジャッジ時間 7,623 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,672 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 10 ms
4,376 KB
testcase_05 AC 4 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 8 ms
4,376 KB
testcase_08 AC 816 ms
4,376 KB
testcase_09 AC 8 ms
4,380 KB
testcase_10 AC 5 ms
4,376 KB
testcase_11 AC 9 ms
4,376 KB
testcase_12 AC 5 ms
4,380 KB
testcase_13 AC 3 ms
4,380 KB
testcase_14 AC 4 ms
4,376 KB
testcase_15 AC 4 ms
4,376 KB
testcase_16 AC 5 ms
4,376 KB
testcase_17 AC 83 ms
4,380 KB
testcase_18 AC 5 ms
4,376 KB
testcase_19 AC 3 ms
4,380 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 TLE -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
04_evil_A_01 -- -
04_evil_A_02 -- -
04_evil_A_03 -- -
04_evil_A_04 -- -
04_evil_A_05 -- -
04_evil_A_06 -- -
04_evil_A_07 -- -
04_evil_A_08 -- -
04_evil_A_09 -- -
04_evil_A_10 -- -
05_evil_B_01 -- -
05_evil_B_02 -- -
05_evil_B_03 -- -
05_evil_B_04 -- -
05_evil_B_05 -- -
05_evil_B_06 -- -
05_evil_B_07 -- -
05_evil_B_08 -- -
05_evil_B_09 -- -
05_evil_B_10 -- -
06_evil_C_01 -- -
06_evil_C_02 -- -
06_evil_C_03 -- -
06_evil_C_04 -- -
06_evil_C_05 -- -
06_evil_C_06 -- -
06_evil_C_07 -- -
06_evil_C_08 -- -
06_evil_C_09 -- -
06_evil_C_10 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
//namespace mp = boost::multiprecision;
//using Bll = mp::cpp_int;
using namespace std;
#define ll long long
#define rep(i, m, n) for (ll i = m; i < n; i++)
#define rrep(i, m, n) for (ll i = m - 1; i >= n; i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(), N.end()), N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(), n.end())
#define HpOut(S) cout << setprecision(50) << S << endl
#define Vec(K, L, N, S) vector<L> K(N, S)
#define DV(K, L, N, M, S) vector<vector<L>> K(N, vector<L>(M, S))
#define TV(K, L, N, M, R, S) \
    vector<vector<vector<L>>> K(N, vector<vector<L>>(M, vector<L>(R, S)))
#define pint pair<ll, ll>
#define tint tuple<int, int, int>
#define paf(L, R) pair<L, R>
#define mod 998244353
#define MAX 10010
#define ALL(a) a.begin(), a.end()
#define chmax(a, b) a = (((a) < (b)) ? (b) : (a))
#define chmin(a, b) a = (((a) > (b)) ? (b) : (a))
ll N, K;
vector<ll> A;
map<pint, ll> ans;
void dfs(ll cnt, ll x, ll prev) {
    if(!cnt) ans[pint(x, prev)]++;
    else {
        rep(i, 0, K) {
            if(A[i] == prev) continue;
            dfs(cnt - 1, x ^ A[i], A[i]);
        }
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll X, Y;
    cin >> N >> K >> X >> Y;
    A.resize(K);
    rep(i, 0, K) cin >> A[i];
    Sort(A), UE(A);
    K = A.size();
    ll L = N / 2;
    dfs(L, 0, -1);
    ll res = 0;
    for(auto v : ans) for(auto w : ans) {
        if(v.first.second == w.first.second) continue;
        ll z = v.first.first ^ w.first.first;
        if(X <= z && z <= Y) res = (res + v.second * w.second % mod) % mod;
    }
    cout << res % mod << endl;
}
0