自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 【总结】本地springboot连接腾讯云Redis

学习Redis时,SpringBoot整合Redis想试试连接腾讯云上的。网上找了半天,试了很多方法,下面是成功案例1. 修改redis.conf文件, 解除绑定本地ip, 并且关闭保护模式注释掉 bind 127.0.0.1protected-mode yes 改为 protected-mode nodaemonize no 改为 daemonize yes2. 防火墙放行redis默认的6379端口firewall-cmd --zone=public --add-port=6379

2021-03-07 16:10:21 526 1

原创 Day8 148. 排序链表

148. 排序链表在 O(n log n) 时间复杂度和常数级空间复杂度下,对链表进行排序。示例 1:输入: 4->2->1->3输出: 1->2->3->4示例 2:输入: -1->5->3->4->0输出: -1->0->3->4->5来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/sort-list著作权归领扣网络所有。商业转载请联系官方授权,非

2020-08-18 16:11:08 85

原创 Day 7 142. 环形链表 II

142. 环形链表 II给定一个链表,返回链表开始入环的第一个节点。 如果链表无环,则返回 null。为了表示给定链表中的环,我们使用整数 pos 来表示链表尾连接到链表中的位置(索引从 0 开始)。 如果 pos 是 -1,则在该链表中没有环。说明:不允许修改给定的链表。示例 1:输入:head = [3,2,0,-4], pos = 1输出:tail connects to node index 1解释:链表中有一个环,其尾部连接到第二个节点。示例 2:输入:head = [1,2]

2020-08-15 00:43:23 100 1

原创 Day6 141. 环形链表

141. 环形链表给定一个链表,判断链表中是否有环。为了表示给定链表中的环,我们使用整数 pos 来表示链表尾连接到链表中的位置(索引从 0 开始)。 如果 pos 是 -1,则在该链表中没有环。示例 1:输入:head = [3,2,0,-4], pos = 1输出:true解释:链表中有一个环,其尾部连接到第二个节点。示例 2:输入:head = [1,2], pos = 0输出:true解释:链表中有一个环,其尾部连接到第一个节点。示例 3:输入:head = [1], p

2020-08-14 00:48:40 107

原创 Day5 876. 链表的中间结点

876. 链表的中间结点给定一个带有头结点 head 的非空单链表,返回链表的中间结点。如果有两个中间结点,则返回第二个中间结点。示例 1:输入:[1,2,3,4,5]输出:此列表中的结点 3 (序列化形式:[3,4,5])返回的结点值为 3 。 (测评系统对该结点序列化表述是 [3,4,5])。注意,我们返回了一个 ListNode 类型的对象 ans,这样:ans.val = 3, ans.next.val = 4, ans.next.next.val = 5, 以及 ans.next.

2020-08-12 23:59:23 701

原创 Day4 23. 合并K个排序链表

23. 合并K个排序链表合并 k 个排序链表,返回合并后的排序链表。请分析和描述算法的复杂度。示例:输入:[1->4->5,1->3->4,2->6]输出: 1->1->2->3->4->4->5->6来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/merge-k-sorted-lists著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。结

2020-08-12 00:07:37 67

原创 Day3 21. 合并两个有序链表

21. 合并两个有序链表将两个升序链表合并为一个新的 升序 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。示例:输入:1->2->4, 1->3->4输出:1->1->2->3->4->4来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/merge-two-sorted-lists著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。结果:代码:clas

2020-08-11 00:26:50 82

原创 Day2 25. K 个一组翻转链表

25. K 个一组翻转链表给你一个链表,每 k 个节点一组进行翻转,请你返回翻转后的链表。k 是一个正整数,它的值小于或等于链表的长度。如果节点总数不是 k 的整数倍,那么请将最后剩余的节点保持原有顺序。示例:给你这个链表:1->2->3->4->5当 k = 2 时,应当返回: 2->1->4->3->5当 k = 3 时,应当返回: 3->2->1->4->5说明:你的算法只能使用常数的额外空间。你不能只是单纯的

2020-08-10 00:24:16 74

原创 Day1 92. 反转链表 II

Day1 92. 反转链表 II反转从位置 m 到 n 的链表。请使用一趟扫描完成反转。题目:说明:1 ≤ m ≤ n ≤ 链表长度。示例:输入: 1->2->3->4->5->NULL, m = 2, n = 4输出: 1->4->3->2->5->NULL来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/reverse-linked-list-ii著作权归领扣网络所有。商业

2020-08-09 00:19:54 110 1

原创 A. Design Tutorial: Learn from Math Z - 26 CodeForces - 472A

One way to create a task is to learn from math. You can generate some random math statement or modify some theorems to get something new and build a new task from that.For example, there is a stateme...

2019-03-07 21:08:48 103

原创 可乐题解(BFS)

大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)毫升 (正好装满一瓶) ,它们三个之间可以相互倒可乐 (都是没有刻度的,且 S==N+M,101>S>...

2019-02-21 14:04:15 580

原创 迷宫路径 bfs

定义一个二维数组:int maze[5][5] = {0, 1, 0, 0, 0,0, 1, 0, 1, 0,0, 0, 0, 0, 0,0, 1, 1, 1, 0,0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。Input一个5 × 5的二维数组,表示一个迷...

2019-02-20 22:19:43 83

原创 F - 6 HDU - 1789 Doing Homework again

Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in the homework after th...

2019-02-16 14:00:33 225

原创 E - 5 HDU - 2577 How to Type

Pirates have finished developing the typing software. He called Cathy to test his typing software. She is good at thinking. After testing for several days, she finds that if she types a string by some...

2019-01-29 17:56:42 105

原创 D - 4 HDU - 2159 FATE

最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd还说了他最多只杀s只怪。请问他能升掉这最后一级吗?Inpu...

2019-01-29 17:06:55 170

原创 J - 0 POJ - 1611 The Suspects

Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strategy is to s...

2019-01-29 16:08:10 76

原创 H - 8 POJ - 3126 Prime Path

The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices.— It is a matter of sec...

2019-01-29 15:14:45 90

原创 G - 7 HDU - 1176 免费馅饼

都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中是个身手敏捷的高手,但在现实中运动神经特别迟钝...

2019-01-27 12:20:19 99

原创 F - 6 HDU - 1171 Big Event in HDU

Nowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don’t know that Computer College had ever been split into Computer College and Software College in 2002.Th...

2019-01-27 11:05:27 94

原创 E - 5 HDU - 1069 Monkey and Banana

A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the monkey with some blocks. If the monk...

2019-01-26 22:26:20 89

原创 J - 0 HDU - 1420 Prepared for New Acmer

集训进行了将近2个礼拜,这段时间以恢复性训练为主,我一直在密切关注大家的训练情况,目前为止,对大家的表现相当满意,首先是绝大部分队员的训练积极性很高,其次,都很遵守集训纪律,最后,老队员也起到了很好的带头作用,这里特别感谢为这次DP专题练习赛提供题目和测试数据的集训队队长xhd同学.特别高兴的是,跟随集训队训练的一批新队员表现非常好,进步也比较显著,特别是训练态度大大超出我的预期,我敢说,如果各...

2019-01-26 21:53:40 110

原创 I - 9 POJ - 1426 Find The Multiple

Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there...

2019-01-26 19:17:06 123 1

原创 G - 7 HDU - 1213 How Many Tables

Today is Ignatius’ birthday. He invites a lot of friends. Now it’s dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each other, a...

2019-01-26 18:39:23 193

原创 G - 7 HDU - 2571 命运

穿过幽谷意味着离大魔王lemon已经无限接近了!可谁能想到,yifenfei在斩杀了一些虾兵蟹将后,却再次面临命运大迷宫的考验,这是魔王lemon设下的又一个机关。要知道,不论何人,若在迷宫中被困1小时以上,则必死无疑!可怜的yifenfei为了去救MM,义无返顾地跳进了迷宫。让我们一起帮帮执着的他吧!命运大迷宫可以看成是一个两维的方格阵列,如下图所示:yifenfei一开始在左上角,目...

2019-01-26 12:49:06 94

原创 F - 6 HDU - 1087 Super Jumping! Jumping! Jumping!

Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now.The game can ...

2019-01-26 10:04:28 72

原创 E - 5 HDU - 1505 City Game

Bob is a strategy game programming specialist. In his new city building game the gaming environment is as follows: a city is built up by areas, in which there are streets, trees,factories and building...

2019-01-26 00:15:44 76

原创 D - 4 HDU - 1506 Largest Rectangle in a Histogram

A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For example, the figure on the left shows ...

2019-01-25 23:06:20 61

原创 H - 8 POJ - 1321 棋盘问题

在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k <= n当为...

2019-01-24 22:55:16 96

原创 G - 7 HDU - 1003 Max Sum

Given a sequence a[1],a[2],a[3]…a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14.InputThe first l...

2019-01-24 20:30:04 81

原创 最大连续子序列F - 6 HDU - 1231

给定K个整数的序列{ N1, N2, …, NK },其任意连续子序列可表示为{ Ni, Ni+1, …,Nj },其中 1 <= i <= j <= K。最大连续子序列是所有连续子序列中元素和最大的一个,例如给定序列{ -2, 11, -4, 13, -5, -2 },其最大连续子序列为{ 11, -4, 13 },最大和为20。在今年的数据结构考卷中,要求编写程序得到...

2019-01-24 13:22:41 75

原创 F - 6 POJ - 1611 The Suspects

Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strategy is to s...

2019-01-22 11:51:23 83

原创 不容易系列之(3)—— LELE的RPG难题 HDU - 2045

人称“AC女之杀手”的超级偶像LELE最近忽然玩起了深沉,这可急坏了众多“Cole”(LELE的粉丝,即"可乐"),经过多方打探,某资深Cole终于知道了原因,原来,LELE最近研究起了著名的RPG难题:有排成一行的n个方格,用红(Red)、粉(Pink)、绿(Green)三色涂每个格子,每格涂一色,要求任何相邻的方格不能同色,且首尾两格也不同色.求全部的满足要求的涂法.以上就是著名的RPG难...

2018-12-26 22:09:09 122

原创 I'm bored with life CodeForces - 822A

Holidays have finished. Thanks to the help of the hacker Leha, Noora managed to enter the university of her dreams which is located in a town Pavlopolis. It’s well known that universities provide stud...

2018-12-26 21:42:28 221 1

原创 Digital Roots HDU - 1013

The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value contains two ...

2018-12-21 20:18:08 113

原创 骨牌铺方格 HDU - 2046

在2×n的一个长方形方格中,用一个1× 2的骨牌铺满方格,输入n ,输出铺放方案的总数.例如n=3时,为2× 3方格,骨牌的铺放方案有三种,如下图:Input输入数据由多行组成,每行包含一个整数n,表示该测试实例的长方形方格的规格是2×n (0<n<=50)。Output对于每个测试实例,请输出铺放方案的总数,每个实例的输出占一行。Sample Input132S...

2018-12-18 20:19:31 101

原创 一只小蜜蜂... HDU - 2044

有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房,不能反向爬行。请编程计算蜜蜂从蜂房a爬到蜂房b的可能路线数。其中,蜂房的结构如下所示。Input输入数据的第一行是一个整数N,表示测试实例的个数,然后是N 行数据,每行包含两个整数a和b(0<a<b<50)。Output对于每个测试实例,请输出蜜蜂从蜂房a爬到蜂房b的可能路线数,每个实例的输出占一行。Sample Inpu...

2018-12-18 12:44:17 144

原创 Theatre Square CodeForces - 1A

Theatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city’s anniversary, a decision was taken to pave the Square with square granite...

2018-12-17 22:16:15 129

原创 G - Problem G HDU - 6292

著名出题人小Q每次比赛后都会写一份《赛题分析》,包含比赛概况、每题的参考算法以及一些统计数值。对于一道题来说,小Q会统计最短的验题人代码长度(Shortest judge solution)以及赛内参赛队伍最短的AC代码长度(Shortest team solution)。统计验题人代码长度比较容易,因为验题人最多也不会超过20个。但是统计选手代码长度就不容易了,因为大赛区动辄三四百支队伍。...

2018-12-14 22:17:40 78

原创 数列有序!

Problem Description有n(n<=100)个整数,已经按照从小到大顺序排列好,现在另外给一个整数x,请将该数插入到序列中,并使新的序列仍然有序。Input输入数据包含多个测试实例,每组数据由两行组成,第一行是n和m,第二行是已经有序的n个数的数列。n和m同时为0标示输入数据的结束,本行不做处理。Output对于每个测试实例,输出插入新的元素后的数列。Sample ...

2018-12-12 21:19:01 137

原创 A + B Again

Problem DescriptionThere must be many A + B problems in our HDOJ , now a new one is coming.Give you two hexadecimal integers , your task is to calculate the sum of them,and print it in hexadecimal t...

2018-12-12 20:45:34 104

空空如也

空空如也

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

TA关注的人

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