题意:有 n 个客人,m个房间,每个房间可住ci个人,这 n 个人中有 t 对双胞胎,sum{ci} = n 问你有多少种住房方法。 析:计数DP,dp[i][j] 表示前 i 个房间,还剩下 j 对双胞胎未住,第 i+1 个房间,就从剩下的 j 对双胞胎中选 k 对,然后再从不是双胞胎的人选剩下的 ...
分类:
其他好文 时间:
2016-11-22 20:45:23
阅读次数:
310
num = 5 def func(): num += 1 print(num) print(num) 输出:UnboundLocalError: local variable 'num' referenced before assignment 翻译:局部变量错误:变量 “num” 未被定义就被应用 ...
分类:
编程语言 时间:
2016-11-19 03:33:29
阅读次数:
236
时钟的约束 关于时钟的约束命令: 当出现警告: The following clock transfer have no clock uncertainty assignment. For more accurate results, apply clock uncertainty or use t ...
分类:
其他好文 时间:
2016-11-11 11:39:30
阅读次数:
538
const 和 let 的唯一区别就是用 const 声明的变量不能被重新赋值(只读变量),比如像下面这样就会报错: const foo = 1 foo = 2 // TypeError: Assignment to constant variable. 但遗憾的是,这个错误不是个静态错误(stat ...
分类:
其他好文 时间:
2016-11-10 02:49:41
阅读次数:
324
Straight-forward strategy.. please take care of all details - data type, assignment order etc. ...
分类:
其他好文 时间:
2016-11-05 14:31:42
阅读次数:
198
Pieces Assignment My Tags (Edit) Source : zhouguyue Time limit : 1 sec Memory limit : 64 M Submitted : 539, Accepted : 190 Source : zhouguyue Time lim ...
分类:
其他好文 时间:
2016-10-22 14:54:15
阅读次数:
208
编程作业 一、角色分工 驾驶员:刘阳 领航员:季城宇 二、程序代码 代码已提交至coding.net 链接如下https://coding.net/u/Arthur0618/p/the-third-assignment/git/blob/master/README.md?filename=READM ...
分类:
其他好文 时间:
2016-10-17 00:08:32
阅读次数:
115
Blocks Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6133 Accepted: 2931 Description Panda has received an assignment of painting a line ...
分类:
其他好文 时间:
2016-10-07 18:07:22
阅读次数:
213
题目链接:hdu4781 Assignment For Princess 题意:n个点m条边,每条有向边的权值分别是1,2,3…m,一个点能到达任意一个点,没有重边和自环,没有任何两条边的权值相同,任意一个有向环的权值和必须是3的倍数,现在需要把这个图输出来。 题解:注意到题目给出的范围m >= n ...
分类:
其他好文 时间:
2016-10-02 21:54:00
阅读次数:
205
var //代表变量,变量的值可以改变 let//代表常量类型不可改变 var ceshi:Double = 10//假如声明的变量没有改变的话Swift也会提示将其改为let,而且在下面的代码中没有用到该变量Swift就会提示将let改为下划线,因为下划线代表忽略该变量,就相当于OC中提示并没有用 ...
分类:
编程语言 时间:
2016-09-25 09:29:50
阅读次数:
148