Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long LL;
- const int maxn = 100000 + 100;
- int n;
- LL x, ans;
- LL lowbit(LL x) {
- return x & -x;
- }
- void code1() {
- set<int> st;
- for (int i = 1; i <= 20; ++i) {
- for (int j = i + 1; j <= 20; ++j) {
- st.insert((i + j) * (j - i + 1) / 2);
- }
- }
- for (int x : st) {
- cout << x << endl;
- }
- }
- void code2() {
- set<int> st;
- for (int i = 1; i <= 200; ++i) {
- st.insert(i);
- }
- for (int i = 1; i <= 1000; ++i) {
- for (int j = i + 1; j <= 1000; ++j) {
- st.erase((i + j) * (j - i + 1) / 2);
- }
- }
- for (int x : st) {
- cout << x << endl;
- }
- }
- int main() {
- #ifdef ExRoc
- freopen("test.txt", "r", stdin);
- #endif
- ios::sync_with_stdio(false);
- // code1();
- // code2();
- cin >> n;
- while (n--) {
- cin >> x;
- if (lowbit(x) == x) {
- ++ans;
- }
- }
- cout << ans << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement