結果
問題 | No.1304 あなたは基本が何か知っていますか?私は知っています. |
ユーザー | 沙耶花 |
提出日時 | 2020-12-01 20:59:59 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 41 ms / 2,000 ms |
コード長 | 1,553 bytes |
コンパイル時間 | 2,471 ms |
コンパイル使用メモリ | 213,044 KB |
実行使用メモリ | 11,776 KB |
最終ジャッジ日時 | 2024-06-12 11:40:00 |
合計ジャッジ時間 | 12,171 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 40 ms
11,776 KB |
testcase_01 | AC | 40 ms
11,648 KB |
testcase_02 | AC | 40 ms
11,776 KB |
testcase_03 | AC | 40 ms
11,648 KB |
testcase_04 | AC | 41 ms
11,776 KB |
testcase_05 | AC | 40 ms
11,648 KB |
testcase_06 | AC | 40 ms
11,648 KB |
testcase_07 | AC | 41 ms
11,776 KB |
testcase_08 | AC | 40 ms
11,776 KB |
testcase_09 | AC | 40 ms
11,648 KB |
testcase_10 | AC | 40 ms
11,648 KB |
testcase_11 | AC | 40 ms
11,776 KB |
testcase_12 | AC | 40 ms
11,648 KB |
testcase_13 | AC | 40 ms
11,648 KB |
testcase_14 | AC | 41 ms
11,776 KB |
testcase_15 | AC | 41 ms
11,648 KB |
testcase_16 | AC | 41 ms
11,648 KB |
testcase_17 | AC | 40 ms
11,776 KB |
testcase_18 | AC | 40 ms
11,648 KB |
testcase_19 | AC | 40 ms
11,776 KB |
testcase_20 | AC | 39 ms
11,648 KB |
testcase_21 | AC | 40 ms
11,648 KB |
testcase_22 | AC | 41 ms
11,648 KB |
testcase_23 | AC | 40 ms
11,648 KB |
testcase_24 | AC | 40 ms
11,776 KB |
testcase_25 | AC | 39 ms
11,648 KB |
testcase_26 | AC | 39 ms
11,648 KB |
testcase_27 | AC | 40 ms
11,648 KB |
testcase_28 | AC | 39 ms
11,776 KB |
testcase_29 | AC | 39 ms
11,776 KB |
testcase_30 | AC | 40 ms
11,776 KB |
testcase_31 | AC | 39 ms
11,776 KB |
testcase_32 | AC | 39 ms
11,776 KB |
testcase_33 | AC | 39 ms
11,648 KB |
testcase_34 | AC | 40 ms
11,776 KB |
testcase_35 | AC | 40 ms
11,648 KB |
testcase_36 | AC | 40 ms
11,776 KB |
testcase_37 | AC | 40 ms
11,648 KB |
testcase_38 | AC | 40 ms
11,648 KB |
testcase_39 | AC | 40 ms
11,648 KB |
testcase_40 | AC | 40 ms
11,648 KB |
testcase_41 | AC | 40 ms
11,776 KB |
testcase_42 | AC | 41 ms
11,648 KB |
testcase_43 | AC | 39 ms
11,776 KB |
testcase_44 | AC | 39 ms
11,648 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 | 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 | WA | - |
06_evil_C_02 | WA | - |
06_evil_C_03 | WA | - |
06_evil_C_04 | WA | - |
06_evil_C_05 | WA | - |
06_evil_C_06 | WA | - |
06_evil_C_07 | WA | - |
06_evil_C_08 | WA | - |
06_evil_C_09 | WA | - |
06_evil_C_10 | RE | - |
ソースコード
#include <stdio.h> #include <bits/stdc++.h> using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000000000000000 int N,K,X,Y; vector<int> B; vector<vector<long long>> cnt(1024,vector<long long>(1024,0)); void dfs(int n,int x,int last){ if(n==0){ cnt[last][x]++; return; } rep(i,B.size()){ if(i==last)continue; dfs(n-1,x^B[i],i); } } template <typename T> void fwt(vector<T>& f) { int n = f.size(); for (int i = 1; i < n; i <<= 1) { for (int j = 0; j < n; j++) { if ((j & i) == 0) { T x = f[j], y = f[j | i]; f[j] = x + y, f[j | i] = x - y; } } } } template <typename T> void ifwt(vector<T>& f) { int n = f.size(); for (int i = 1; i < n; i <<= 1) { for (int j = 0; j < n; j++) { if ((j & i) == 0) { T x = f[j], y = f[j | i]; f[j] = (x + y) / 2, f[j | i] = (x - y) / 2; } } } } long long get(vector<long long> v){ fwt(v); rep(i,v.size())v[i] *= v[i]; ifwt(v); long long ret= 0LL; for(int i=X;i<=min(Y,1024);i++)ret += v[i]; return ret; } int main(){ cin>>N>>K>>X>>Y; set<int> A; rep(i,K){ int a; cin>>a; if(A.count(a))continue; A.insert(a); B.push_back(a); } dfs(N/2,0,-1); vector<long long> Cnt(1024,0); rep(i,1024){ rep(j,1024)Cnt[i] += cnt[j][i]; } long long ans = get(Cnt); //cout<<ans<<endl; rep(i,1024){ ans -= get(cnt[i]); } cout<<ans%998244353<<endl; return 0; }