Advertisement
AlexAvram

Untitled

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