mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-08 12:58:48 +00:00
parent
b634d12e32
commit
47aae6d79a
31
Luogu/P3773/P3773.cpp
Normal file
31
Luogu/P3773/P3773.cpp
Normal file
@ -0,0 +1,31 @@
|
||||
#include <iostream>
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
const char endl = '\n';
|
||||
|
||||
const int N = 233333 + 5;
|
||||
const int mod = 1e9 + 7;
|
||||
|
||||
int n, f[N], ans;
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
cin >> n;
|
||||
|
||||
for (int i = 1, x; i <= n; i++) {
|
||||
cin >> x;
|
||||
|
||||
for (int j = x - 1 & x; j; j = j - 1 & x) {
|
||||
f[j] = (f[j] + f[x] + 1) % mod;
|
||||
}
|
||||
|
||||
ans = (ans + f[x]) % mod;
|
||||
}
|
||||
|
||||
cout << ans << endl;
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user