徐子烊

  • 主页
  • 语雀
所有文章 关于我

徐子烊

  • 主页
  • 语雀

1091 Acute Stroke (30 分)

2019-04-13

1091 Acute Stroke (30 分)

One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions are identified in each MRI slice, your job is to calculate the volume of the stroke core.

more >>
  • PAT
  • bfs
  • PAT题解

展开全文 >>

1087 All Roads Lead to Rome (30 分)

2019-04-11

1087 All Roads Lead to Rome (30 分)

Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the most happiness.

more >>
  • PAT
  • dijkstra
  • 图
  • PAT题解

展开全文 >>

1086 Tree Traversals Again (25 分)

2019-04-10

1086 Tree Traversals Again (25 分)

An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered from 1 to 6) is traversed, the stack operations are: push(1); push(2); push(3); pop(); pop(); push(4); pop(); pop(); push(5); push(6); pop(); pop(). Then a unique binary tree (shown in Figure 1) can be generated from this sequence of operations. Your task is to give the postorder traversal sequence of this tree.

img

more >>
  • PAT
  • 树
  • PAT题解

展开全文 >>

[坑][自闭]1082 Read Number in Chinese (25 分)

2019-04-09

1082 Read Number in Chinese (25 分)

Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. Output Fu first if it is negative. For example, -123456789 is read as Fu yi Yi er Qian san Bai si Shi wu Wan liu Qian qi Bai ba Shi jiu. Note: zero (ling) must be handled correctly according to the Chinese tradition. For example, 100800 is yi Shi Wan ling ba Bai.

Input Specification:

Each input file contains one test case, which gives an integer with no more than 9 digits.

Output Specification:

For each test case, print in a line the Chinese way of reading the number. The characters are separated by a space and there must be no extra space at the end of the line.

more >>
  • PAT
  • PAT题解

展开全文 >>

MacOS 10.14 Mojave 安装caffe记录

2019-04-09

MacOS 10.14 Mojave 安装caffe记录

做毕设需要用到caffe,尝试在自己电脑上安装,过程中发现安装caffe还是有不少坑的,特此记录。主要参考https://zhuanlan.zhihu.com/p/46930024

more >>
  • caffe
  • 随笔

展开全文 >>

1080 Graduate Admission (30 分)

2019-04-08

1080 Graduate Admission (30 分)

It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if you could write a program to automate the admission procedure.

Each applicant will have to provide two grades: the national entrance exam grade G**E, and the interview grade G**I. The final grade of an applicant is (G**E+G**I)/2. The admission rules are:

  • The applicants are ranked according to their final grades, and will be admitted one by one from the top of the rank list.

  • If there is a tied final grade, the applicants will be ranked according to their national entrance exam grade G**E. If still tied, their ranks must be the same.

  • Each applicant may have K choices and the admission will be done according to his/her choices: if according to the rank list, it is one’s turn to be admitted; and if the quota of one’s most preferred shcool is not exceeded, then one will be admitted to this school, or one’s other choices will be considered one by one in order. If one gets rejected by all of preferred schools, then this unfortunate applicant will be rejected.

  • If there is a tied rank, and if the corresponding applicants are applying to the same school, then that school must admit all the applicants with the same rank, even if its quota will be exceeded.

    more >>
  • PAT
  • 模拟
  • PAT题解

展开全文 >>

1078 Hashing (25 分)

2019-04-07

1078 Hashing (25 分)

The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. The hash function is defined to be H(key)=key%TSize where TSize is the maximum size of the hash table. Quadratic probing (with positive increments only) is used to solve the collisions.

Note that the table size is better to be prime. If the maximum size given by the user is not prime, you must re-define the table size to be the smallest prime number which is larger than the size given by the user.

Input Specification:

Each input file contains one test case. For each case, the first line contains two positive numbers: MSize (≤104) and N (≤MSize) which are the user-defined table size and the number of input numbers, respectively. Then N distinct positive integers are given in the next line. All the numbers in a line are separated by a space.

Output Specification:

For each test case, print the corresponding positions (index starts from 0) of the input numbers in one line. All the numbers in a line are separated by a space, and there must be no extra space at the end of the line. In case it is impossible to insert the number, print “-“ instead.

more >>
  • PAT
  • 哈希
  • PAT题解

展开全文 >>

1077 Kuchiguse (20 分)

2019-04-07

1077 Kuchiguse (20 分)

The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker’s personality. Such a preference is called “Kuchiguse” and is often exaggerated artistically in Anime and Manga. For example, the artificial sentence ending particle “nyan~” is often used as a stereotype for characters with a cat-like personality:

  • Itai nyan~ (It hurts, nyan~)
  • Ninjin wa iyada nyan~ (I hate carrots, nyan~)

Now given a few lines spoken by the same character, can you find her Kuchiguse?

Input Specification:

Each input file contains one test case. For each case, the first line is an integer N (2≤N≤100). Following are N file lines of 0~256 (inclusive) characters in length, each representing a character’s spoken line. The spoken lines are case sensitive.

Output Specification:

For each test case, print in one line the kuchiguse of the character, i.e., the longest common suffix of all N lines. If there is no such suffix, write nai.

more >>
  • PAT
  • PAT题解

展开全文 >>

1076 Forwards on Weibo (30 分)

2019-04-07

1076 Forwards on Weibo (30 分)

Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social network is formed with followers relations. When a user makes a post on Weibo, all his/her followers can view and forward his/her post, which can then be forwarded again by their followers. Now given a social network, you are supposed to calculate the maximum potential amount of forwards for any specific user, assuming that only L levels of indirect followers are counted.

Input Specification:

Each input file contains one test case. For each case, the first line contains 2 positive integers: N (≤1000), the number of users; and L (≤6), the number of levels of indirect followers that are counted. Hence it is assumed that all the users are numbered from 1 to N. Then N lines follow, each in the format:

1
M[i] user_list[i]

where M[i] (≤100) is the total number of people that user[i] follows; and user_list[i] is a list of the M[i] users that followed by user[i]. It is guaranteed that no one can follow oneself. All the numbers are separated by a space.

Then finally a positive K is given, followed by K UserID‘s for query.

more >>
  • PAT
  • bfs
  • PAT题解

展开全文 >>

[天坑]1075 PAT Judge (25 分)

2019-04-04

[天坑]1075 PAT Judge (25 分)

The ranklist of PAT is generated from the status list, which shows the scores of the submissions. This time you are supposed to generate the ranklist for PAT.

Input Specification:

Each input file contains one test case. For each case, the first line contains 3 positive integers, N (≤104), the total number of users, K (≤5), the total number of problems, and M (≤105), the total number of submissions. It is then assumed that the user id’s are 5-digit numbers from 00001 to N, and the problem id’s are from 1 to K. The next line contains K positive integers p[i] (i=1, …, K), where p[i] corresponds to the full mark of the i-th problem. Then M lines follow, each gives the information of a submission in the following format:

1
user_id problem_id partial_score_obtained

where partial_score_obtained is either −1 if the submission cannot even pass the compiler, or is an integer in the range [0, p[problem_id]]. All the numbers in a line are separated by a space.

more >>
  • PAT
  • PAT题解

展开全文 >>

« Prev1…45678…11Next »
© 2020 徐子烊
Hexo Theme Yilia by Litten
  • 所有文章
  • 关于我

tag:

  • PAT
  • 多项式
  • dijkstra
  • 图
  • 树
  • 最大子序列
  • 进制转换
  • 二分
  • dfs
  • 连通分量
  • 模拟
  • STL
  • 大整数
  • 需复习
  • 链表
  • 贪心
  • 动态规划
  • 子序列
  • 二叉树
  • LCS
  • 栈
  • 排序
  • 质因数
  • 树状数组
  • 完全二叉树
  • 整数溢出
  • AVL树
  • 深搜
  • 哈希
  • bfs
  • 并查集
  • 红黑树
  • LCA
  • 拓扑排序
  • lca
  • 实习
  • bat
  • Leetcode
  • Java并发
  • 线程池
  • 6.824
  • 分布式
  • mapreduce
  • caffe
  • epoll
  • Raft
  • schnorr
  • 密码学
  • 设计模式
  • 单例模式
  • 原型模式
  • 工厂模式
  • 建造者模式
  • 抽象工厂
  • 桥接模式
  • 模版模式
  • 组合模式
  • 策略模式
  • 装饰器模式
  • 迭代器模式
  • 适配器模式

    缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    3、在根目录_config.yml里添加配置:

      jsonContent:
        meta: false
        pages: false
        posts:
          title: true
          date: true
          path: true
          text: false
          raw: false
          content: false
          slug: false
          updated: false
          comments: false
          link: false
          permalink: false
          excerpt: false
          categories: false
          tags: true
    

很惭愧

只做了一点微小的工作