摘要:
PAT (Advanced Level) Practice 1053 Path of Equal Weight (30 分) 凌宸1642 题目描述: Given a non-empty tree with root R, and with weight Wi assigned to each tr 阅读全文
摘要:
BFS 广度搜索 入门典例 -- 凌宸1642 广度优先搜索 是以 广度 为 第一关键词 ,当碰到岔路口时,总是先依次访问从该岔道口能 直接到达 的 所有结点 ,然后再按这些结点被访问的顺序去依次访问它们能直接到达的所有结点,以此类推。广度优先搜索一般由 队列 实现,且总是按照 层次 的顺序进行遍历 阅读全文
摘要:
PAT (Advanced Level) Practice 1050 String Subtraction (20 分) 凌宸1642 题目描述: Given two strings S1 and S2, S=S1−S2 is defined to be the remaining string a 阅读全文
摘要:
DFS 深搜专题 入门典例 -- 凌宸1642 深度优先搜索 是一种 枚举所有完整路径以遍历所有情况的搜索方法 ,使用 递归 可以很好的实现 深度优先搜索。 1 最大价值 题目描述 有 n 件物品,每件物品的重量为 w[i] , 价值为 c[i] 。现在需要选出若干件物品放入一个容器为 V 的背 阅读全文
摘要:
PAT (Advanced Level) Practice 1046 Shortest Distance (20 分) 凌宸1642 题目描述: The task is really simple: given N exits on a highway which forms a simple cy 阅读全文
摘要:
PAT (Advanced Level) Practice 1042 Shuffling Machine (20 分) 凌宸1642 题目描述: Shuffling is a procedure used to randomize a deck of playing cards. Because s 阅读全文
摘要:
PAT (Advanced Level) Practice 1041 Be Unique (20 分) 凌宸1642 题目描述: Being unique is so important to people on Mars that even their lottery is designed in 阅读全文
摘要:
阿里后端笔试之元素个数 -- 2021/04/02 - 凌宸1642 题目描述: 小明现在有一个长度为 N 的不递减序列,你可以操作任意次,每一次操作可以让某一个位置上的数加 1,但每个位置的数最多只能操作一次,通过这个操作,能让新产生的序列中有多少个不同的数。 输入描述: 第一行代表 T 组测试数 阅读全文
摘要:
PAT (Advanced Level) Practice 1035 Password (20 分) 凌宸1642 题目描述: To prepare for PAT, the judge sometimes has to generate random passwords for the users 阅读全文
摘要:
PAT (Advanced Level) Practice 1031 Hello World for U (20 分) 凌宸1642 题目描述: Given any string of N (≥5) characters, you are asked to form the characters i 阅读全文