自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(23)
  • 资源 (4)
  • 收藏
  • 关注

原创 PAT(甲级)1030.Travel Plan(30)

PAT 1030.Travel Plan(30)A traveler’s map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to d...

2019-04-10 20:17:58 365

原创 PAT(甲级)1003.Emergency(25)

PAT 1003.Emergency(25)As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams...

2019-04-10 17:53:17 249

原创 PAT(甲级)1055.The World's Richest(25)

PAT 1055.The World’s Richest(25)Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world’s wealthiest people. Now you are supposed to simulate this job, ...

2019-04-08 23:21:26 294

原创 PAT(甲级)1105.Spiral Maxtrix(25)

PAT 1105 Spiral Matrix(25)This time your job is to fill a sequence of N positive integers into a spiral matrix in non-increasing order. A spiral matrix is filled in from the first element at the uppe...

2019-04-08 22:10:09 156

原创 PAT(甲级)1137.Fianl Grading(25)

PAT 1137.Fianl Grading(25)For a student taking the online course “Data Structures” on China University MOOC (http://www.icourse163.org/), to be qualified for a certificate, he/she must first obtain n...

2019-04-07 18:11:48 284

原创 PAT(甲级)1036.Boys vs Girls(25)

PAT 1036.Boys vs Girls(25)This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students.输入格式:Each input file cont...

2019-04-07 14:45:42 212

原创 PAT(甲级)1143. Lowest Common Ancestor(30)

PAT 1143. Lowest Common Ancestor(30)The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.A binary search tree (BST) is recursively...

2019-04-07 14:17:05 248

原创 PAT(甲级)1051.LCA in a Binary Tree(30)

PAT 1051.LCA in a Binary Tree(30)The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.Given any two nodes in a binary tree, you ar...

2019-04-07 13:52:33 203

原创 PAT(甲级)1025.PAT Ranking(25)

PAT 1025.PAT Ranking(25)Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in several pl...

2019-04-07 09:24:00 196

原创 PAT(甲级)1138.Postorder Traversal(25)

PAT 1138.Postorder Traversal(25)Suppose that all the keys in a binary tree are distinct positive integers. Given the preorder and inorder traversal sequences, you are supposed to output the first num...

2019-04-07 00:39:57 197

原创 PAT考试 常用技巧(持续更新)

1.字符串中的大小写转换s[i] ^= 32;//位运算,速度快

2019-04-06 23:26:34 2815

原创 git本地仓库的使用流程

一、基本设置1.设置用户名git config --global user.name "你的用户名"2.设置邮箱git config --global user.email "你的邮箱地址"3.查看设置git config --list3.删除设置git config --global --unset user.name二、初始化本地仓库1.新建本地仓库目录文件夹2...

2019-04-06 18:03:55 306

原创 PAT(甲级)1121.Damn Single(25)

PAT 1141.PAT Ranking of Institutions (25 分)“Damn Single (单身狗)” is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can be tak...

2019-04-06 14:05:20 230

原创 PAT(甲级)1050.String Subtraction(20)

PAT 1141.PAT Ranking of Institutions (25 分)Given two strings S1 and S​2​​ , S=S1−S​2 is defined to be the remaining string after taking all the characters in S​2 from S1. Your task is simply to calcu...

2019-04-06 13:42:52 153

原创 PAT(甲级)1006.Sign In and Sign Out(25)

PAT 1141.PAT Ranking of Institutions (25 分)At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Give...

2019-04-06 13:25:03 351

原创 PAT(甲级)1141.PAT Ranking of Institutions (25 分)

PAT 1141.PAT Ranking of Institutions (25 分)After each PAT, the PAT Center will announce the ranking of institutions based on their students’ performances. Now you are asked to generate the ranklist....

2019-04-06 01:09:37 437 1

原创 PAT 甲级常用单词组 (持续更新)

1.case insensitive 不区分大小写

2019-04-05 23:43:47 1140

原创 PAT(乙级)1007.素数对猜想(20)

PAT 1006.换个格式输出整数(15)让我们用字母B来表示百、字母 S 表示十,用 12...n 来表示不为零的个位数字 n(<10),换个格式来输出任一个不超过3位的正整数。例如234应该被输出为 BBSSS1234,因为它有2个百、3个十、以及个位的4。输入格式:每个测试输入包含 1 个测试用例,给出正整数 n(<1000)。输出格式:每个测试用例的输出占一行,用规...

2019-04-04 20:14:36 149

原创 PAT(乙级)1004.成绩排名(20)

PAT 1004.成绩排名(20)读入 n(>0)名学生的姓名、学号、成绩,分别输出成绩最高和成绩最低学生的姓名和学号。输入格式:每个测试输入包含 1 个测试用例,格式为:第 1 行:正整数 n第 2 行:第 1 个学生的姓名 学号 成绩第 3 行:第 2 个学生的姓名 学号 成绩 ... ... ...第 n+1 行:第 n 个学生的姓名 学号 成绩其中姓名和学号均...

2019-04-04 20:03:51 194

原创 PAT(乙级)1002.写出这个数(20)

PAT 1002.写出这个数(20)读入一个正整数 n,计算其各位数字之和,用汉语拼音写出和的每一位数字。输入格式:每个测试输入包含 1 个测试用例,即给出自然数n的值。这里保证 n小于10​^100。输出格式:在一行内输出 n 的各位数字之和的每一位,拼音数字间有 1 空格,但一行中最后一个拼音数字后没有空格。输入样例:1234567890987654321123456789...

2019-04-04 19:55:37 138

原创 PAT(乙级)1001.害死人不偿命的(3n+1)猜想(15)

PAT 1001.害死人不偿命的(3n+1)猜想(15) 卡拉兹(Callatz)猜想:对任何一个正整数 n,如果它是偶数,那么把它砍掉一半;如果它是奇数,那么把 (3n+1) 砍掉一半。这样一直反复砍下去,最后一定在某一步得到 n=1。卡拉兹在 1950 年的世界数学家大会上公布了这个猜想,传说当时耶鲁大学师生齐动员,拼命想证明这个貌似很傻很天真的命题,结果闹得学生们无心学业,一心只证 (3...

2019-04-04 19:13:06 142

原创 PAT(乙级)1051.复数乘法(15)

PAT 1051.复数乘法(15) 复数可以写成 (A+Bi) 的常规形式,其中 A 是实部,B 是虚部,i 是虚数单位,满足 i^2=−1;也可以写成极坐标下的指数形式 (R×e​(Pi)),其中 R 是复数模,P 是辐角,i是虚数单位,其等价于三角形式 R(cos(P)+isin(P))。现给定两个复数的 R 和 P,要求输出两数乘积的常规形式。输入格式:输入在一行中依次给出两个复数...

2019-04-04 12:23:49 157

原创 PAT(乙级)1017.A除以B(20)

PAT 1017.A除以B(20) 本题要求计算 A/B,其中 A 是不超过 1000 位的正整数,B 是 1 位正整数。你需要输出商数 Q 和余数 R,使得 A=B×Q+R 成立。输入格式:输入在一行中依次给出 A 和 B,中间以 1 空格分隔。输出格式:在一行中依次输出 Q 和 R,中间以 1 空格分隔。输入样例:123456789050987654321 7输出样例:1...

2019-04-04 10:25:52 196

八大排序C++代码实现

冒泡排序 选择排序 插入排序 基数排序 希尔排序 归并排序 堆排序 快速排序的C++的代码实现,可以作为模板使用,是互联网企业面试的必备技能

2020-11-14

常用的数据结构树算法代码总结

本文档总结了常用的数据结构中的树算法代码.包含常见的遍历算法(递归与非递归等),dfs,bfs的实现以及其广泛的应用

2020-01-01

LinkedListProblems.pdf

斯坦福大学整理的18个链表的相关问题,包括各类型的链表的问题。对于面试算法有很大的帮助,唯一的不足是pdf文档为全英文,需要一定的英语阅读能力。

2019-10-29

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除