摘要: /* 最长递减子序列, 题目说的是 每头大象都有体重和IQ 要证明 随着 体重的增加智商 在不断的减少的最长序列 解 : 先对 体重进行一次排序 ,排完后 LIS(最长递增(减)子序列) */#include #include #include #include #include using namespace std;struct Elephant{ int num,W,S; bool operator T[j].W&&(dp[i]maxv) maxv=dp[i]; } for(i=num-1;i>=0;i--) if(dp[i]==maxv) break; ... 阅读全文
posted @ 2014-03-08 14:26 来自大山深处的菜鸟 阅读(402) 评论(0) 推荐(0) 编辑
摘要: /* 暴力 过了 要使得两半的 樱桃数目相等 去试每一个斜率 还好他这里要的是 A、B 都为正整数 这样范围就锁定在200*100 个点范围内*/#include #include #include using namespace std;struct point{ int x,y;}node[110];void solve(int num){ int i; for(int A=-100;A0)L++; if(d<0)R++; if(d==0) break; } if(L==num/2&&R==num/2&&i==num){ printf("%d 阅读全文
posted @ 2014-03-08 13:39 来自大山深处的菜鸟 阅读(195) 评论(0) 推荐(0) 编辑
摘要: During each move the player can chooseall lines of the matrix where dwarf is not on the cell with candyand shout "Let's go!"这个 看成是 选其所有干行 我却看成是选其中 若干 行 水一下自己#include #include #include #include using namespace std;char map[1005][1005];int N[1005],L[1005];int main(){ int n,m; while(scanf 阅读全文
posted @ 2014-03-08 11:22 来自大山深处的菜鸟 阅读(142) 评论(0) 推荐(0) 编辑