HDU 3555 Bomb(數位DP),hdu3555DescriptionThe cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone' (also known as 'Rock, Paper, Scissors', 'Ro, Sham, Bo', and a host of other names) in order to make arbitrary
【SICP練習】112 練習3.28,sicp練習1123.28 練習3-28原文Exercise 3.28. Define an or-gate as a primitive function box. Your or-gate constructor should be similar to and-gate. 代碼(define (or-gate input-1 input-2 output) (define (or-action-procedure)
【SICP練習】117 練習3.44,sicp練習1173.44 練習3-44原文Exercise 3.44. Consider the problem of transferring an amount from one account to another. Ben Bitdiddle claims that this can be accomplished with the following procedure, even if there are multiple
【SICP練習】116 練習3.42,sicp練習1163.42 練習3-42原文Exercise 3.42. Ben Bitdiddle suggests that it’s a waste of time to create a new serialized procedure in response to every withdraw and deposit message. He says that make-account could be changed so
【SICP練習】109 練習3.22,sicp練習1093.22 練習3-22原文Exercise 3.22. Instead of representing a queue as a pair of pointers, we can build a queue as a procedure with local state. The local state will consist of pointers to the beginning and the end of an
【SICP練習】107 練習3.8,sicp練習1073.8 練習3-8原文Exercise 3.8. When we defined the evaluation model in section 1.1.3, we said that the first step in evaluating an expression is to evaluate its subexpressions. But we never specified the order in which