E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
PAT-甲级
PAT-
人口普查 测试点0
测试点0是第一个输入就不合法如果一开始无脑让old和young指向第一个接下来的判断就会出错推荐解法:https://blog.csdn.net/daniel960601/article/details/55261196#includestruct{charname[6];intyear,mon,day;}temp,old,young;intmain(){intn,count=0,sum,olds
Ethan Wilson
·
2020-08-04 17:47
C语言
PAT
PAT
甲级
供应商问题 1079 1090 1106
供应商问题(dfs)1079TotalSalesofSupplyChain(25分)题目描述Asupplychainisanetworkofretailers(零售商),distributors(经销商),andsuppliers(供应商)--everyoneinvolvedinmovingaproductfromsuppliertocustomer.Startingfromonerootsupp
October's very own
·
2020-08-04 17:15
PAT
树结构
dfs
PAT
甲级
1052
1052.LinkedListSorting(25)时间限制400ms内存限制65536kB代码长度限制16000B判题程序Standard作者CHEN,YueAlinkedlistconsistsofaseriesofstructures,whicharenotnecessarilyadjacentinmemory.Weassumethateachstructurecontainsaninteg
strivinging
·
2020-08-04 16:05
PAT
Digital Library (30)-PAT
甲级
1022.DigitalLibrary(30)ADigitalLibrarycontainsmillionsofbooks,storedaccordingtotheirtitles,authors,keywordsoftheirabstracts,publishers,andpublishedyears.Eachbookisassignedanunique7-digitnumberasitsID.
柳婼
·
2020-08-04 15:53
PAT
Digital Library (30)-PAT
甲级
真题(map映射)
ADigitalLibrarycontainsmillionsofbooks,storedaccordingtotheirtitles,authors,keywordsoftheirabstracts,publishers,andpublishedyears.Eachbookisassignedanunique7-digitnumberasitsID.Givenanyqueryfromareade
柳婼
·
2020-08-04 15:53
PAT
PAT
Reversing Linked List (25)-PAT
甲级
真题
GivenaconstantKandasinglylinkedlistL,youaresupposedtoreversethelinksofeveryKelementsonL.Forexample,givenLbeing1→2→3→4→5→6,ifK=3,thenyoumustoutput3→2→1→6→5→4;ifK=4,youmustoutput4→3→2→1→5→6.InputSpecifi
柳婼
·
2020-08-04 15:22
PAT
1022 Digital Library (30 分)--PAT
甲级
1022DigitalLibrary(30分)ADigitalLibrarycontainsmillionsofbooks,storedaccordingtotheirtitles,authors,keywordsoftheirabstracts,publishers,andpublishedyears.Eachbookisassignedanunique7-digitnumberasitsID.
NullObjectError
·
2020-08-04 15:24
PAT
【PAT
甲级
】1074. Reversing Linked List (25)
直接用一个矩阵order存储节点地址,再这个矩阵上进行翻转,不知道算不算投机取巧#include#includeusingnamespacestd;structNode{inte;intnext;};Nodelist[100000];voidswap(int*a,inti,intj);intmain(){intstart,len,k;cin>>start>>len>>k;for(inti=0;i>
lambsnow
·
2020-08-04 15:46
PAT
【算法每日一练】PAT
甲级
1052 java
Alinkedlistconsistsofaseriesofstructures,whicharenotnecessarilyadjacentinmemory.WeassumethateachstructurecontainsanintegerkeyandaNextpointertothenextstructure.Nowgivenalinkedlist,youaresupposedtosortt
梓莘
·
2020-08-04 13:59
算法每日一练
浙大PAT
甲级
-1022
关键点:(1)cin输入并没有将换行符输入所以后面如果紧接着getline(cin,str)需先输入完换行符(2)ID打印注意前面补零(%07d)(否则后面两个测试点过不去)#include#include#include#include#includeusingnamespacestd;structbook{intid;stringtitle;stringauthor;vectorkeyword
zbyue_
·
2020-08-04 12:21
浙大PAT甲级练习题
PAT-2019年春季考试-
甲级
-Structure of a Binary Tree
7-4StructureofaBinaryTree(30分)作者:陈越单位:浙江大学时间限制:400ms内存限制:64MB代码长度限制:16KBSupposethatallthekeysinabinarytreearedistinctpositiveintegers.Giventhepostorderandinordertraversalsequences,abinarytreecanbeuniq
yyy_3y
·
2020-08-04 09:58
pat
PAT练习
最近在准备PTA
甲级
,顺便记录一下坑(PAT的坑真的无fuck可说,数据范围也不给,题意又。。。。)
O_o勋
·
2020-08-04 09:06
刷题记录
PAT程序设计考题——
甲级
1004 遍历树节点(计算树每层的叶子节点数目)
试题链接如下:点击打开链接试题要求翻译如下:程序输入:第一行输入为树总节点个数N(#include#includetypedefstructTreeNode{charvalue;TreeNode**childList;intchildCapacity;intchildNumber;TreeNode(charvalue){childNumber=0;childCapacity=5;this->val
爆豆
·
2020-08-04 08:11
C++
PAT程序设计能力考试
PAT
甲级
1021 Deepest Root dfs求连通分量+找出树的最大高度结点
思路:这道题给出一个无向图,该图有n个结点和n-1条边,若图是连通图,则它一定是一棵树,那么我们就要求出树的每个结点的高度,找出高度最大的所有结点,把结点序号依次输出;若图不是连通图,我们就要求出其连通分量的个数cnt并输出。我们先用一次dfs找到从任意一个结点开始搜索到的最大高度的结点(可能不唯一,不过对结果没有影响),把这些结点放入集合set中,并从这个结点开始再进行一次dfs,再把高度最大的
化身孤岛的鲸o
·
2020-08-04 07:37
PAT
DFS
图的遍历
PAT
甲级
技巧总结(一)
编程思路、技巧总结1.判断堆是大顶堆还是小顶堆2.深度遍历堆3.判断是否为素数4.最低公共祖先5.判断环和简单路径(环)6.完全二叉树叶子结点、非叶子结点个数7.完全二叉树层次遍历——堆,判断是大顶堆还是小顶堆的第二种方法8.测试序列是否为拓扑序列9.哈希表1.判断堆是大顶堆还是小顶堆inta[1009],isMin=1,isMax=1;//数组a存储堆(完全二叉树),第一个节点的索引为1//is
星殇丶
·
2020-08-03 08:51
PAT甲级刷题经验总结
PAT
甲级
技巧总结(二)
编程思路、技巧总结1.排序思想总结2.使用哈希表代替邻接表3.判断回文串4.将两个相同位数的字符串作为数字进行相加5.链表问题6.异常7.根结点8.对结构体进行排序1.排序思想总结最终呈现一个数据及其多个属性的时候可以考虑每个属性使用一个map(或unordered_map)来存储。最后对所有数据进行一次顺序排序:vectorans;intrank=0,pres=-1;//rank用于标识序号,p
星殇丶
·
2020-08-03 08:51
PAT甲级刷题经验总结
PAT
甲级
1002 A+B for Polynomials (25分)(一堆坑)
Thistime,youaresupposedtofindA+BwhereAandBaretwopolynomials.InputSpecification:Eachinputfilecontainsonetestcase.Eachcaseoccupies2lines,andeachlinecontainstheinformationofapolynomial:KN1aN1N2aN2…NKaNKw
Fmm-PMO
·
2020-08-03 08:12
PAT甲级
PAT
甲级
刷题记录——1002 A+B for Polynomials (25分)
Thistime,youaresupposedtofindA+BwhereAandBaretwopolynomials.InputSpecification:Eachinputfilecontainsonetestcase.Eachcaseoccupies2lines,andeachlinecontainstheinformationofapolynomial:KN1aN1N2aN2…NKaNKw
囷囷
·
2020-08-03 07:53
PAT甲级
PAT (Advanced Level) Practice---
甲级
刷题---题解(1001~1115)
目录备用知识点梳理:具体题目(1001~1115)如下:1001A+BFormat(20分)1002A+BforPolynomials(25分)备用知识点梳理:具体题目(1001~1115)如下:1001A+BFormat(20分)题目链接:Calculatea+bandoutputthesuminstandardformat--thatis,thedigitsmustbeseparatedint
DNMTOOBA
·
2020-08-02 21:53
PAT
算法
【PAT
甲级
】1002 A+B for Polynomials (25分)
1002A+BforPolynomials(25分)Thistime,youaresupposedtofindA+BwhereAandBaretwopolynomials.InputSpecification:Eachinputfilecontainsonetestcase.Eachcaseoccupies2lines,andeachlinecontainstheinformationofapol
韩旭051
·
2020-08-02 20:36
PAT甲级练习题
PAT_乙级_1042
PAT-
乙级1042问题描述请编写程序,找出一段给定文字中出现最频繁的那个英文字母。输入格式:输入在一行中给出一个长度不超过1000的字符串。
NoNameMing
·
2020-08-02 18:18
PAT乙级
如何刷PTA,达到PTA
甲级
、乙级、顶级应具备的能力
甲级
(Ad
桥桉
·
2020-08-02 14:01
PTA
拜托,成年人不要总讲给我点支持,好不?
记得刚上班那几年在CBD一栋很高级的
甲级
写字楼办公,楼下底商大部分是银行和快餐店。每当中午饭后,我喜欢在楼里简单溜达一会,消化餐食也顺便买点零食。
溪水边的白桦林
·
2020-08-01 14:03
谁能兼顾事业与家庭?你兼一个我看看
她现在是一个让人羡慕的职场白领,每天神采奕奕的穿着职业套装坐在
甲级
写字楼里办公,透过办公室窗户就能将外滩风光收入眼底。不仅在职场风光无限,她儿子教育也是让人津津乐道。
叶加兰兰
·
2020-08-01 06:12
pta
甲级
1145 Hashing - Average Search Time (25分)
链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805343236767744题意:散列表,处理冲突用平方探测(只取正值)。输出平均查找次数。思路:关键就在于这个,平均查找次数。如果平方探测该位置没有值或者探测到TableSize-1,退出。#include#definelllonglongusingnamespac
Qingo呀
·
2020-07-31 16:02
=====PTA=====
pta
甲级
1105 Spiral Matrix (25分)
链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805363117768704题意:给你N个数,将其放入非递增的螺旋矩阵中,矩阵大小为m*n,要求:1)N=m*n2)m>=n3)m-n最小思路:按照走路+转向的思路,当碰壁(超出矩阵范围或已有值)就顺时针转向。#include#definelllonglongusin
Qingo呀
·
2020-07-31 16:01
=====PTA=====
pta
甲级
1119 Pre- and Post-order Traversals (30分)
链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805353470869504题意:给出二叉树的前序、后序遍历序列,能否唯一确定一棵树?输出中序遍历序列。思路:能否确定一棵树关键在于是否有只有一个孩子的节点。如果有,那么就无法确定唯一的树。至于怎么确定中序遍历序列,可以先根据后序序列确定右孩子,通过前序序列确定左右子
Qingo呀
·
2020-07-31 16:01
=====PTA=====
济南西客站☞宽厚里☜
项目业态涵盖地标双子塔、5A
甲级
写字楼、独栋商业、高端公寓。其中6栋
甲级
写字楼和4栋公寓楼,被槐荫区政府花巨资直接收购,总投入39亿。所以项目是政府重点扶持项目!而且统一管理统一运行。图片发自App图
CharlesofValois
·
2020-07-31 11:05
所有的程序员都是自学成才
在我十几岁的时候就开始玩
甲级
级棒球。我水平很差,但当我决定要做好什么事时,最终总能如我愿。现在我是计算机专业3年纪的学生。
白如白牙
·
2020-07-30 16:35
2020春季(7月)PAT
甲级
考试题解
2020春季(7月)PAT
甲级
考试题解7-1PrimeDay(20分)TheabovepictureisfromSinaWeibo,showingMay23rd,2019asaverycool“PrimeDay
FWFJH
·
2020-07-30 13:15
2020年7月 pat
甲级
第二题
7-2TheJudger(25分)Agameofnumbershasthefollowingrules:atthebeginning,twodistinctpositiveintegersaregivenbythejudge.Theneachplayerinturnmustgiveanumbertothejudge.Thenumbermustbethedifferenceoftwonumberst
诗爷酱
·
2020-07-30 12:57
PAT
甲级
A1075 PAT Judge (25 分)
TheranklistofPATisgeneratedfromthestatuslist,whichshowsthescoresofthesubmissions.ThistimeyouaresupposedtogeneratetheranklistforPAT.InputSpecification:Eachinputfilecontainsonetestcase.Foreachcase,thefi
小·幸·运
·
2020-07-30 12:06
PAT甲级
排序
2020PAT
甲级
春季考试题目及解答
总结:按这个出题的风格,历年的题应该没啥常考价值了,没有模板题,都得靠平时编码积累。7-1PrimeDay(20分)TheabovepictureisfromSinaWeibo,showingMay23rd,2019asaverycool“PrimeDay”.Thatis,notonlythatthecorrespondingnumberofthedate20190523isaprime,buta
Berlin丶
·
2020-07-30 12:54
PAT刷题笔记
PAT
20200725 PAT
甲级
7-2 The Judger (25分)
#include#include#includeusingnamespacestd;intexist[100010]={0},diff[100010]={0};//exist记录已经报过的数,diff记录已经报过的数的差值vectorexists;//exists记录已经报过的数,对于每个新报的数,和每个已存的数相减得差intht[15]={0};inta[1010][1010];intmain(
gingerCat1123
·
2020-07-30 12:42
PAT甲级
pat
甲级
1075 PAT Judge
排序模拟题也算复杂了磕磕绊绊读完题查了两个点没过看了别人的提出的易错点自己也写出来了测试来测试去发现是-1的地方注意点1.题目理解啊,这种模拟题条件读好很重要2.第一个不易懂的地方是排序规则,第一总分优先,第二是满分题数优先,第三是ID从小到大理解有误的地方是第二,一直以为是离满分分差最小优先。。。3.-1的地方首先是如果所有题目全-1或者有没提交过的就不显示。如果0分也要输出0分4.下标问题给数
之井
·
2020-07-30 12:24
pat
2020年7月第3题 PAT
甲级
真题 Safari Park (25分)
Asafaripark(野生动物园)hasKspeciesofanimals,andisdividedintoNregions.Themanagershopetospreadtheanimalstoalltheregions,butnotthesameanimalsinthetwoneighboringregions.Ofcourse,theyalsorealizethatthisisanNPco
浒鱼鱼
·
2020-07-30 11:21
PAT甲级
【PAT
甲级
】排序题专题复习
固定模式要排序的量一般放在一个或多个向量的结构体、unordered_map或者set中,然后定义一个或多个cmp函数。(具体是几个就看题目将排序对象分成几种、有几个判断依据)。坑点1.最好直接用unordered_map代替map,就不会有查询超时2.题目的要求都会有测试点,所以要好好读题,归纳出每种情况,想好再写,代码的复杂度其实不高的普通题库(1001-1136)1012TheBestRan
浒鱼鱼
·
2020-07-30 11:21
PAT甲级
2020年7月第4题 PAT
甲级
真题 Replacement Selection (30分)
Whentheinputismuchtoolargetofitintomemory,wehavetodoexternalsortinginsteadofinternalsorting.Oneofthekeystepsinexternalsortingistogeneratesetsofsortedrecords(alsocalledruns)withlimitedinternalmemory.Th
浒鱼鱼
·
2020-07-30 11:21
PAT甲级
2020年7月第1题 PAT
甲级
真题 Prime Day (20分)
TheabovepictureisfromSinaWeibo,showingMay23rd,2019asaverycool"PrimeDay".Thatis,notonlythatthecorrespondingnumberofthedate20190523isaprime,butallitssub-stringsendedatthelastdigit3areprimenumbers.Nowyou
浒鱼鱼
·
2020-07-30 11:21
PAT甲级
【PAT
甲级
】1129 Recommendation System (25) 优化过的代码很简单
致谢:https://blog.csdn.net/liuchuo/article/details/68912867liuchuo代码的结构体初始化时的构造函数:node(inta,intb):value(a),cnt(b){}可以省略,我作了以下改动,也是满分代码。因为代码很简单,我在注释中注明注意事项。#include#include#includeusingnamespacestd;intbo
浒鱼鱼
·
2020-07-30 11:21
PAT甲级
2019年9月8日秋季PAT
甲级
题解-2-1161-Merging Linked Lists (25 分) 双解法
GiventwosinglylinkedlistsL1=a1→a2→⋯→an−1→anandL2=b1→b2→⋯→bm−1→bm.Ifn≥2m,youaresupposedtoreverseandmergetheshorteroneintothelongeronetoobtainalistlikea1→a2→bm→a3→a4→bm−1⋯.Forexample,givenonelistbeing6→
浒鱼鱼
·
2020-07-30 11:20
PAT甲级
2019年9月8日秋季PAT
甲级
题解-4 Dijkstra Sequence (30 分) 详细分析
Dijkstra'salgorithmisoneoftheveryfamousgreedyalgorithms.Itisusedforsolvingthesinglesourceshortestpathproblemwhichgivestheshortestpathsfromoneparticularsourcevertextoalltheotherverticesofthegivengraph.
浒鱼鱼
·
2020-07-30 11:20
PAT甲级
数据结构
算法
c++
PAT-2019年冬季考试-
甲级
-7-1 Good in C (20分)超详解,几招就满分通过
本题在2021年12月之后才会解封放到免费题库里,目前需要收费。题目:Whenyourinterviewerasksyoutowrite“HelloWorld”usingC,canyoudoasthefollowingfigureshows?InputSpecification:Eachinputfilecontainsonetestcase.Foreachcase,thefirstpartgiv
浒鱼鱼
·
2020-07-30 11:20
PAT甲级
PAT
甲级
1090 Highest Price in Supply Chain
1090HighestPriceinSupplyChain(25point(s))Asupplychainisanetworkofretailers(零售商),distributors(经销商),andsuppliers(供应商)--everyoneinvolvedinmovingaproductfromsuppliertocustomer.Startingfromonerootsupplier,
漫浸天空的雨色
·
2020-07-30 11:16
PAT甲级
PAT甲级/乙级机试经验
PAT
甲级
——PAT Judge
题目描述TheranklistofPATisgeneratedfromthestatuslist,whichshowsthescoresofthesubmittions.ThistimeyouaresupposedtogeneratetheranklistforPAT.输入描述:Eachinputfilecontainsonetestcase.Foreachcase,thefirstlinecon
Xiao2018428
·
2020-07-30 11:10
PAT
2020年7月第2题 PAT
甲级
真题 The Judger (25分)
Agameofnumbershasthefollowingrules:atthebeginning,twodistinctpositiveintegersaregivenbythejudge.Theneachplayerinturnmustgiveanumbertothejudge.Thenumbermustbethedifferenceoftwonumbersthatarepreviouslyg
浒鱼鱼
·
2020-07-30 11:13
PAT甲级
PAT-
乙-1019 1019 数字黑洞 (20 分)
代码#include#includeusingnamespacestd;stringintToString(intt){stringstreamss;ss>tmp;while(tmp.length()>tmp;returntmp;}stringfindMin(strings){for(inti=0;is.at(j)){charc=s.at(j);s[j]=s[i];s[i]=c;}}}return
zhanggirlzhangboy
·
2020-07-30 11:30
PAT-乙级
PAT-
乙-1025 1025 反转链表 (25 分)
代码#include#includeusingnamespacestd;constintMAX=100000;structnode{intid;intdata;intnext;};intmain(){intstart,n,k;scanf("%d%d%d",&start,&n,&k);nodenodeArray[MAX];for(inti=0;iv;intnow=start;for(inti=0;i
zhanggirlzhangboy
·
2020-07-30 11:30
PAT-乙级
PAT
甲级
——1110 Complete Binary Tree (完全二叉树)
1110CompleteBinaryTree(25分)Givenatree,youaresupposedtotellifitisacompletebinarytree.InputSpecification:Eachinputfilecontainsonetestcase.Foreachcase,thefirstlinegivesapositiveintegerN(≤20)whichisthetot
Little Panda
·
2020-07-30 10:04
PAT
(Advanced
Level)
Practice
数据结构与算法
PAT
甲级
-1064 Complete Binary Search Tree(30分)
PAT
甲级
-1064CompleteBinarySearchTree(30分)1064CompleteBinarySearchTree(30分)ABinarySearchTree(BST)isrecursivelydefinedasabinarytreewhichhasthefollowingproperties
aiFee
·
2020-07-30 10:45
PAT甲级
MOOC数据结构-陈越姥姥
上一页
27
28
29
30
31
32
33
34
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他