随笔分类 -  PAT练习

摘要:###题目 给一个m * n的矩阵,现在每次可以选择以元素ai为第一行第一列的大小为a * b的矩阵,矩阵中的每个元素都将-ai。选取的矩阵不能超过m*n的范围之外。现在问是否能将矩阵中的元素全部变为0. ###解法 由于选取的a * b矩阵必须在原矩阵之中,那么第1行,第1列的元素肯定是要作为起始 阅读全文
posted @ 2020-11-09 14:46 blueattack 阅读(106) 评论(0) 推荐(0)
摘要:1103. Integer Factorization (30) 时间限制 1200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue 时间限制 1200 ms 时间限制 1200 ms 内存限制 65536 kB 内存限制 655 阅读全文
posted @ 2018-05-05 20:12 blueattack 阅读(243) 评论(0) 推荐(0)
摘要:In the big cities, the subway systems always look so complex to the visitors. To give you some sense, the following figure shows the map of Beijing su 阅读全文
posted @ 2018-03-17 13:33 blueattack 阅读(198) 评论(0) 推荐(0)
摘要:An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any 阅读全文
posted @ 2018-03-14 10:29 blueattack 阅读(169) 评论(0) 推荐(0)
摘要:There is a kind of balanced binary search tree named red-black tree in the data structure. It has the following 5 properties: (1) Every node is either 阅读全文
posted @ 2018-03-13 20:26 blueattack 阅读(367) 评论(0) 推荐(0)
摘要:A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if there are some tables open 阅读全文
posted @ 2018-03-10 21:08 blueattack 阅读(260) 评论(0) 推荐(0)
摘要:A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the 阅读全文
posted @ 2018-03-09 19:21 blueattack 阅读(162) 评论(0) 推荐(0)
摘要:已知后序与中序输出前序(先序):后序:3, 4, 2, 6, 5, 1(左右根)中序:3, 2, 4, 1, 6, 5(左根右) 已知一棵二叉树,输出前,中,后时我们采用递归的方式。同样也应该利用递归的思想: 对于后序来说,最后一个节点肯定为根。在中序中可以找到左子树的个数,那么就可以在后序中找到左 阅读全文
posted @ 2018-03-09 17:27 blueattack 阅读(450) 评论(0) 推荐(0)
摘要:There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any s 阅读全文
posted @ 2018-03-07 21:22 blueattack 阅读(653) 评论(0) 推荐(0)