![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
HDU
yangja333
一只小小小小的菜鸟
展开
-
1069 Monkey and Banana
动态规划,暴力!!!!O(∩_∩)O~ #include #include using namespace std;struct node { int x; int y; int z;};bool cmp(node a, node b) { if(a.x != b.x) return a.x > b.原创 2010-02-06 13:17:00 · 133 阅读 · 0 评论 -
1527 取石子游戏
经典的博弈题!!!不懂的可以上网查看“威佐夫博弈”。 #include #include using namespace std;int main() { int n, m; while(scanf("%d %d", &n, &m) != EOF) { if(n == 0 && m == 0) { cout原创 2010-02-06 13:13:00 · 121 阅读 · 0 评论 -
2570 迷瘴
贪心,咋看题目以为是背包,但是由于体积是相同的,那么溶度小的开始选择就可以得到最优解了!!!! #include #include using namespace std;int a[200];int main() { int n, v, w, T; scanf("%d", &T); while(T--) { scanf("%d %d %d", &n原创 2010-02-06 18:52:00 · 267 阅读 · 1 评论 -
1521 排列组合
指数母函数!!!!!!因为这道题才知道有这么回事!!!!!实现还是很简单的!但是还是纪念一下!!!!!! #include using namespace std;int a[11][11];int b[11];int c[11];int main() { int n, m; c[0] = 1; for(int i = 1; i <= 10; i原创 2010-02-20 16:05:00 · 129 阅读 · 0 评论 -
1025 Constructing Roads In JGShining's Kingdom
公共递增子序列,但是需要 O(n*logn) 的算法!特别注意: 若是答案是1 是 road, 大于1 是roads #include using namespace std;#define inf INT_MAXint a[500001];int b[500001];int t;void f(int from, int to, int x) { int m原创 2010-02-20 20:42:00 · 169 阅读 · 0 评论