摘要: 好牛的题 哈哈#include #include #define S(n) scanf("%d",&n)#define F(i,n) for(int i=1;i<=n;i++)using std::max;int a[110][110],T,m,n,f;main(){S(T);F(b,T){m=0;... 阅读全文
posted @ 2013-07-31 21:22 xlc2845 阅读(103) 评论(0) 推荐(0)
摘要: 一开始WA了 参考了一下 求正反两个方向的最长上升子序列 并分别记录在两个数组中 最后求最大值#include #include #include #include using namespace std;int a[10010],c1[10010],c2[10010],d[10010];int ... 阅读全文
posted @ 2013-07-31 16:49 xlc2845 阅读(130) 评论(0) 推荐(0)
摘要: 与108类似 多加了两层循环 水过#include #include #include #include #include #define maxn 110using namespace std;int a[maxn][maxn];int b[maxn];int main(){ int t; ... 阅读全文
posted @ 2013-07-31 15:52 xlc2845 阅读(132) 评论(0) 推荐(0)
摘要: 背包问题 总时间为容量,单个唱片时间为各个物体的价值与体积 f【】 用来记录路径#include #include #define M 10005int a[25],d[M],f[25][M];int main(){ int V; while(scanf("%d",&V) == 1) ... 阅读全文
posted @ 2013-07-31 15:48 xlc2845 阅读(95) 评论(0) 推荐(0)
摘要: 降维 枚举行累加 然后求单行上最大连续和#include #include #include #include #include #define maxn 110using namespace std;int a[maxn][maxn];int b[maxn];int main(){ int... 阅读全文
posted @ 2013-07-31 15:32 xlc2845 阅读(91) 评论(0) 推荐(0)
摘要: dp 记忆化搜索 做的时候像dfs#include #include #include #include using namespace std;struct tur{ int x,y,s;} tur[6000];int d[6000] = {},n;int flag[6000] = {};i... 阅读全文
posted @ 2013-07-31 15:29 xlc2845 阅读(89) 评论(0) 推荐(0)
摘要: 一个简单的dp 面值是5的倍数 将面值都除5 因为输出问题wa ....#include #include #include #include using namespace std;long long f[6020];int coin[] = {1,2,4,10,20,40,100,200,4... 阅读全文
posted @ 2013-07-31 15:18 xlc2845 阅读(125) 评论(0) 推荐(0)
摘要: 水题 排序 判符号#include #include #include using namespace std;struct pp{ int a; bool b; void f(int n) { if(n >= 0) { b ... 阅读全文
posted @ 2013-07-31 15:14 xlc2845 阅读(113) 评论(0) 推荐(0)
摘要: 找大于等于原数的最小回文数字 代码比较烂...........#include #include #include #include using namespace std;char s[2010];int main(){ scanf("%s",s); int len = strlen(... 阅读全文
posted @ 2013-07-31 12:20 xlc2845 阅读(106) 评论(0) 推荐(0)
摘要: 大数乘法 不会java 比赛的时候各种细节RE WA ........#include #include #include using namespace std;int un[] = {0,0,0,0,0,1,3,6,13,26,52,104,208,416,833,1667,3335,670... 阅读全文
posted @ 2013-07-31 12:17 xlc2845 阅读(109) 评论(0) 推荐(0)