题目链接:http://codeforces.com/problemset/problem/4/A 题目大意:给出一个数,问是否能分为不为零的两个偶数 判断是否为偶数即可,并且因为不能为0,所以2不成立 #include<bits/stdc++.h>using namespace std;int n ...
分类:
其他好文 时间:
2016-08-03 22:10:23
阅读次数:
152
Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example: Given num = 16, return true. Given num = 5, return f ...
分类:
其他好文 时间:
2016-08-02 19:24:45
阅读次数:
173
题目链接:hdu_5769_Substring 题意: 给你一个字符a和一个串b,问你有多少个包括a的字串 题解: 1 #include<bits/stdc++.h> 2 #define F(i,a,b) for(int i=a;i<=b;++i) 3 using namespace std; 4 ...
分类:
编程语言 时间:
2016-08-02 06:34:23
阅读次数:
197
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example, the 32-bit ...
分类:
其他好文 时间:
2016-08-02 01:07:46
阅读次数:
122
Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), retur ...
分类:
其他好文 时间:
2016-08-02 01:03:34
阅读次数:
149
1、codeforces 349B Color the Fence 2、链接:http://codeforces.com/problemset/problem/349/B 3、总结: 刷栅栏。1-9每个字母分别要ai升油漆,问最多可画多大的数字。 贪心,也有点考思维。 #include<bits/s ...
分类:
其他好文 时间:
2016-08-01 12:31:20
阅读次数:
193
题目链接:hdu_5778_abs 题意: 给你一个数x,然你找一个y,这个y只能被素数分解,每一个素数恰好出现2次,求y-x的绝对值最小 题解: 给官方的 ps:数据太水,打35个素数也能过 1 #include<bits/stdc++.h> 2 #define F(i,a,b) for(int ...
分类:
其他好文 时间:
2016-07-31 14:25:16
阅读次数:
142
题目链接:hdu_5777_domino 题意: 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 const int N=1e5+7; 5 int a[N],t,n,k; 6 int main(){ 7 scanf("%d",&t); 8 w ...
分类:
其他好文 时间:
2016-07-31 00:15:45
阅读次数:
241
题目链接:hdu_5776_sum 题意: 给你一串数,问你是否有一个连续的子序列的和胃m的倍数 题解: 维护一个前缀和%m的值,如果前缀和%m的值为0或者有两个前缀和%m的值相同,那么就有一个连续区间的和为m的倍数 1 #include<bits/stdc++.h> 2 #define F(i,a ...
分类:
其他好文 时间:
2016-07-31 00:13:32
阅读次数:
299
题目描述: Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example:Given num = 16, return true. Given num = 5, ret ...
分类:
编程语言 时间:
2016-07-30 22:22:37
阅读次数:
162