Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a[2021];
- int main() {
- a[1] = 1;
- for (int i = 2; i <= 2020; i++) {
- a[i] = a[i / 2] + i % 2;
- }
- int ans = 0;
- for (int i = 1; i <= 2020; i++) {
- if (a[i] == 9) {
- ans++;
- }
- }
- cout << ans;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement