摘要: Smallest Subarrays With Maximum Bitwise OR You are given a 0-indexed array nums of length $n$, consisting of non-negative integers. For each index $i$ 阅读全文
posted @ 2022-09-18 19:36 onlyblues 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 解方程 给定一个非负整数 $a$,请你计算方程 $a−(a \oplus x)−x=0$ 的非负整数解的数量。 其中 $\oplus$ 指按位异或。 输入格式 第一行包含整数 $T$,表示共有 $T$ 组测试数据。 每组数据占一行,包含一个非负整数 $a$。 输出格式 每组数据输出一行结果,一个整数 阅读全文
posted @ 2022-09-18 15:43 onlyblues 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 击中战舰 李华在玩一款叫做《海战》的小游戏,下面是游戏介绍。 给定一个 $1 \times n$ 的方格矩阵,方格从左到右依次编号为 $1 \sim n$。 在这个方格矩阵中,隐藏着 $a$ 个战舰。 每个战舰都占据 $b$ 个连续的方格,每个方格最多只能被一个战舰占据。 每个战舰的具体位置未知。 阅读全文
posted @ 2022-09-18 09:16 onlyblues 阅读(22) 评论(0) 推荐(0) 编辑
Web Analytics