【蓝桥杯算法】2026/4/10 数学推理

image

image

image

image


import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int ans=0;
        for (int i = 0; i < n; i++) {
            long x=sc.nextLong();
            if((x&(x-1))==0)ans++;
        }
        System.out.println(ans);

    }
}
posted @ 2026-04-10 14:30  Jwwind  阅读(5)  评论(0)    收藏  举报