自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(107)
  • 收藏
  • 关注

原创 数据结构总览 李慧琴

常见的数据结构

2022-10-12 14:51:35 228 1

原创 ROS基础 launch学习

ROS基础 launch学习目的:记录ROS学习过程 ,主要包括结果展示和源码。实例1 展示实例2 - 展示展示视频抽空补上

2021-05-12 11:56:11 161

原创 L2-031 深入虎穴 (25 分)

题目链接题目大意与分析:先寻找根结底,然后广度优先搜索,寻找层次最大的结点。提交代码:#include<iostream>#include<vector>#include<queue>#include<cstdio>using namespace std;int main(){ int n,root,door; sc...

2019-04-06 00:13:44 1381

原创 L2-032 彩虹瓶 (25 分)

题目链接题目大意:彩虹瓶有n层,必须按照1,2,3…n的顺序堆放小球。假设现在需要编号为m的小球,此时送来的恰好是m,则继续判断m+1层;若不是,如果此时货架上有小球,并且顶层就是m号,则继续判断m+1层。若不是,如果货架上还能放小球,则放小球,否则无法成功制作彩虹瓶。思路:利用堆栈进行模拟。提交代码:#include<bits/stdc++.h>using namespac...

2019-04-05 23:54:52 1274

原创 L2-030 冰岛人 (25 分)

题目链接题目大意:找两结点的最近公共祖先结点。思路:1、将名字用数字来编号,并记录性别。2、寻找并记录各个结点的父结点的编号。3、判断两人是否可以交往。这里难点是如何寻找公共结点 。可以这样,a到根结点有一条路径,记录下a到路径中各个结点的距离。同样对b进行同样的操作,在b到根结点的过程中,若两条路径相交,则是公共祖先,若距离都大于等于4,则是五代以外,满足要求,可以交往。注意,“五代...

2019-04-05 23:32:49 472

原创 L2-029 特立独行的幸福 (25 分)

题目链接题目大意:注意这几个概念,幸福数,幸福依附于初始数字的幸福数,特立独行的幸福数,独立性,不幸福的数。给定一区间,列出区间内所有的特立独行的幸福数和它的独立性。如果区间内没有幸福数,则输出SAD。思路:逐个遍历区间内的数字,判断是否是幸福数,若是幸福数则保存在一数组内;并且将该过程中经历的数字标记下来,用来下一步判断是否是特立独行的幸福数。若数组为空,说明没有幸福数;否则,遍历数组,判...

2019-04-05 22:53:02 950

原创 L1-064 估值一亿的AI核心代码 (20 分)

题目链接题目大意:按照要求,改变字符串,有些复杂。思路:方法对了,就很简单。“在每个空格和标点之前加一个空格,将字符串化成一块一块,逐个判断输出”,另一位博主写到。提交代码(参考别人):#include<bits/stdc++.h>using namespace std;int main(){ int n; scanf("%d",&n); g...

2019-04-05 17:47:47 4599 1

原创 L1-058 6翻了 (15 分)

题目链接题目大意:简单,不说了。思路:从左到右扫描,分两种情况:不是字符’6’,直接输出;是字符’6’,继续往后扫描,统计’6’的个数,然后再输出。提交代码:#include<bits/stdc++.h>using namespace std;int main(){ string s; int cnt=0; getline(cin,s); f...

2019-04-05 17:30:48 594

原创 L1-059 敲笨钟

题目链接题目大意:题意很简单,直接讲思路。思路:分两步完成1、判断是否押韵。分别判断上句和下午,看最后三个字母是否是"ing",放心的判断,不用担心越界;也不用担心最后一个汉字的拼音只有两个字母(当时在考场,这点浪费了将近半小时的时间,吐血啊!),只有两个字母一定不符合"ing"。2、输出。找到倒数第三个汉字的位置。提交代码(参考了别人):#include<bits/stdc++...

2019-04-05 17:08:01 295

原创 2019第四届团体程序设计天梯赛 CCCC经验、 总结!

第四届C4愉快地结束了!现在来写写经验!!!

2019-04-05 16:29:08 923

原创 CodeBlocks的调试技巧

设置断点、运行到光标、单步调试添加链接描述软件调试工具设置添加链接描述

2019-03-27 15:58:19 245

原创 1131 Subway Map

Subway MapIn the big cities, the subway systems always look so complex to the visitors. To give you some sense, the following figure shows the map of Beijing subway. Now you are supposed to help peop...

2018-11-20 20:04:18 178

原创 1087 All Roads Lead to Rome

1087 All Roads Lead to RomeIndeed 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....

2018-11-16 20:32:55 128

原创 1053 Path of Equal Weight

1053 Path of Equal Weight题目链接Given a non-empty tree with root R, and with weight W​i​​ assigned to each tree node T​i​​ . The weight of a path from R to L is defined to be the sum of the weights ...

2018-10-16 20:51:14 115

原创 1026 Table Tennis

1026 Table TennisA table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if there are some tables open when they arrive, they will be a...

2018-10-11 14:47:53 280

原创 1030 Travel Plan

1030 Travel PlanA 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 decide th...

2018-10-11 14:44:59 162

原创 1018 Public Bike Management

1018 Public Bike ManagementThere 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 t...

2018-10-09 19:41:09 105

原创 1022 Digital Library

1022 Digital LibraryA Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigned an un...

2018-10-09 19:32:09 209

原创 1148 Werewolf - Simple Version

1148 Werewolf - Simple Version题目链接Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human beings. Suppose that in a game,player #1 said: “Player ...

2018-10-06 16:11:59 193

原创 1144 The Missing Number

1144 The Missing NumberGiven N integers, you are supposed to find the smallest positive integer that is NOT in the given list.Input Specification:Each input file contains one test case. For each ca...

2018-10-06 15:27:56 136

原创 1140 Look-and-say Sequence

1140 Look-and-say Sequence题目链接Look-and-say sequence is a sequence of integers as the following:D, D1, D111, D113, D11231, D112213111, …where D is in [0, 9] except 1. The (n+1)st number is a kind o...

2018-10-06 15:20:49 147

原创 1136 A Delayed Palindrome

1136 A Delayed Palindrome题目链接Consider a positive integer N written in standard notation with k+1 digits a​i​​ as a​k​​ ⋯a​1​​ a​0​​ with 0≤a​i​​ &lt;10 for all i and a​k​​ &gt;0. Then ...

2018-10-06 15:16:21 130

原创 1132 Cut Integer

1132 Cut IntegerCutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits long integers A and B. For example, after cutting Z = 167334, we have A = 167 and B = 334. ...

2018-10-06 15:12:54 149

原创 1112 Stucked Keyboard

1112 Stucked KeyboardOn 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 time...

2018-10-05 18:23:29 123

原创 1128 N Queens Puzzle

1128 N Queens PuzzleThe “eight queens puzzle” is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other. Thus, a solution requires that no two queens...

2018-10-05 13:18:18 108

原创 1124 Raffle for Weibo Followers

1124 Raffle for Weibo FollowersJohn got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo – that is, he would select winners from every N followers w...

2018-10-05 12:28:03 150

原创 1116 Come on! Let's C

1116 Come on! Let’s C“Let’s C” is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of the contest is for fun, the aw...

2018-10-05 12:14:54 189

原创 1120 Friend Numbers

1120 Friend NumbersTwo integers are called “friend numbers” if they share the same sum of their digits, and the sum is their “friend ID”. For example, 123 and 51 are friend numbers since 1+2+3 = 5+1 ...

2018-10-05 11:58:32 74

原创 1108 Finding Average

1108 Finding AverageThe 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 ...

2018-10-05 11:18:48 104

原创 1104 Sum of Number Segments

1104 Sum of Number SegmentsGiven 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 have 10 segments: (0....

2018-10-05 11:12:43 153

原创 1100 Mars Numbers

1100 Mars NumbersPeople on Mars count their numbers with base 13:Zero on Earth is called “tret” on Mars.The numbers 1 to 12 on Earch is called “jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov...

2018-10-05 11:03:30 247

原创 1096 Consecutive Factors

1096 Consecutive Factors1096 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 ...

2018-10-05 10:57:04 143

原创 1092 To Buy or Not to Buy

1092 To Buy or Not to BuyEva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of beads. However the owner ...

2018-10-05 10:02:21 173

原创 1088 Rational Arithmetic

1088 Rational ArithmeticFor two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quotient.Input Specification:Each input f...

2018-10-03 21:12:14 86

原创 1084 Broken Keyboard

1084 Broken KeyboardOn a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters corresponding to those keys will not appear on screen.Now given a string that...

2018-10-03 21:10:36 103

原创 1081 Rational Sum

1081 Rational SumGiven N rational numbers in the form numerator/denominator, you are supposed to calculate their sum.Input Specification:Each input file contains one test case. Each case starts wit...

2018-10-03 21:02:13 142

原创 1077 Kuchiguse

1077 KuchiguseThe 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 prefer...

2018-10-03 20:57:59 166

原创 1073 Scientific Notation

1073 Scientific NotationScientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [±][1-9].[0-9]+E[±][0-9]+ wh...

2018-10-03 20:46:32 208

原创 1069 The Black Hole of Numbers

1069 The Black Hole of NumbersFor any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decreasing order, a new ...

2018-10-02 14:44:16 264

原创 1065 A+B and C (64bit)

1065 A+B and C (64bit)Given three integers A, B and C in [−2​63​​ ,2​63​​ ], you are supposed to tell whether A+B&gt;C.Input Specification:The first line of the input gives the positive number ...

2018-10-02 14:39:26 105

空空如也

空空如也

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

TA关注的人

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