自定义博客皮肤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)
  • 收藏
  • 关注

原创 记一次华为面试

一、本人:某985工科学校机械工程专业。大学之前没接触过编程,本科必修课里有C,低配数据结构(树和图不学编程),微机原理,遂准备转计算机。大三下自学408相关内容,考研报的浙大,初始分数还不错(?),目前正在为机试发愁。二、找工作缘由:因为疫情原因,学校参加了空中双选会,本人担心考研失败,遂做两手准备,但只是在智联上填了简历,并未投递。第二天收到家乡(三到四线城市)某机械企业邀请面试的电话,当时...

2020-03-31 11:26:28 1725 2

原创 1135 Is It A Red-Black Tree (30分)

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 red or black.(2) The root is black.(3) Every le...

2020-03-27 22:19:53 252

原创 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.Input Specification:Each in...

2020-03-26 12:09:08 109

原创 1068 Find More Coins (30分)

Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However,...

2020-03-25 17:10:06 156

原创 1123 Is It a Complete AVL Tree (30分)

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 time they differ by more than one, rebalancing is...

2020-03-25 15:48:16 175

原创 1018 Public Bike Management (30分)

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 station and return it to any other stations in the ...

2020-03-24 22:25:41 159

原创 1017 Queueing at Bank (25分)

Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the customers have to wait in line behind the yellow li...

2020-03-24 11:55:39 104

原创 1111 Online Map (30分)

Input our current position and a destination, an online map can recommend several paths. Now your job is to recommend two paths to your user: one is the shortest, and the other is the fastest. It is g...

2020-03-23 18:35:48 172

原创 1110 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, the first line gives a positive integer N (≤20) whic...

2020-03-23 16:22:32 196

原创 1109 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 row must be N/K (round down to the nearest integer...

2020-03-23 13:53:59 318

转载 sscanf和sprintf()函数使用说明

https://blog.csdn.net/shawvichan/article/details/17931455

2020-03-22 11:25:06 140

原创 1108 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 numbers might not be legal. A legal input is a real...

2020-03-22 11:07:11 184

原创 1115 Counting Nodes in a BST (30分)

A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less than or equal to the node’s key.Th...

2020-03-21 19:26:38 103

原创 1112 Stucked Keyboard (20分)

On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters corresponding to those keys will appear repeatedly on screen for k times.Now given a resulti...

2020-03-21 14:15:43 108

原创 1127 ZigZagging on a Tree (30分)

Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and inorder traversal sequences. And it is a simple stand...

2020-03-16 10:56:47 253

转载 1139 First Contact (30分)

注意不能用int输入编号,否则-0000与0000无法区分性别,这可能是第1、2(从0开始)测点错误的原因1139 First Contact (30 分)(细节坑题)

2020-03-11 23:46:51 518

原创 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 number of the postorder traversal se...

2020-03-11 22:03:06 128

原创 1142 Maximal Clique (25分)

A clique is a subset of vertices of an undirected graph such that every two distinct vertices in the clique are adjacent. A maximal clique is a clique that cannot be extended by including one more adj...

2020-03-10 17:49:36 130

原创 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.Input Specification:Each input file contain...

2020-03-10 16:43:49 111

原创 1145 Hashing - Average Search Time (25分)

The task of this problem is simple: insert a sequence of distinct positive integers into a hash table first. Then try to find another sequence of integer keys from the table and output the average sea...

2020-03-10 00:28:18 114

原创 1151 LCA in a Binary Tree (30分)

自己写的:先建树,然后利用后续非递归遍历求解#include<iostream>#include<stack>using namespace std;const int maxn = 10010;typedef struct node { int n; node* left; node* right;}*tree;int n, m, pre[maxn...

2020-03-09 15:51:16 220

原创 关键路径

最近在准备复试,虽然关键路径机试从没考过,以防万一,自己实现一下。理论书上基本都有,就不写了。#include<iostream>#include<vector>#include<stack>#include<queue>using namespace std;const int maxn = 1000;struct node { i...

2020-03-08 00:37:32 344

原创 1154 Vertex Coloring (25分)

此题与图算法基本无关存储所有边,存储所有顶点的颜色,枚举每一条边,判断该边两顶点颜色是否相同。#include<iostream>#include<set>using namespace std;const int maxn = 10010;int n, m;set<int>s;struct { int vex1; int vex2;}ed...

2020-03-04 00:45:10 83

空空如也

空空如也

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

TA关注的人

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