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甲级1072
PAT甲级
1140Look-and-say Sequence
题目链接https://pintia.cn/problem-sets/994805342720868352/problems/994805344490864640题解一英语correspondingto与…相一致,我之前似乎记成了“根据……”思路、注意点和代码题目:第n+1个数字是第n个数字的一种描述第n+1个串是第n个串中各个数字的统计统计规则是不好描述,我就不描述了。看样例或者代码就能看出来了
臭咸鱼
·
2020-08-04 21:00
PAT甲级
1151 LCA in a Binary Tree LCA+DFS
LCA问题在常规树中的实现,思路和1143一样,本体主要要解决的就是递归子树边界的问题我采用的map映射的方法,将中序遍历的结点值映射为下标位置,那么如果用下标来代替结点值的话,当前的树便是一颗bst树了利用这个特性,比较映射值便可以判断左右子树的关系#include#include#include#includeusingnamespacestd;vectorpre,in;unordered_m
哦啦哦啦!
·
2020-08-04 21:36
PAT甲级
PAT甲级
1107 Social Clusters 1、4样例没过解析
观察样例,发现A、B、C三人,即使A和C并没有共同爱好,但他们和B都有共同爱好,所以他们也属于同一个集合因此我考虑将有关联的爱好捆绑在一起:合并一个人的所有爱好,只要A和B的爱好有交集,那么他们的所有爱好都会被绑定到一个集合中统计人数时,取每个人的第一个爱好(题目保证每个人至少一个爱好),找到该爱好所属的集合的根,将根的值放入result,累加一次num[r];最后将每个集合对应的人数放入out,
哦啦哦啦!
·
2020-08-04 21:36
PAT甲级
PAT甲级
1143 Lowest Common Ancestor BST+LCA
本想建树然后通过递归左右子树的形式去做,但是发现题中说明最多有一万个结点,写完以后果然超时....判别LCA的方法判断当前的两个点的位置情况,如果一个在左子树,一个在右子树,那么根便是最小公共祖先;如果都在左子树,递归左子树判断;如果都在右子树,递归右子树判断;如果一个就是根,那么它便是最小公共祖先解决超时方法:由于题目告知是bst树,其实只需要比较结点值便可以确定左右子树的关系。但是递归时根结点
哦啦哦啦!
·
2020-08-04 21:35
PAT甲级
PAT甲级
1152Google Recruitment
题目链接https://pintia.cn/problem-sets/994805342720868352/problems/1071785055080476672题解涉及到的英语知识recruitment招聘thefirst10-digitprimefoundinconsecutivedigitsofthenaturalconstante由自然常数e的连续数字中的第一个10位素数prime素数c
臭咸鱼
·
2020-08-04 20:00
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甲级练习题
Leetcode解题方法17-HASH
1.题目和为K的子数组2.思路利用HASH3.题目
1072
题目给定一个整数数组和一个整数k,你需要找到该数组中和为k的连续的子数组的个数。
84145614
·
2020-08-04 03:26
HDOJ-
1072
Nightmare
66666666666666,看完答案代码后,第一次完全理解后自己敲出来BFS,很激动#include#includeusingnamespacestd;intmap[20][20],vis[20][20],n,m,ex,ey,c,flag;intdx[4]={-1,1,0,0};intdy[4]={0,0,-1,1};structnode{inttx,ty;inttemp;intg;};void
导士
·
2020-08-03 14:07
DFS
搜索
acm
Leetcode解题方法16-化难为易
1.题目按列翻转得到最大值等行数2.思路将题目进行解读,转换成容易实现的思路3.题目
1072
题目给定由若干0和1组成的矩阵matrix,从中选出任意数量的列并翻转其上的每个单元格。
84145614
·
2020-08-03 11:04
数论基础--洛谷P
1072
Hankson 的趣味题
题目大意:给出gcd(x,a0)=a1lcm(x,b0)=b1两个式子,a0,a1,b0,b1是已知的,问有多少个x满足情况。题解:首先需要有两个前置知识,证明的话看这篇博客:https://blog.csdn.net/nuclearsubmarines/article/details/776031541.gcd(x,y)*lcm(x,y)=x*y;2.gcd(x,y)=z,gcd(x/z,y/z
昵称很长很长真是太好了
·
2020-08-03 09:36
数论
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甲级
】1002 A+B for Polynomials (25分)
1002A+BforPolynomials(25分)Thistime,youaresupposedtofindA+BwhereAandBaretwopolynomials.InputSpecification:Eachinputfilecontainsonetestcase.Eachcaseoccupies2lines,andeachlinecontainstheinformationofapol
韩旭051
·
2020-08-02 20:36
PAT甲级练习题
2019-03-22
137/
1072
章1/2页第137章苏阿姨不相信你是我男朋友啊一句不是熟人,顿时让苏忆婉觉得,自己没脸再继续待下去了,可她又想看温情最后一眼……然而,就是她的这个小私心,让她接下来更加的气愤,早知道,她还不如早些走掉的好
6d5fcd33ff96
·
2020-08-01 09:07
CodeForce 517 Div 2. B Curiosity Has No Limits
http://codeforces.com/contest/
1072
/problem/BB.CuriosityHasNoLimitstimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputWhenMashacametomathclassestoday
weixin_30564901
·
2020-08-01 03:09
CodeForce 517 Div 2. C Cram Time
http://codeforces.com/contest/
1072
/problem/CC.CramTimetimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputInagalaxyfar
weixin_30235225
·
2020-08-01 03:55
叶嘉莹 关于欧阳修词的鉴赏
欧阳修(1007一
1072
),宇永叔,号醉翁,别号六一居士,庐陵(今江西吉安县)人,当时,在北宋初年江西出了很多有名的文学家,除欧阳修外,尚有晏殊、王安石、黄山谷等,都是江西人,不过欧阳修并不出生在江西
凌波幽梦谁惊破
·
2020-08-01 00:02
hdu
1072
题解
hdu
1072
题解NightmareTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission
菜菜的小胡
·
2020-07-31 23:30
CodeForces CF #517 Div.2
http://codeforces.com/contest/
1072
/problem/Aintn,m,k;cin>>n>>m>>k;intans=0;while(k--){ans+=2*n+2*m-4;
是不是测评机针对我
·
2020-07-31 23:22
CF
Codeforces
1072
C - Cram Time
C-CramTime思路:首先找到最大的x,使得x*(x+1)/2=i,那么这个i放在第一天如果ausingnamespacestd;#definefifirst#definesesecond#definepiacos(-1.0)#defineLLlonglong//#definempmake_pair#definepbpush_back#definelsrt#definepiipair#defi
weixin_33796205
·
2020-07-30 20:48
CF
1072
C Cram Time
思路:首先二分找到使x*(x+1)/22#include3#include4usingnamespacestd;56typedeflonglongll;78inlineboolcheck(llx,lla,llb)9{10returnx*(x+1)/2>a>>b)17{18lll=1,r=200000,ans=-1;19while(l>1;22if(check(m,a,b))23{24l=m+1;2
weixin_30410119
·
2020-07-30 20:22
CF-
1072
-C. Cram Time(贪心,数学)
CF-
1072
-C.CramTimehttp://codeforces.com/contest/
1072
/problem/C题意:第一天有a小时,第二天有b小时。第k个任务需要k个小时来完成。
weixin_30292745
·
2020-07-30 20:19
CodeForces
1072
C Cram Time【思维题】
传送门:http://codeforces.com/problemset/problem/
1072
/CC.CramTimetimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputInagalaxyfar
附魔兔子
·
2020-07-30 20:45
Codeforces
C - Cram Time CodeForces -
1072
C
题目链接:QAQ题意:给你两个数a和b,让你用1,2,3,4,5....n的数去填满a和b,要求填满的数量最大,输出填满的方案思路:因为我们肯定是从小开始填的,所以我们可以求出n*(n+1)/2=(a+b)满足的最大的n,这样1-n之间所有的数都是要用的。然后我们只要从大到小的去填a或者b,如果a不能填就填b,这样就能用完所有的1-n了(因为我们肯定能填满一个数,另一个数可能有空缺。)附上代码:#
liexss
·
2020-07-30 19:14
hdu 1528 Card Game Cheater (二分匹配)
CardGameCheaterTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):
1072
AcceptedSubmission
anque1234
·
2020-07-30 19:42
Codeforces
1072
C Cram Time (贪心)
题目链接:http://codeforces.com/problemset/problem/
1072
/C#includeusingnamespacestd;#definedebugputs("YES")
等我学会后缀自动机
·
2020-07-30 19:46
Codeforces习题集
贪心策略/决策问题
SpringBoot(十一)——SpringBoot与缓存
文章目录1.JSR
1072
.SpringBoot缓存抽象2.1几个重要概念&缓存注解2.2@Cacheable/@CachePut/@CacheEvict主要的参数2.3缓存可用的SpEL表达式2.4使用缓存
ewenll
·
2020-07-30 18:15
spring
boot
SpringBoot
redis
学习笔记
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甲级
排序
2020
PAT甲级
春季考试题目及解答
总结:按这个出题的风格,历年的题应该没啥常考价值了,没有模板题,都得靠平时编码积累。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甲级
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甲级
——PAT Judge
题目描述TheranklistofPATisgeneratedfromthestatuslist,whichshowsthescoresofthesubmittions.ThistimeyouaresupposedtogeneratetheranklistforPAT.输入描述:Eachinputfilecontainsonetestcase.Foreachcase,thefirstlinecon
Xiao2018428
·
2020-07-30 11:10
PAT
上一页
14
15
16
17
18
19
20
21
下一页
按字母分类:
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
其他