摘要:
题意: 有长度为n的一排格子,每个格子里面可以任意填入1,2,3,4四个数字,问1,2都为偶数个的方案 T组数据,每组数据一个n(<=1e9) 样例输入 2 1 2 样例输出 2 6 分析 设dp[i][0/1/2/3]分别为处理到第i个,1和2的个数分别为 全偶、1偶2奇、1奇2偶,全奇 那么dp 阅读全文
摘要:
题意 平面上有 n (2 ≤ n ≤ 15) 个点,现用平行于坐标轴的矩形去覆盖所有点,每个矩形至少盖两个点,矩形面积不可为0,求这些矩形的最小面积。 Input The input consists of several test cases. Each test cases begins wit 阅读全文
摘要:
题意 n头牛,m个房间,每头牛有自己喜欢的房间,问每头牛都住进自己喜欢的房间有多少种分配方法? Input In the first line of input contains two integers N and M (1 <= N <= 20, 1 <= M <= 20). Then come 阅读全文