hdoj 5980 Find Small A
来源:互联网 发布:mysql删除唯一约束 编辑:程序博客网 时间:2024/06/03 14:22
题目链接:Find Small A
题目大意:有n个数,问里面有多少个字节的97,转化成二进制然后8个字节算一次就好了
题目思路:直接暴力算,比较每八个位和97的八位是不是相同就好了
#include <map>#include <set>#include <cmath>#include <vector>#include <cstdio>#include <cstring>#include <cstdlib>#include <iostream>#include <algorithm>using namespace std;typedef long long ll;int main(){ int n,x,ans,bi[15]; while(~scanf("%d",&n)){ ans = 0; for(int i = 0;i < n;i++){ scanf("%d",&x); while(x != 0){ for(int j = 0;j < 8;j++){ bi[j] = x%2; x /= 2; } if(bi[0] == 1&&bi[5] == 1&&bi[6] == 1&&bi[1]+bi[2]+bi[3]+bi[4]+bi[7] == 0) ans++; } } printf("%d\n",ans); } return 0;}
阅读全文
0 0
- hdoj 5980 Find Small A
- hdu 5980 Find Small A
- HDU 5980 Find Small A
- Hdu-5980-Find Small A
- HDU 5980 Find Small A
- HDU 5980 Find Small A
- hdu 5980 Find Small A
- hdu-5980-Find Small A
- HDU 5980 Find Small A(水题)
- HDU 5980 - Find Small A(思维)
- Find Small A [HDU-5980] (水)
- hdu 5980 Find Small A(位操作)
- HDU5980 Find Small A
- hdu5890 Find small A 二进制
- HDU-5980 Find Small A(位运算)
- HDU 5980 Find Small A(对二进制理解)
- hdu 5980 · Find Small A【位运算】【手速题】
- HDU 5980 && 2016ICPC大连 J: Find Small A
- 散列表——理论
- linux socket程序中收到使程序中断的信号
- 登月计划 (BSGS 快速乘)
- nRF52832 — 串口BLE例程逐行解析【转载】
- 图的链式前向星表示及深度广度优先遍历
- hdoj 5980 Find Small A
- 《Python机器学习算法》勘误
- SpringMVC的数据格式化-注解驱动的属性格式化
- BZOJ1010-玩具装箱toys
- 26. Remove Duplicates from Sorted Array
- 如何在MacOS10.12.6中为Nexus5编译M固件
- 转载一个李神的东西(打一下脸)
- 单线程
- 西山居_2018校招笔试(判断IP地址的合法性)