mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-23 18:48:48 +00:00
parent
6c342c8e5f
commit
9019192e62
45
S2OJ/1686/1686.cpp
Normal file
45
S2OJ/1686/1686.cpp
Normal 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
BIN
S2OJ/1686/data/problem.conf
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user