自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(114)
  • 资源 (2)
  • 收藏
  • 关注

原创 二分查找与二分查找变种

经典经典二分查找问题:https://leetcode-cn.com/problems/binary-search/给定一个 n 个元素有序的(升序)整型数组 nums 和一个目标值 target ,写一个函数搜索 nums 中的 target,如果目标值存在返回下标,否则返回 -1。示例 1:输入: nums = [-1,0,3,5,9,12], target = 9输出: 4解释: 9 出现在 nums 中并且下标为 4示例 2:输入: nums = [-1,0,3,5,9,12],

2021-09-06 21:41:56 136

原创 DevTools在多模块项目中出现 class x.x.A cannot be cast to x.x.A解决办法

定位问题在使用 DevTools 时,出现 class x.x.A cannot be cast to x.x.A,虽然说的两个类是一样的,其实二者并不相同,classLoader不同,这个报错其实是说 class x.x.A(classLoaderA) 不能转换为 class x.x.A (classLoaderB)为什么类加载器不一样这就涉及到了DevTools的原理spring-boot-devtools会检测类路径的变化,当类路径内容发生变化后会自动重启应用程序。Spring Boot的重启

2021-08-03 19:51:45 630

原创 最短路径-图-----练习力扣787. K 站中转内最便宜的航班

首先还是搞定三种最短路径的算法。参考:https://www.cnblogs.com/Halburt/p/10756572.htmlhttps://www.cnblogs.com/tahitian-fang/p/5754946.html先总结一下:floyd算法,任意两点的最短路径(多源最短路径),可负权边,dijkstra算法,一点的最短路径(单源最短路径),不可负权边bellman-ford算法,允许负权边的单源最短路径算法spfa,其实是bellman-ford+队列优化,其实和bfs

2021-07-09 23:54:42 534 3

原创 Debug Spring的循环依赖

我是目录一级目录二级目录三级目录循环依赖解释最好的一个图getSingleton里面调用doCreateBean里面再调用populateBean开始加载属性BB还需要再加载A属性Debug前的设置Tomcat设置准备好源码文件,Debug的时候会需要。三级缓存解决方法总结refresh方法preInstantiateSingletons 完成实例化剩余的单例beangetBean 方法doGetBean 超多代码getSingletonDoCreatBeanpopulateBean一级目录二级目录三

2021-06-26 17:13:21 185

原创 Eclipse 导入JAVA Web项目

我是目录Eclipse 导入Web项目导入现存的项目需要修改的配置Java Build PathProject Facets进一步配置其他可能的问题JAVA CompilerXDoclet错误还出现错误Eclipse 导入Web项目只是普通的JAVA web,不包含Maven等构建系统的项目导入现存的项目选择对应项目目录需要修改的配置Java Build Path确保JDK和Tomacat正确配置Project Facets刚刚导入的项目可能如下图,我们需要勾选红色的框图,其中的

2021-06-24 17:01:30 199 1

原创 PAT甲级:1037 Magic Coupon (25分) 考察英语的“简单题”

1037 Magic Coupon (25分)The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a product, you may get N times the value of that product back! What is more, the shop also

2020-08-30 16:43:42 101

原创 PAT甲级:1071 Speech Patterns (25分) map unordered_map使用

1071 Speech Patterns (25分)People often have a preference among synonyms of the same word. For example, some may prefer “the police”, while others may prefer “the cops”. Analyzing such patterns can help to narrow down a speaker’s identity, which is useful

2020-08-29 17:30:12 81

原创 PAT甲级:1124 Raffle for Weibo Followers (20分) 字符串去重

1124 Raffle for Weibo Followers (20分)John 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 who forwarded his post, and give away gifts. Now yo

2020-08-29 09:42:28 125

原创 NodeMcu---Arduino学习-最终实现远程启动台式机

233准备工作硬件软件硬件介绍ESP8266、ESP12F、NodeMcuNodeMcu 硬件参数引脚定义NodeMcu的基本参数NodeMcu 按钮和LED灯Arduino环境配置Arduino 基本入门开始使用NodeMcu进入实战前的模拟尝试使用三极管使用点灯科技的库开机部分实现添加开机状态监控准备工作硬件那个CD4066的开关可以不买,面包板插不上。。。我犯傻了软件电脑上Arduino 的IDE,我用的1.8.14点灯科技的库手机上就是点灯的APP硬件介绍ESP8266、

2020-08-05 11:51:13 1885 2

转载 转载Javascript的new this prototype

Javascript构造函数与prototype构造函数构造函数的缺点prototype的引入Prototype模式的验证方法构造函数构造函数的缺点prototype的引入Prototype模式的验证方法构造函数在Javascript语言中,new命令后面跟的不是类,而是构造函数(constructor)。构造函数理解: 所谓"构造函数",其实就是一个普通函数,但是内部使用了this变量。对构造函数使用new运算符,就能生成实例,并且this变量会绑定在实例对象上。比如,猫的原型对象可以

2020-08-01 15:48:23 78 1

原创 人工智能-五子棋

代码主要参考了 五子棋 由于是Javascript版本,我对Javascript语法都忘记的差不多了,就刚好从新复习下吧第三个版本先从简单的第一个版本来HTML分析<!DOCTYPE html><html><head> <meta charset="utf-8" /> <meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale

2020-07-22 11:10:24 1456

原创 人工智能-三连子游戏设计和实现

这算是我编写的第一个带点智能的程序了,虽然学编程这么久了。。。。。。本篇文章就是记录一个三连子游戏的理论、设计、实现的全部过程和思路,(五子棋 四连子 井字棋都差不多,三连子更简单一点,方便理解)理论我是最开始是通过人工智能 一种现代的方法第三版 这本书接触到这方面的知识的,然而书上讲解的不甚详细,还参考了网络上其他讲解这部分理论的文章其他写的比较好的文章汇总:五子棋入门级AI的设计与实现博弈游戏的AI设计(一):极大极小树五子棋AI算法第四篇-启发式搜索函数我总结下来就是极大极小值算法通过

2020-07-18 18:27:54 834

原创 关于台式机不带休眠的问题 有可能是主板设置问题 以及 铭瑄刷BIOS fpart.txt找不到问题

我用的铭瑄的出名矿版B85 BTC(默认就是集显输出,我真是活久见,独显还得设置BIOS primary dispalaly)如何设置都没有休眠按钮,然后锁定是BIOS问题,看到有的人说是BIOS 中ACPI 状态找找,发现只有S1 ,无奈了,先刷个BIOS,(如果报错fpart.txt 把U盘弄成一个分区,其他硬盘都别插) 死马当活马医了,结果就有休眠了。。。。。。。。。...

2020-07-04 10:33:39 2412

原创 PAT甲级1121 Damn Single (25分) 简单题,注意输出就好

1121 Damn Single (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 taken care of.Input Specification:Each input file contains one test case. For

2020-06-19 20:11:56 244

原创 PAT甲级1108 Finding Average (20分) sscanf sprintf****

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 number in [−1000,1000] and i

2020-06-15 09:08:51 142

原创 PAT甲级1144 The Missing Number (20分) 简单题

1144 The Missing Number (20分)Given 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 case, the first line gives a positive integer N (≤10

2020-06-14 20:39:59 150

原创 PAT甲级1145 Hashing - Average Search Time (25分) 平方探测法

注意:这里说了探测只有正的探测,然后使用平方探测法、进行插入时,i的最大值为size(table)-1 (也有部分说是size(table)/2,这里倒是都能过了PAT的测试点);使用平方探测法进行查找时,i的最大值为size(table), 否则你凑不出4个数字的查找需要进行11次。。。。关于平方探测法,看到了一篇文章写得不错,也有关于一般质数表长,一半空白必可插入的证明,感觉选择质数的表长是为了方便在mod后得到唯一值https://www.cnblogs.com/hongshijie/ar..

2020-06-14 08:11:47 184

原创 PAT甲级1112 Stucked Keyboard (20分) 测试点3,小细节多点

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 resulting string on screen, you are

2020-06-09 11:37:36 426

原创 PAT甲级1105 Spiral Matrix (25分) 测试点分析 旋转填充矩阵,做过很多次了

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 upper-left corner, then move in a clockwise spiral. The matrix

2020-06-08 20:24:15 477

原创 PAT甲级1095 Cars on Campus (30分) 繁琐

1095 Cars on Campus (30分)Zhejiang University has 8 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers of the cars crossing the gate. Now with all the information available, you are supposed to tell, at any sp

2020-06-07 22:47:44 143

原创 PAT甲级1096 Consecutive Factors (20分) ****不算简单的题 ,测试点1分析,因式分解

1096 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 5, 6, and 7 are the three consecutive numbers. Now given any positive N, you are s

2020-06-06 17:13:12 403

原创 PAT甲级1049 Counting Ones (30分) ***感觉不简单,使用递归

1049 Counting Ones (30分)The task is simple: given any positive integer N, you are supposed to count the total number of 1’s in the decimal form of the integers from 1 to N. For example, given N being 12, there are five 1’s in 1, 10, 11, and 12.Input Spec

2020-06-05 23:50:48 177 1

原创 PAT甲级1103 Integer Factorization (30分) ***** 有难度 测试点2分析, 递归写的再规范点

题目倒是好读懂,关键是如何构建这个等式,我没想到太好的办法,就是准备用深搜试试,题目给出的N最大也就400,最初感觉良好,结果还是为了时间优化了好久。用深搜的话,最直观的思路是对每个子式的所有可能都遍历一遍(所有可能的是指从1 到maxLimit=pow(N,(double)1/P); N开P次方) ,样例中的169 开2次方是12,169应该是由几个小于等于12的数的二次方相加构成的。如果按照K个位置,每个位置从1到maxLimit 深搜的话时间会爆炸,有测试点过不了。然后想办法优化,我们不从...

2020-06-03 21:58:01 705

原创 PAT甲级1152 Google Recruitment (20分) 素数判断

1152 Google Recruitment (20分)In July 2004, Google posted on a giant billboard along Highway 101 in Silicon Valley (shown in the picture below) for recruitment. The content is super-simple, a URL consisting of the first 10-digit prime found in consecutive

2020-06-03 08:03:28 165

原创 PAT甲级1150 Travelling Salesman Problem (25分) 模拟的简单题

1150 Travelling Salesman Problem (25分)The “travelling salesman problem” asks the following question: “Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city and returns to the origin

2020-06-03 07:27:28 189

原创 PAT甲级1109 Group Photo (25分) 和乙级的1055 集体照 (25分) 模拟,稍微麻烦点

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), with all the extra people (if

2020-06-02 17:44:16 148

原创 PAT甲级1134 Vertex Cover (25分) 英语捉急。。。。 优化时间

1134 Vertex Cover (25分)A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at least one vertex of the set. Now given a graph with several vertex sets, you are supposed to tell if each of them is a vertex cover or

2020-06-02 09:18:08 90

原创 PAT甲级1142 Maximal Clique (25分) 英文阅读........

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 adjacent vertex. (Quoted from htt

2020-06-02 08:08:33 108

原创 PAT甲级1147 Heaps (30分) 层数遍历快速构建二叉树,深搜判断大堆 小堆

1147 Heaps (30分)In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either greater than or equal to (in a max heap) or less than or equal to

2020-06-01 21:42:53 227

原创 PAT甲级1133 Splitting A Linked List (25分) 简单题 ,list删除

1133 Splitting A Linked List (25分)Given a singly linked list, you are supposed to rearrange its elements so that all the negative values appear before all of the non-negatives, and all the values in [0, K] appear before all those greater than K. The order

2020-06-01 17:06:59 202

原创 PAT甲级 1130 Infix Expression (25分) 测试点2,中序遍历添加额外条件

1130 Infix Expression (25分)Given a syntax tree (binary), you are supposed to output the corresponding infix expression, with parentheses reflecting the precedences of the operators.Input Specification:Each input file contains one test case. For each cas

2020-06-01 12:25:15 195

原创 PAT甲级1148 Werewolf - Simple Version (20分) 和乙级狼人杀-简单版(20 分) 关键是思考切入的角度

1148 Werewolf - Simple Version (20分)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 #2 is a werewolf.”;player #2 said: “Player #3 is a hum

2020-06-01 10:26:50 181

原创 PAT甲级1149 Dangerous Goods Packaging (25分) 和乙级1090 危险品装箱 (25分) 尽力简化思路减少时间

1149 Dangerous Goods Packaging (25分)When shipping goods with containers, we have to be careful not to pack some incompatible goods into the same container, or we might get ourselves in serious trouble. For example, oxidizing agent (氧化剂) must not be packed

2020-06-01 07:17:27 108

原创 PAT甲级1128 N Queens Puzzle (20分) 判重

Sample Input:48 4 6 8 2 7 1 3 59 4 6 7 2 8 1 9 5 36 1 5 2 6 4 35 1 3 5 2 4Sample Output:YESNONOYES就是皇后问题判重,判断行重复 对角线重复就好,我写代码时候写多了个判断列重复,题目已经很明确说了列不会重复。注意的点有题目给的位置标示好难受,从左下角数,我还是变成了左上角开始的数组然后关于对角重复判断,直接行标-列标就能得到一个 对角元素都一样的值,比如从主对角线的元素 行标...

2020-05-31 16:42:32 197

原创 PAT甲级1114 Family Property (25分) 题不难,麻烦点 ,并查集变形, map 我是左箭头 int,node 我是右箭头 mapp

Sample Input:106666 5551 5552 1 7777 1 1001234 5678 9012 1 0002 2 3008888 -1 -1 0 1 10002468 0001 0004 1 2222 1 5007777 6666 -1 0 2 3003721 -1 -1 1 2333 2 1509012 -1 -1 3 1236 1235 1234 1 1001235 5678 9012 0 1 502222 1236 2468 2 6661 6662 1 300.

2020-05-31 12:14:36 158

原创 PAT甲级1140 Look-and-say Sequence (20分) 模拟

1140 Look-and-say Sequence (20分)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 of description of the nth number. For example, the 2nd n

2020-05-30 17:46:45 126

原创 PAT甲级1125 Chain the Ropes (25分) 简单题,但是实现时候需要注意点

1125 Chain the Ropes (25分)Given some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments into loops and chain them into one piece, as shown by the figure. The resulting chain will be treated as another

2020-05-30 17:04:46 172

原创 PAT甲级1116 Come on! Lets C (20分) prime素数

1116 Come on! Let’s C (20分)“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 award rules are funny as the following:0、 The Champ

2020-05-30 16:58:54 189

原创 PAT甲级1104 Sum of Number Segments (20分) 测试点2感觉不太对,两位数字不同加法有区别

1104 Sum of Number Segments (20分)Given 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.1) (0.1, 0.2) (0.1, 0.2, 0.3) (0.1, 0.2, 0.3, 0.4)

2020-05-30 11:50:24 979

原创 PAT甲级1138 Postorder Traversal (25分) 前序 中序 转换后序

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 sequence of the correspondi

2020-05-30 10:09:21 138

java8_32.zip

JAVA8_32版,解压完配置下环境就好

2020-08-07

数字电子技术第二版 侯建军 完整版

数字电子技术第二版 侯建军 完整版 不是课后答案网那个残缺

2015-11-09

空空如也

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

TA关注的人

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