传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4417 【题解】 令f[i,j]表示到第2i-1列第j行的方案数,g[i,j]表示到第2i行第j列的方案数。 那么有 f[i,j]=Σg[1..i-1,j]+Σg[1..i-1,j-1]+Σg[ ...
分类:
其他好文 时间:
2017-05-31 00:26:40
阅读次数:
237
poll和select一样,管理多个描写叙述符也是进行轮询,依据描写叙述符的状态进行处理,可是poll没有最大文件描写叙述符数量的限制,select is 1024/2048 #include "stdio.h" #include "stdlib.h" #include "sys/socket.h" ...
分类:
其他好文 时间:
2017-05-30 23:07:13
阅读次数:
257
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1285 题目大意:某人知道N个队伍M场比赛的胜负结果,要求输出N个队伍的名次(id为第二关键字)。 核心思想:转化为图论问题,进行拓扑排序。步骤1.选定入度为0的点 2.删除该点与关联边 3.重复该过程 ...
分类:
编程语言 时间:
2017-05-30 00:10:42
阅读次数:
203
Description An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from small ...
分类:
其他好文 时间:
2017-05-29 22:56:17
阅读次数:
188
//poj 2955 //sep9 #include <iostream> using namespace std; char s[128]; int dp[128][128]; int n; int rec(int l,int r) { if(dp[l][r]!=-1) return dp[l][ ...
分类:
其他好文 时间:
2017-05-29 11:55:31
阅读次数:
116
发现有人把无穷大设成0x3f3f3f3f,好像还真不是随便设的。 0x3f3f3f3f比10^9大一点,比一般数据范围大; 乘2之后比2147483467小,满足正无穷加正无穷还是正无穷; 每个字节都是0x3f,可以memset整个dis数组,免得写循环。 服气。 ...
分类:
其他好文 时间:
2017-05-29 00:31:48
阅读次数:
235
#include <cstring> #include <iostream> using namespace std; int main() { int a[2][2]; int n=2,m=2; for(int i=0;i<n;i++) for(int j=0;j<m;j++) { cin>>a[ ...
分类:
其他好文 时间:
2017-05-29 00:29:24
阅读次数:
267
Description Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new probl ...
分类:
其他好文 时间:
2017-05-28 23:18:42
阅读次数:
271
1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 struct Node { 5 int next[10]; 6 int num; 7 } node[100005]; 8 int len = 0; ...
分类:
其他好文 时间:
2017-05-28 22:24:17
阅读次数:
211
本文均属自己阅读源代码的点滴总结。转账请注明出处谢谢。欢迎和大家交流。qq:1037701636 email:gzzaigcn2012@gmail.comAndroid源代码版本号Version:4.2.2; 硬件平台 全志A31 之所以单独把这块内容提炼出来,在于其具备的一定的层次性,结构上具备统 ...
分类:
移动开发 时间:
2017-05-28 21:35:46
阅读次数:
448