当前位置:网站首页>[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;
}
边栏推荐
- HAProxy + Keepalived实现MySQL的高可用负载均衡
- [51nod p3111] xiaoming'ai intercepts [Las]
- Tree and binary tree: operation and storage structure of tree
- C language: minesweeping
- C language: deep understanding of character functions and string functions (2)
- Exercise 7-7 string replacement (15 points)
- Jenkins集成Ldap,Ldap配置错误导致jenkins用户登录失败问题解决
- VGA common resolution and calculation method
- VGA常用分辨率及计算方法
- 1-2 24:00 (20 points) [CSP certification true question]
猜你喜欢
C/s model and P2P model
acwing 790. The third root of a number (dichotomy)
攻防世界PWN play 条件竞争漏洞的利用
[implementation of depth first search]
(bfs) acwing 847. Hierarchy of points in the graph
Trees and binary trees: Construction of binary trees
VGA common resolution and calculation method
Exploitation of competitive loopholes in attacking and defending world PWN play conditions
C language: file operation
Trees and binary trees: traversal of binary trees
随机推荐
C language: shortcut keys commonly used in VS
LeetCode 5259. Calculate the total tax payable
LeetCode 322. Change
(bfs) acwing 844. Labyrinth
MOOC week 8 programming exercise 1
时间戳转localDate
C language: deep understanding of character functions and string functions (1)
Tree and binary tree: application of binary tree traversal
(bfs) acwing 847. Hierarchy of points in the graph
C language: file operation
Online debugging tool Arthas advanced
SQL ROW_ The number() function uses
Instruction level parallelism (?)
【 ssl2 ⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶83
Jenkins集成Ldap,Ldap配置错误导致jenkins用户登录失败问题解决
LeetCode 6096. 咒语和药水的成功对数(二分查找)
[51nod p3216] Award [bit operation]
Opencv face recognition of ros2 foxy~galactic~humble
C language: data storage in memory
Sort() sort function