• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






tccbj

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

2019年2月28日

PAT A1110 Complete Binary Tree (25 分)——完全二叉树,字符串转数字
摘要: Given a tree, you are supposed to tell if it is a complete binary tree. Input Specification: Each input file contains one test case. For each case, th 阅读全文
posted @ 2019-02-28 21:51 tccbj 阅读(367) 评论(0) 推荐(0)
 
PAT A1109 Group Photo (25 分)——排序
摘要: Formation is very important when taking a group photo. Given the rules of forming K rows with N people as the following: The number of people in each 阅读全文
posted @ 2019-02-28 21:00 tccbj 阅读(128) 评论(0) 推荐(0)
 
PAT A1108 Finding Average (20 分)——字符串,字符串转数字
摘要: The basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it complicated is that some of the input n 阅读全文
posted @ 2019-02-28 20:22 tccbj 阅读(336) 评论(0) 推荐(0)
 
PAT A1107 Social Clusters (30 分)——并查集
摘要: When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A socia 阅读全文
posted @ 2019-02-28 19:21 tccbj 阅读(314) 评论(0) 推荐(0)
 
PAT A1106 Lowest Price in Supply Chain (25 分)——树的bfs遍历
摘要: A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer 阅读全文
posted @ 2019-02-28 16:27 tccbj 阅读(317) 评论(0) 推荐(0)
 
PAT A1104 Sum of Number Segments (20 分)——数学规律,long long
摘要: Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2, 0.3, 0.4 }, we 阅读全文
posted @ 2019-02-28 14:47 tccbj 阅读(169) 评论(0) 推荐(0)
 
PAT A1103 Integer Factorization (30 分)——dfs,递归
摘要: The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program t 阅读全文
posted @ 2019-02-28 14:38 tccbj 阅读(369) 评论(0) 推荐(0)
 
PAT A1102 Invert a Binary Tree (25 分)——静态树,层序遍历,先序遍历,后序遍历
摘要: The following is from Max Howell @twitter: Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a 阅读全文
posted @ 2019-02-28 10:40 tccbj 阅读(110) 评论(0) 推荐(0)
 
PAT A1096 Consecutive Factors (20 分)——数字遍历
摘要: Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3×5×6×7, where 5, 6, a 阅读全文
posted @ 2019-02-28 10:00 tccbj 阅读(149) 评论(0) 推荐(0)