View difference between Paste ID: 5zffCWmk and iha9KzPN
SHOW: | | - or go back to the newest paste.
1
#include <iostream>
2
3
using namespace std;
4
5-
int a[2020];
5+
int a[2019];
6
7
int main() {
8
	a[1] = 1;
9
	for (int i = 2; i <= 2019; i++) {
10
		a[i] = a[i / 2] + i % 2;
11
	}
12
	int ans = 0;
13
	for (int i = 1; i <= 2019; i++) {
14
		if (a[i] == 7) {
15
			ans++;
16
		}
17
	}
18
	cout << ans;
19
	return 0;
20
}