2012年7月24日
摘要:
http://poj.org/problem?id=2201基础笛卡尔树#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>using namespace std;const int N=50005;struct node{ int key; int value; int l,r,f; int I;}mem[N];int bhead,ri;bool cmp(node a,node b){ return a.key<b.key;}int f[N];int 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=3022http://acm.timus.ru/problem.aspx?space=1&num=1658给你 n 和 m 问能不能找到一个一百位以内的数使得每位的和为 n 每位平方的和为 m又是看了别人的思路呀 伤不起呀 自己的能力还是不够呀digits[i][j] 表示 n 为i m为j 时最少位数num[i][j] 表示最少位数时 最靠前一位是几让后以位数最小优先 在以考前位越小越好优先 dp代码:#include<iostream>#include<stdio.h>#in 阅读全文