- 博客(6)
- 资源 (7)
- 收藏
- 关注
转载 bwpbo 源代码
wsmdbzdxypbo.IsComplete = bwpbo.IsComplete && DateTime.Now >= DateTime.Now.AddMonths(1);public class bwpbo{ private DateTime nextMonth; public bool IsComplete { get
2013-01-17 21:52:37 719
原创 C++ 大数乘法
http://acm.buaa.edu.cn/problem/163/#include #include using namespace std;#define maxn 2000char c1[999], c2[999];int a[999], b[999];int r[maxn];void print(int a[], int b[], int la, int
2013-01-13 14:00:03 775
原创 插入排序
递归版void insertion_sort(int arr[], int n){ if(n < 2) return; insertion_sort(arr, n - 1); for(int i = 0; i != n - 1; i++) { if(arr[i] > arr[n - 1]) { for(int j = i; j != n - 1; j++)
2013-01-12 09:17:40 613
原创 [排列组合]不少于n个数字组成的数的统计
http://acm.buaa.edu.cn/problem/364/n位数 首位确定从0-9选出2个 填到n-1个格子方法a = 9 * (2 ^ (n - 1) - 2) 种从0-9选出1个 填到n-1个格子方法b = 10 种因此10 ^ n 到 (10 ^ (n + 1) - 1)共有 9 * (a + b) 种以下SB逻辑 我已经不记得怎么想的了.
2013-01-12 08:48:28 1079
原创 二分法搜索
一般方法int bsearch(int arr[], int l, int u, int k){ if(l > u) return -1; int m = (l + u) / 2; if(arr[m] == k) return m; if(arr[m] > k) return bsearch(arr, l, m - 1, k); else return bsearch(arr, m
2013-01-08 10:14:41 663
原创 求约数个数最多问题
求1 - n当中约数个数最多的数,若有多解则输出最小的数。一般解法:从1到n枚举 根据 约数个数定理 公式求出约数个数这需要先求出1到n的所有质数以此来对第i个数分解质因数 质因数变化即 乘以 (上一个质因数个数+1)对于n非常大时候效率很低从图中可以看出 约数最多的数a1. a中较小的质因数个数必定大于等于大一级的质因数个数2. 随着a的递
2013-01-07 13:46:18 1840
Pokemon Battle Analyser
2013-11-30
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人