随笔分类 - Lists
摘要:一道类似括号匹配的题目。 一负一正组成一个括号。 然后 某一个括号内部第一层括号之和严格小于这层的值写的有些蛋疼题目:Problem B - Generalized MatrioshkasVladimir worked for years making matrioshkas, those nesting dolls that certainly represent truly Russian craft. A matrioshka is a doll that may be opened in two halves, so that one finds another doll inside
阅读全文
摘要:题目就是根据题意进行四个操作 。。复制一下别人的翻译:The valid commands for the robot arm that manipulates blocks are:机械臂操作积木的有效指令列举如下:move a onto bwhere a and b are block numbers, puts block a onto block b after returning any blocks that are stacked on top of blocks a and b to their initial positions.a和b都是积木的编号,先将a和b上面所有的积木
阅读全文
摘要:题目大意: 给出一堆乌龟名字,乌龟能从本身位置爬到顶端。 要求求出从原本的顺序到目标顺序的最小操作。分别比较org和after 。 一样就都向上,否则org向上继续匹配。最终after上方剩下的就是org里要移动的题目:Problem D: ShellSort He made each turtle stand on another one's backAnd he piled them all up in a nine-turtle stack.And then Yertle climbed up. He sat down on the pile.What a wonderful v
阅读全文
摘要:一道让我崩溃的题目。。题目非常好理解但是我自己写的时候比较混乱。。最后是模仿着网上的代码写掉的代码里用到 ,第一次知道 用一个vector 的变量 a 用 a.erase() 后仍然可以使整个队列连续。比数组代码上方便。题目: ``Accordian'' PatienceYou are to simulate the playing of games of ``Accordian'' patience, the rules for which are as follows:Deal cards one by one in a row from left to r
阅读全文
摘要:题目大意: 给出一串表达式,大写是运算符,小写是类似数字,然后要求输出层序遍历先根据表达式建树然后进行层序遍历Problem E: ExpressionsArithmetic expressions are usually written with the operators in between the two operands (which is called infix notation). For example,(x+y)*(z-w)is an arithmetic expression in infix notation. However, it is easier to writ
阅读全文
摘要:题目给出 N个天数, X个party数,然后X行是每个PARTY罢工的周期m,计算在N天内一共罢工的天数是多少,一天内如果有一个以上party罢工就算一次题目Problem D: HartalsA social research organization has determined a simple set of parameters to simulate the behavior of the political parties of our country. One of the parameters is a positive integerh(called thehartal pa
阅读全文
摘要:题目 :Matrix Chain MultiplicationSuppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D and E are matrices. Since matrix multiplication is associative, the order in which multiplications are performed is arbitrary. However, the number of elementary multiplications needed strongly depe
阅读全文
浙公网安备 33010602011771号