0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 03:31:59 +00:00

#1686. 【2022.10.24 联考】子集计数

https://sjzezoj.com/submission/61698
This commit is contained in:
Baoshuo Ren 2022-10-24 21:07:15 +08:00
parent 6c342c8e5f
commit 9019192e62
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
24 changed files with 114 additions and 0 deletions

45
S2OJ/1686/1686.cpp Normal file
View File

@ -0,0 +1,45 @@
#include <iostream>
using std::cin;
using std::cout;
const char endl = '\n';
const int N = 1e5 + 5,
M = (1 << 8) + 5;
const int mod = 998244353;
int n, a[N], f[N], sum[M][M];
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
for (int i = 1; i <= n; i++) {
f[i] = 1;
int s = a[i] >> 8,
t = a[i] & ((1 << 8) - 1);
for (int c = t;; c = (c - 1) & t) {
f[i] = (f[i] + sum[s][c]) % mod;
if (!c) break;
}
for (int c = s ^ ((1 << 8) - 1);; c = (c - 1) & (s ^ ((1 << 8) - 1))) {
sum[s | c][t] = (sum[s | c][t] + f[i]) % mod;
if (!c) break;
}
}
for (int i = 1; i <= n; i++) {
cout << f[i] << endl;
}
return 0;
}

BIN
S2OJ/1686/data/count1.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/count1.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/count10.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/count10.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/count2.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/count2.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/count3.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/count3.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/count4.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/count4.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/count5.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/count5.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/count6.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/count6.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/count7.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/count7.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/count8.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/count8.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/count9.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/count9.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/ex_count1.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/ex_count1.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1686/data/problem.conf (Stored with Git LFS) Normal file

Binary file not shown.