Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1.  
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int a[2020];
  7.  
  8. int main() {
  9. a[1] = 1;
  10. for (int i = 2; i <= 2019; i++) {
  11. a[i] = a[i / 2] + i % 2;
  12. }
  13. int ans = 0;
  14. for (int i = 1; i <= 2019; i++) {
  15. if (a[i] == 9) {
  16. ans++;
  17. }
  18. }
  19. cout << ans;
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement