博客链接:http://www.cnblogs.com/tanky_woo/archive/2010/07/31/1789621.html01背包:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=2602代码: 1 #include 2 #includ....
分类:
其他好文 时间:
2014-12-18 22:00:30
阅读次数:
345
这题真是过了n年才a。最早是在2010年北大培训比赛上看到的这题,当时我不会,竹教主也不会,但他记下来了,研究一段时间后就会了,还把这题加到我校oj上。过了这么多年,我上网搜,关于这个问题的解题报告还是没有,于是我花了几天时间做了出来,发布此解题报告。题目是要求从1到n的所有数与n的最小公倍数的和,...
分类:
其他好文 时间:
2014-12-18 22:00:23
阅读次数:
477
题目链接: BZOJ - 3110题目分析这道题是一道树套树的典型题目,我们使用线段树套线段树,一层是区间线段树,一层是权值线段树。一般的思路是外层用区间线段树,内层用权值线段树,但是这样貌似会很难写。多数题解都使用了外层权值线段树,内层区间线段树,于是我就这样写了。每次插入会在 logn 棵线段树...
分类:
其他好文 时间:
2014-12-18 22:00:17
阅读次数:
213
题目链接: http://poj.org/problem?id=1664题目描述: 有n个苹果,m个盒子,盒子和苹果都没有顺序,盒子可以为空,问:有多少种放置方式?解题思路: 当前有n个苹果,m个盒子。 (1):假设当前最少的盒子放置一个苹果,则给m个盒子分别放一个苹果,剩下n-m个苹果。 ...
分类:
移动开发 时间:
2014-12-18 21:53:00
阅读次数:
185
题目大意:求1234567891011121314...n mod m 的值
设F(n)=1234567891011121314...n 那么显然有F(n)=F(n-1)*(floor(lgn)+1)+n
于是我们可以矩乘
将数字按照floor(lgn)+1分类
构造状态矩阵F(n) n+1 1 初值为0 1 1
1~9的转移矩阵为
10 0
0
1 1 0
0 1 1...
分类:
其他好文 时间:
2014-12-18 20:45:40
阅读次数:
199
题目链接:点击打开链接
题意:给一个数n,问这个数是不是Carmichael Numbers,Carmichael Numbers的定义为:一个数n如果不是素数且对于对于任意的 2=
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#in...
分类:
其他好文 时间:
2014-12-18 20:44:29
阅读次数:
163
题目:EOJ1981 || POJ1011 经典dfs+剪枝+奇怪的数据
Description
George took sticks of the same length and cut them randomly until all partsbecame at most 50 units long. Now he wants to return sticks to th...
分类:
其他好文 时间:
2014-12-18 20:44:15
阅读次数:
242
题目Maximum Depth of Binary Tree通过率44.2%难度EasyGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest pat...
分类:
其他好文 时间:
2014-12-18 20:28:05
阅读次数:
214
这是SHU数据库原理上机题目中的一道。全部题目:http://www.docin.com/p-739281393.html 代码网上有: selectxh,xm froms wherenotexists (select*fromc wherenotexists (select*fr...
分类:
其他好文 时间:
2014-12-18 20:26:25
阅读次数:
450
题目大意:纽约消防部门的支援速度是值得纽约人骄傲的一件事。但是他们想要最快的支援速度,帮助他们提升支援速度他们要调度离着火点最近的一个消防站。他们要你写一个程序来维护纽约消防站的光荣传统。软件需要有的功能是,能获取着火点的地址 和 消防站的位置, 街道交叉路口, 从一个交叉路口到达另一个交叉路口的....
分类:
其他好文 时间:
2014-12-18 20:25:04
阅读次数:
189