02 2014 档案
摘要:/* 2月28 从这题中可以很明显的看出我的粗心 ,第一个表示的是 第一个事件在第几个顺序发生 而我确认为 他说的是 第一个表示的是第几个事件发生 这题理解了这里就不难了 LIS 。。。 */#include#include #include using namespace std;int N[2][25];int A[2][25];int main(){ int n ,d; scanf("%d",&n); for(int i=1;iN[d^1][j]?N[d][j-1]:N[d^1][j]; } } pri...
阅读全文
摘要:有点坑 在他这里 0不算一位数#include #include #include using namespace std;const int maxn=1005;const int mod=1000000007;long long dp[maxn][maxn];int main(){ int n,m; while(scanf("%d%d",&n,&m)==2){ for(int i=0;i<n;i++) dp[1][i]=1; for(int i=2;i<=m;i++){ for(int j=0;j<n;j++...
阅读全文
摘要:简单 最小生成树 将变转化为 Li=2*Li+Si+EI 因为那个人还要走回来 这样变化就能够计算出 来回要花费的时间 然后进行一次最小生成树#include #include #include #include using namespace std;const int maxn=10005;const int maxm=100005;struct edge{ int x,y; long long W;}E[maxm];int F[maxn];long long N[maxn],maxv;int father(int a){ return a==F[a]?a:F[a]=father(F[..
阅读全文
摘要:简单的 树形动态规划#include #include #include #include using namespace std;const int maxn=100005;vectorV[maxn];int Num[maxn],ans[maxn][2];int maxv(int a,int b){ return a>b?a:b;}void dp(int L,int G){ int tv; for(int i=0;ians[tv][1]?ans[tv][0]:ans[tv][1]); } }}int main(){ int n; w...
阅读全文
摘要:http://acm.sgu.ru/problem.php?contest=0&problem=397 模拟链表 ,坑惨了我 ,自己模拟链表 出错 wa了 好久#include#includeconst int maxn=1000005;char str[maxn],T[maxn];int per[maxn],next[maxn];int main(){ int n; while(scanf("%s",str)==1){ n=strlen(str); int S=0,L=0;per[0]=next[0]=-1; for(int i...
阅读全文
摘要:这题wa 了 八次 你说 巨弱 orz 大神 总结一下 没有将所有的情况考虑清楚 ,当有的时候一个人已经全部看完的时候 别的人还没开始 但是我就把他给结束了#include #include#includeusing namespace std;const int maxn=1100;struct point{ long long ti; int num; bool operator a.ti||(ti==a.ti&&num>a.num); }};priority_queue doc[maxn];queuepat[maxn];int main(){ int t; ...
阅读全文