当前位置:网站首页>[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;
}
边栏推荐
- Leetcode points to offer 30 Stack containing min function
- 攻防世界-PWN-shell
- Yolov5 face video stream
- LeetCode 5259. Calculate the total tax payable
- Exception handling operation
- Yolov5 face learning notes
- 删除软链接
- LeetCode 5289. Fair distribution of cookies (DFS)
- Jenkins integrates LDAP. The problem of login failure of Jenkins users caused by LDAP configuration error is solved
- QML(06)——qml. Add a new folder under QRC
猜你喜欢

C language: deep understanding of character functions and string functions (2)

Overview of common layers of image recognition neural network (under update)
![[51nod p3216] Award [bit operation]](/img/f2/109fb126d026951ffd766781223052.jpg)
[51nod p3216] Award [bit operation]

C language: file operation

C language: preprocessing in program environment

The turtle library displays the system time

C language: deep understanding of character functions and string functions (1)
![[ssl1280] full arrangement](/img/58/85c456127a406bf5b30ee1d204981d.jpg)
[ssl1280] full arrangement

turtle库的使用数字时钟模拟时钟动态显示

LeetCode 1. Sum of two numbers
随机推荐
虚拟化和云计算文章大合集
acwing 790. The third root of a number (dichotomy)
SQL ROW_ The number() function uses
Instruction level parallelism (?)
Class and object -- friend
I set up a blog
【最全面详细解释】背包问题详解
[ssl1280] full arrangement
C language: Simulated Implementation of library function strcpy
LeetCode 5259. 计算应缴税款总额
BGP Federation +community
Tree and binary tree: storage structure of binary tree
LeetCode 202. Happy number
(bfs) acwing 844. Labyrinth
Routing - static routing
Acwing785. quick sort (sort+ quick sort + merge sort)
QML(06)——qml. Add a new folder under QRC
HAProxy + Keepalived实现MySQL的高可用负载均衡
Alibaba senior experts analyze the standard design of protocol
LeetCode 6096. Success logarithm of spells and potions (binary search)
