hdu 5237 二进制

很无聊的模拟题。。。mark几个有用的小程序:

字符->二进制ASCII码

 1 string tobin(char c)
 2 {
 3     string t;
 4     for(int i=0; i<8; i++)
 5     {
 6         t=char(c%2+48)+t;
 7         c/=2;
 8     }
 9     return t;
10 }
时间: 2024-11-09 02:22:20

hdu 5237 二进制的相关文章

hdu 3584 二进制0,1反转 三维树状数组 及三维树状数组模板

先贴自己类比二维树状数组写的三维树状数组模板: 开始的时候循环体内j=y,k=z,没写,以为自己思路错了,,,hehe..... 更高维的树状数组以此类比 const int MAXN = 100+10; int c[MAXN][MAXN][MAXN];int X,Y,Z; int N; inline int lowbit(int x){return x&(-x);} void update(int x, int y, int z, int v) { int i=x,j=y,k=z; while

HDU 2844 二进制优化的多重背包

Coins Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11596    Accepted Submission(s): 4634 Problem Description Whuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One

HDU 6166 二进制划分集合

首先这个题化成两个集合还是很容易的想到的,但是不知道怎么用二进制表示,感觉这个题的脑洞还是很大的. 为什么可以用二进制表示化成集合可以包含所有的点对,因为要是两个数不同的话肯定会有一个二进制的位数不同 所以就包含了所有的点对. #include<stdio.h> #include<string.h> #include<algorithm> #include<queue> using namespace std; const int N=5e5; struct

hdu 5237 Base64(模拟)

Base64 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1255    Accepted Submission(s): 564 Problem Description Mike does not want others to view his messages, so he find a encode method Base64.

HDU 5237 Base64

Base64 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 245    Accepted Submission(s): 119 Problem Description Mike does not want others to view his messages, so he find a encode method Base64.

HDU 2502 月之数(二进制,规律)

月之数 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 10273    Accepted Submission(s): 6003 Problem Description 当寒月还在读大一的时候,他在一本武林秘籍中(据后来考证,估计是计算机基础,狂汗-ing),发现了神奇的二进制数. 如果一个正整数m表示成二进制,它的位数为n(不包含前

HDU 5050 Java 大数类+读入二进制

http://acm.hdu.edu.cn/showproblem.php?pid=5050 才知道 原来JAVA这么好用,连二进制都封装好了 in.nextBigInteger(2)  就是按二进制读入 当然a.gcd(b).toString(2)  是按二进制输出一个二进制String,  a,b是大数 另外,JAVA交代码原来是class Main import java.math.BigInteger; import java.util.Scanner; public class Mai

HDU 1059 多重背包+二进制优化

Dividing Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 16909    Accepted Submission(s): 4729 Problem Description Marsha and Bill own a collection of marbles. They want to split the collection

HDU 4588 Count The Carries(数学 二进制 找规律啊)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4588 Problem Description One day, Implus gets interested in binary addition and binary carry. He will transfer all decimal digits to binary digits to make the addition. Not as clever as Gauss, to make th