自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 基于深度学习的心律异常分类算法

神经元是神经网络的基础操作单元。它接受外部或内部的信息,并经过加工后输出。每一个输入都有一个对应的权值,该权值反映了输入之间的重要程度。yf∑i1nωiai−byf∑i1n​ωi​ai​−b其中,aia_iai​是第i个元素信息的输入,ωi\omega_iωi​是当前神经元与下一个神经元之间的权重,b\ bb为偏置,ff()f是激活函数,yyy为输出。

2024-03-21 16:26:00 1253

原创 PTA——1075 链表元素分类、1105 链表合并、1110 区块反转

这三道题换汤不换药,总结下来就是首先利用结构体存储节点,利用map存储地址,将地址下标映射到结点。然后用利用头结点的地址将链表串起来,存进vector中,这里每个节点的前后关系就是他们在数组中的位置。所以存进vector时不用考虑结点的next值了,这只在得到链表时有用。最后根据题意按照输出次序将结点存进另一个vector中,由于链表中结点前后关系就是链表的关系,因此遍历这个vector即可,遍历即按照链表顺序输出。

2024-03-20 21:04:35 210

原创 PTA——1090 危险品装箱(含超时分析)、1065 单身狗

这两题很像,这一题是1065题的升级版。1065单身狗是两两配对不重复的,即文意“不会脚踏两只船”。本题是相当于哈希表链式存储,一个人可以同时和多个人配对。解题方法是一样的,创建is数组,如果来客有配对就将其配对在is数组中赋值为1。原因是vector(N)会产生更多的缓存未命中,而map使用更少的内存,会显著提高命中率。本题不可用并查集做,因为1和3配对,3和5配对但不代表1和5是一对。存储,耗时大大下降,节省3/4的时间,代码上不需有任何的改动。,则说明与他配对的人来过,即他俩同时出现,输出No。

2024-03-15 18:20:49 367 1

原创 PTA——1041 考试座位号、1042 字符统计、1043 输出PATest、1044 火星数字

利用哈希表,最后按照PATest顺序输出,只要这几个字符的哈希值不为0,就循环输出,谁先到0了谁停止输出。处理起来有点麻烦,注意进制转换的经典例子:130转换为13进制,应该为oct而没有后面的0(tret)。利用哈希表,最后输出字母即可。利用哈希表整合信息输出即可。

2023-03-29 21:18:49 230 1

原创 PTA——1036 跟奥巴马一起编程、1037 在霍格沃茨找零钱、1038 统计同成绩学生、1039 到底买不买、1040 有几个PAT

遇到P就nump++,直到遇到A,A字符前面P的个数和后面T的个数的乘积即为这个A所在的PAT串的个数,将其取模累加。先统计整个串中T的个数numt,随后遍历整个串,遇到T就numt–,此时numt代表串后面的t的个数。利用两个哈希表,先统计摊主的珠子个数,再利用unordered_map统计小红的珠子种类以及个数。如果结果为非正数,则说明不缺少,输出摊主珠子个数 — 小红珠子个数 即为多余的珠子个数。接着对于小红的每种珠子,利用sum累计比摊主多了多少个(即为缺了珠子)。参考了柳神的代码,大佬太强了。

2023-03-29 18:44:45 351

原创 PTA——1031 查验身份证、1032 挖掘机技术哪家强、1033 旧键盘打字

注意英文字母的坏键用大写字母给出。因为可能有空白字符串,所以要使用。使用哈希表解决很方便高效。函数接收一行中内容。

2023-03-26 21:25:35 204

原创 PTA——1029 旧键盘、1030 完美数列

哈希解决非常方便,用字符的ASCII码值作为key,因为输出大小写不敏感,所以我们在哈希映射之前就把失配的小写字母转化为大写字母,哈希映射并压入输出数组out。最后一个测试点不通过是因为我这样写有一种可能b与a的匹配部分全部相等,而这种情况a的b没匹配到的后面部分直接处理并哈希映射即可,因为他们全部失配。,去计算前一个位置一定满足条件的长度。但是如果序列到最后一个位置都不满足这个条件,则len永远不会更新,导致WA。,下次直接从已找到序列的下一个位置开始枚举即可。我最开始写错了,将更新条件设置为了。

2023-03-25 21:19:20 139

原创 PTA——1027 打印沙漏、1028 人口普查

考察解决问题的能力,我先用了一个打表,将1、1+3x2、1+3x2+5x2也就是沙漏的形状打表,随后由输入数据判定应该属于哪一个表。首先输出剩余的没用到的符号数,f代表第i个奇数,也就是那个表的最高(低)一层的奇数,用p求出第i个奇数的值应该是2*i-1;还是考察解决问题的能力,如果先算出每个人的岁数来就太麻烦了,正解就是直接比较年月日,最后需要做有效年龄为0的特判。随后分层处理,分为上沙漏和下沙漏,注意细节即可。每行的末尾按照标准格式并没有空格,输入空格会提示格式错误。

2023-03-24 10:53:19 136

原创 PTA——1025 反转链表、1026 程序运行时间

1.首先,我没有审清题目,地址为五位数,所以可以用int储存,从而可以用数组索引当做链表地址把链表串起来。我一开始用的str,到分离出链表这一步只能够每次迭代n个结点,TLE测试点5超时。2.我再次没有审清题目,题目说的是每k个结点翻转一次,而不是前k个,不能好像看懂了样例就开写,应该仔细审题。不能写成>0.4了,因为[0.4,0.5)之间的值也是4舍的部分。

2023-03-20 21:19:12 159

原创 PTA——1024 科学计数法

写了好久,通过这道题,提取数据层数越多,也就是设置的中间变量越多,最后的错误越难以检查,应该认清问题的本质,用少的变量分出最有用的数据,错误也方便检查。

2023-03-19 21:11:20 151

原创 PTA——1021 个位数统计、1022 D进制的A+B、1023 组个最小数

注意一下num数组中的数不一定是十个就好了。模拟一遍进制转换即可。

2023-03-19 19:41:00 58

原创 PTA——1019 数字黑洞、1020 月饼

最后发现是理解题目的问题,背景介绍说给定任意4位正整数,我就以为是前面默认补0了,例如:0001,0099,0989等等,但其实还要看题目的输入格式,说给出一个正整数,正整数当然就是Z*输入:1,99,989了,所以要在输入后自己补一波0。1.相减过程中有可能出现不到四位数的数,那么转换成字符串就会少了开头的若干个‘0’,从而WA;这个我是在做题过程中发现了的,但修正后2、3、4测试点仍然不过。注意数量和单价都是正数,也就是说R*,不一定是正整数Z*就好。

2023-03-17 18:03:17 140 1

原创 PTA——1015 德才论、1018 锤子剪刀布

遇到问题:error: C++ requires a type specifier for all declarations,原来是结构体的成员函数忘记带上返回值类型了,C++还是严谨。但是实战操作如果要用泛型容器map,自动排序是不稳定的排序,所以自己写一个哈希表,一个哈希映射函数会比较方便。这道题思路是很简单的,做一个哈希映射结果就出来了,如果口述的话很简单。这道题算法全在cmp()函数上,如果只能用C语言那就麻烦太多了。

2023-03-17 16:18:59 135

原创 PTA——1012-数字分类、1014-福尔摩斯的约会

C++解题还是要比C语言方便很多,在于C++的STL有丰富的泛型容器和算法。

2023-03-15 20:49:50 85

原创 PTA-最短路径(1003/1018/1030/1072/1087)

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 in each city and the length of each road between any pai

2022-03-04 19:24:35 830

原创 通过四道编程题总结图的搜索(DFS/BFS)——PTA(1013/1021/1034/1076)

1013 Battle Over Cities (25 分)It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we need to repair any other hig

2022-02-28 01:19:45 559

原创 PTA-链表处理(1074/1032/1052/1097)

1074 Reversing Linked List (25 分)Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, if K=3, then you must output 3→2→1→6→5→4; if K=4, you must output 4→3→2

2022-02-24 11:31:41 690

原创 PTA-平衡二叉树(1066)

1066 Root of AVL Tree (25 分)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 done to restore this prope

2022-02-07 12:00:35 403

原创 PTA-二叉查找树(1043/1064/1099)

1043 Is It a Binary Search Tree (25 分)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 the node’s key.The right subtree of a node co.

2022-02-06 18:42:14 808

原创 PTA-树的遍历(1079/1090/1094/1106/1004/1053)

1079 Total Sales of Supply Chain (25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on the chain buys pro.

2022-01-22 15:45:35 924

原创 PTA-二叉树的遍历(1020/1086/1102)

1020 Tree Traversals (25 分)Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the corresponding binary tree.Inpu

2022-01-19 15:56:01 1340

原创 PTA-BFS(1091)

1091 Acute Stroke (30 分)One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions are identified in each MRI slice, your job is to calculate the volume of the stro

2022-01-16 11:10:07 332

原创 PTA-链表处理(1074)

1074 Reversing Linked List (25 分)Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, if K=3, then you must output 3→2→1→6→5→4; if K=4, you must output 4→3→2

2022-01-15 20:57:36 257

原创 PTA-DFS(1103)

1103 Integer Factorization (30 分)The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program to find the K−P factorization of N for any positive integers N, K and P.

2022-01-15 18:09:40 310

原创 PTA-queue(1056)

1056 Mice and Rice (25 分)Mice and Rice is the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given map. The goal of each mouse is to eat as much rice as possible in order to beco.

2022-01-14 12:04:33 211

原创 PTA-stack(1051)

1051 Pop Sequence (25 分)Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, …, N and pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequence of the stack. For example, if M is 5.

2022-01-12 17:13:33 492

原创 PTA-map(1100/1054/1071/1022)

1100 Mars Numbers (20 分)People on Mars count their numbers with base 13:Zero on Earth is called “tret” on Mars.The numbers 1 to 12 on Earth is called “jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec” on Mars, respectively.For the next highe.

2022-01-12 11:39:18 355

原创 PTA-string(1060)

Are They Equal (25 分)If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123×10 5with simple chopping. Now given the number of significant digits on a machine and two fl.

2022-01-11 10:41:22 350

原创 PTA-set(1063)

1063 Set Similarity (25 分)Given two sets of integers, the similarity of the sets is defined to be Nc/Nt×100%, where N cis the number of distinct common numbers shared by the two sets, and N tis the total number of distinct numbers in the two sets. Your j.

2022-01-10 18:34:31 370

原创 PTA-vector(1047/1039)

1047 Student List for Course (25 分)Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses.Input Specification:Each i.

2022-01-10 16:43:34 499

原创 PTA-双指针(1029/1044)

双指针系列两道题总结分析

2021-12-29 00:47:18 245 1

原创 为虚拟机启用本地共享文件夹步骤图文详述

为虚拟机挂载本地共享文件夹的具体方法步骤

2021-12-25 21:49:37 8226 3

原创 多乐影视电影网站开发——HTML+CSS+JavaScript+PHP

多乐影视电影网站开发,改编自模板,主要编写后台逻辑以及模板内容的扩充。

2021-12-19 16:13:11 5820

原创 Java结合JDBC及IO流综合练习

MySQL表的结构-- ------------------------------ Table structure for user_info-- ----------------------------DROP TABLE IF EXISTS `user_info`;CREATE TABLE `user_info` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) NOT NULL COMMENT '用户名'

2021-11-29 15:07:54 705 1

原创 PHP利用会话技术和数据库综合练习

数据库表的设计:-- ------------------------------ Table structure for user_s-- ----------------------------DROP TABLE IF EXISTS `user_s`;CREATE TABLE `user_s` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) NOT NULL, `pwd` varchar(255)

2021-11-21 08:50:29 475 1

原创 Java连接MySQL实现登录及多表查询

MySQL表的结构及数据表customer(客户信息表)表dict(数据字典表)表user(用户信息表,用于登录及注册)create table customer(id int(32) auto_increment primary key,cust_name varchar(50) null comment '客户姓名',cust_source int(32) null comment '客户来源',cust_industry int(32) null comment '客户所属行业

2021-11-19 08:30:06 955 1

原创 操作系统实验:Linux下的进程控制实验

进程控制实验一、实验目的:二、实验平台:三、实验内容:1.进程的创建与销毁进程控制相关函数实验结果分析2.多进程并发执行time命令实验结果分析四、总结分析一、实验目的:加深对进程概念的理解,明确进程和程序的区别;掌握Linux操作系统的进程创建和终止操作,体会父进程和子进程的关系及进程状态的变化;进一步认识并发执行的实质,编写并发程序。二、实验平台:虚拟机:VMWare15.5.1操作系统:CentOS7 64位编辑器:Vim编译器:Gcc三、实验内容:1.进程的创建与销毁编写一段程序

2021-11-04 21:11:12 12693

原创 PHP访问MySql实现用户注册查询

静态网页如图,依次添加控件如图所示。<form name="myform" method="post"><table align="center"><caption align="top"><font size=5>用户注册</font></caption><tr><td>用户名:<input type="text" name="Array[username]"></td>&.

2021-11-01 21:20:05 178 2

原创 PHP实现用文件记录注册用户信息

编写页面post.php,包含注册表单运行效果如图所示。<html><form name="myform" method="post"><table align="center"><tr><td>用户名:</td><td><input type="text" name="Array[username]"></td></tr><tr><td align=.

2021-10-31 19:59:18 315

原创 Java使用Arrays.sort()对数组类型排序

对基本类型数组进行排序int[] e= {7,1,2,6};Arrays.sort(e);for(int a:e) { System.out.print(a+" ");}output:1 2 6 7实现了对基本类型数组的自然序列排序(升序)。如果要实现降序排序,则要使用包装类:Integer[] integers=new Integer[] {4,8,12,30};Arrays.sort(integers,new Comparator<Integer>(){ @Overr

2021-10-28 09:36:40 835

HTML+CSS+JS+PHP多乐影视电影网站开发及数据库表结构源码

HTML+CSS+JS+PHP多乐影视电影网站开发及数据库表结构源码

2021-12-19

C++基于MFC课程设计——学习公社

内置学习公社项目(vs2019)以及所用MySQL数据库结构及数据

2021-06-25

最小生成树算法及实例.zip

最小生成树算法及实例.zip

2021-05-14

C++基于MFC编程-课程管理系统

内置课程管理系统项目(vs2012)以及所用MySQL数据库结构及数据

2020-12-23

空空如也

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

TA关注的人

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