当前位置:网站首页>[51nod P3210] binary statistics
[51nod P3210] binary statistics
2022-06-13 09:35:00 【Ayane.】
analysis :
Violence goes by easily
CODE:
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#define reg register
using namespace std;
typedef long long ll;
int T,ans[35];
int main(){
scanf("%d",&T);
while(T--)
{
int x,cnt=0;
scanf("%d",&x);
while(x%2==0)
{
cnt++;
x>>=1;
}
ans[cnt]++;
}
for(int i=0;i<=31;i++)
printf("%d ",ans[i]);
return 0;
}
边栏推荐
- VDD,DVDD,AVDD,VCC,AFVDD,DOVDD,IOVDD
- [51nod p3216] Award [bit operation]
- (dp+ memory) acwing 901 skiing
- 虚拟化和云计算文章大合集
- Heap
- Exploitation of competitive loopholes in attacking and defending world PWN play conditions
- turtle库的使用数字时钟模拟时钟动态显示
- 拜登:希望尽快签署两党枪支安全改革法案
- acwing 790. The third root of a number (dichotomy)
- LeetCode 5270. 网格中的最小路径代价(动态规划)
猜你喜欢

(dp+ memory) acwing 901 skiing

Jenkins access openldap user authentication

Alibaba senior experts analyze the standard design of protocol
![1-4 message passing interface [CSP authentication]](/img/db/aecda548693cdfb0e740bcf1a1c823.jpg)
1-4 message passing interface [CSP authentication]

Storage mode of drawings

acwing 786. Number k

(topological sorting +bfs) acwing 848 Topological sequence of digraph

Trees and binary trees: the concept of binary trees

C language: Simulated Implementation of library function strcpy

acwing 790. The third root of a number (dichotomy)
随机推荐
Tree and binary tree: operation and storage structure of tree
LeetCode 202. 快乐数
(dfs+ tree DP) acwing 846 Center of gravity of tree
Remember! Don't be too confident in writing code! Be sure to write some key log info output, or the problem will not be located.
A static variable is associated with a class and can be used as long as the class is in memory (the variable does not exist as long as your application terminates). (heap body, stack reference)
@Value does not take effect and extend/implement other classes cannot inject beans manually
Britain introduces food security plan to resist food supply crisis
C language: data storage in memory
LeetCode 201. Digit range bitwise AND
MOOC week 8 programming exercise 1
C language: timer principle
C language: preprocessing in program environment
谨记! 写代码别太自信! 一定要写点关键日志info输出,不然问题都定位不到。
攻防世界-PWN-shell
LeetCode 6097. 替换字符后匹配(字典)
(Dijkstra + shortest circuit + by point n^2) acwing 849 Dijkstra finding the shortest path I
LeetCode 6096. Success logarithm of spells and potions (binary search)
攻防世界PWN play 条件竞争漏洞的利用
批量讀取文件夾下的全部語音文件
[51nod p3216] Award [bit operation]
