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甲级
2018年 9月份 PAT 甲级随想
讲在前面基本情况:本人非科班出身,之前有些许的数据结构基础,上次乙级95,这次通过了8012年九月份的
PAT甲级
考试。
wsxyh1071652438
·
2020-08-13 23:15
PAT
(迪杰斯特拉)Dijkstra算法详解
PAT甲级
1003
1.迪杰斯特拉(Dijkstra)算法介绍迪杰斯特拉(Dijkstra)算法是典型最短路径算法,用于计算一个节点到其他节点的最短路径。它的主要特点是以起始点为中心向外层层扩展(广度优先搜索思想),直到扩展到终点为止。光看介绍不好理解,我们拿PAT中甲级1003的题目来做例子讲解。2.题目解释下,就是N座城市(0-N-1),并且给你M行个距离,也就是从第3行开始到最后,分别意思为从城市A到城市B的距
全村最靓的小精灵
·
2020-08-13 22:07
数据结构与算法
PAT甲级
刷题记录——1049 Counting Ones (30分)
Thetaskissimple:givenanypositiveintegerN,youaresupposedtocountthetotalnumberof1’sinthedecimalformoftheintegersfrom1toN.Forexample,givenNbeing12,therearefive1’sin1,10,11,and12.InputSpecification:Eachin
囷囷
·
2020-08-13 22:26
PAT甲级
PAT甲级
1018 Public Bike Management (30 分) 题解
\quad这个题目的是要我们能记录所有的最短路径,在这些路径中选择符合题目的那一种输出。我用vectorpre[maxn]数组记录符合最短路时节点的前驱节点,用Dijistra获得这个数组。最后用DFS对pre数组进行深搜,找出所有的最短路径来计算需要从中心拿走的自行车数量和需要带回中心的数量,比较输出在从中心带出自行车数量最少的前提下带回中心数量最少的那一种解答,记录此路径,输出即可。关于如何获
程勇uestc
·
2020-08-13 17:04
PAT甲级
PAT甲级
2022 and 2018
1018.PublicBikeManagement(30)时间限制400ms内存限制65536kB代码长度限制16000B判题程序Standard作者CHEN,YueThereisapublicbikeserviceinHangzhouCitywhichprovidesgreatconveniencetothetouristsfromallovertheworld.Onemayrentabikea
大唐忽悠
·
2020-08-13 16:05
水题
PAT甲级
2018年12月场
我因为一些事情没有参加2018年12月场的考试。2019年3月场的也没有报名,因为最近要开始去实习了,打算今年9月秋招的时候考一次吧。自己拿了三小时模拟考了一次。总体不是很难,主要是一些小细节,前三题各失小分,最后一题拿满。总共91分。。。1152GoogleRecruitment(20分)InJuly2004,GooglepostedonagiantbillboardalongHighway10
love music.
·
2020-08-13 16:00
PAT
PAT甲级
1018(disjktra+深度遍历)
这道题着实有点坑,不过收获也不少。很容易想到用disjktra算法来获取最短子路径,这里稍微解释一下这个算法。disjktra算法基于广度优先遍历,从中心点向外一层一层寻找其他地点(每一层的依据为到原地的最短距离),但它优于广度算法就在于它有一个标志位记录了是否展开过此点(遍历此点能到地所有地方),这样就避免了在条路上来回走,保证不回头减少了时间复杂度。它属于贪心算法,每次都拿出距离原点最近且没有
knswd
·
2020-08-13 15:07
PAT甲级
_1104(Sum of Number Segments)
1104段的数字和给定一个正数序列,定义一个连续的子序列为一段。例如给定序列{0.1,0.2,0.3,0.4},我们可以找到有10段:(0.1)(0.1,0.2)(0.1,0.2,0.3)(0.1,0.2,0.3,0.4)(0.2)(0.2,0.3)(0.2,0.3,0.4)(0.3)(0.3,0.4)和(0.4).。现在给定一个序列,你应该找到所有段中所有数字的总和。对于上一个实例,所有10个段
i_meteor_shower
·
2020-08-12 11:05
PAT甲级
2019冬季
PAT甲级
题解和反思
非科班跨考,11月中旬把甲级题库155道粗略地刷完了一遍(在《算法笔记》的帮助下),然后从头开始二刷,做了十几题以后觉得刷不完了,加上其他考试的压力,便搁置刷题计划,考前一天将题库里面的关于图和树的题目的代码粗略地看了一遍,心想这次12月考试对明年的考研帮助也不大,就当练手,结果运气好,全AC了。这次的题目不难,会写HelloWorld,离满分就不远了,如下:题目1:7-1GoodinC(20分)
xiaoh1999
·
2020-08-11 19:20
PAT
2019冬季
PAT甲级
题解
现在等贵浙的复试分数线,很危险,希望能过。去年年底考的PAT,运气好满分了。一直没啥心思,最近想起来,决定稍微写一个题解。7-1GoodinC(20分)Whenyourinterviewerasksyoutowrite"HelloWorld"usingC,canyoudoasthefollowingfigureshows?InputSpecification:Eachinputfilecontai
zZec
·
2020-08-11 19:30
pat备考之路。。。
2019年12月
PAT甲级
第一题 Good in C(1164)题解
题目Whenyourinterviewerasksyoutowrite“HelloWorld”usingC,canyoudoasthefollowingfigureshows?InputSpecification:Eachinputfilecontainsonetestcase.Foreachcase,thefirstpartgivesthe26capitalEnglishlettersA-Z,e
qq_36993032
·
2020-08-11 17:57
PAT
PAT
PAT甲级
2019冬7-3 Summit(1166)(邻接矩阵存储,直接暴力)
算法笔记总目录关键英语单词解释本题代码与
PAT甲级
2017冬7-31142MaximalClique(25分)除输出不一样外,其他不变。
神圣之光
·
2020-08-11 17:29
PAT算法笔记
2019年12月
PAT甲级
第三题 Summit(1166)题解
题目Asummit(峰会)isameetingofheadsofstateorgovernment.Arrangingtherestareasforthesummitisnotasimplejob.Theidealarrangementofoneareaistoinvitethoseheadssothateveryoneisadirectfriendofeveryone.Nowgivenaseto
qq_36993032
·
2020-08-11 15:34
PAT
PAT甲级
1141PAT Ranking of Institutions
题目链接https://pintia.cn/problem-sets/994805342720868352/problems/994805344222429184题解题目要求n个考生,每个考生信息为:ID6个字符的字符串,第一位是考试等级(B、A、T)score分数,[0,100]的整数school不超6位的学校码,由英文字母组成,不区分大小写,但输入中有大小写请输出:第一行输出学校的数量然后按r
臭咸鱼
·
2020-08-11 14:00
PAT甲级
1001 A+B Format
今天开始刷PAT练习数据结构的基础。原题链接这道题的思路很清晰。即便是题目给出了数字范围,为了避免int类型(32位)溢出的可能,把位数扩展至longint(64)的长度。先将两数相加取绝对值,赋值给变量addT;如果addT=0,返回字符串“0”;while循环逐步取addT的最后一个数(取模),存入字符串relust;对addT除以10抛弃最后一个数字,并赋值给自己;计数器count每3次添一
IT奶牛
·
2020-08-11 13:06
数据结构算法
1040.Longest Symmetric String (25)
LongestSymmetricString(25)pat-al-10402017-02-05动态规划题,想清楚了就特别好做,不然……参考:1040.LongestSymmetricString(25)-
PAT
风怜目尽无疆地s
·
2020-08-11 01:40
pat
PAT甲级
延迟的回文数 (高精度加法)
延迟的回文数题目大意:给定一个k+1位的正整数N,写成ak⋯a1a0的形式,其中对所有i有0≤ai#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusingnamespacestd;typed
林黛玉倒拔垂杨柳
·
2020-08-11 00:04
高精度
PAT甲级
1153Decode Registration Card of PAT
题目链接https://pintia.cn/problem-sets/994805342720868352/problems/1071785190929788928题解题目要求和思路PAT注册号分4个部分:第1位字母代表考试等级第2到4位数字是考试地点,大小从101到999第5到10位数字为考试日期第11到13位数字是考生号,大小从000到9991:给定考试等级,要求输出该考试等级所有考生的注册号
臭咸鱼
·
2020-08-10 22:00
pat甲级
1040. Longest Symmetric String (25)
欢迎访问我的
pat甲级
题解目录哦https://blog.csdn.net/richenyunqi/article/details/84981078题目描述算法设计遍历输入的字符串S,以遍历到的当前字符为回文中心
日沉云起
·
2020-08-10 20:28
pat甲级
PAT甲级
1040 Longest Symmetric String(JAVA版)
本题考查动态规划,可以使用Manacher(马拉车)算法,该算法能够将查找最长回文的时间复杂度降低到O(n)。思路:很简单,就是马拉车算法,但是马拉车算法比较难理解。我自己看了很多大神的解析渐渐明白了一些东西,总结一下就是一句话:“马拉车算法的核心思想就是利用回文对称的性质,使用以前计算的每个字符的回文半径作为关于回文中心对称的字符的回文半径基础值,以便减少时间复杂度”。在以上条件不满足(即没有与
东方旅行者
·
2020-08-10 20:28
JAVA
PAT
PAT甲级
1040 Longest Symmetric String (25 分)
1040LongestSymmetricString(25分)Givenastring,youaresupposedtooutputthelengthofthelongestsymmetricsub-string.Forexample,givenIsPAT&TAPsymmetric?,thelongestsymmetricsub-stringissPAT&TAPs,henceyoumustoutp
番茄杀手Dexter
·
2020-08-10 20:43
PAT甲级
PAT
【
PAT甲级
最新题解】
PAT甲级
2020.7月春季考试满分题解(附代码)
写在前面:这次题目虽然大多数是模拟题且不算难,但是题面其实不算友好,不少同学因为题目描述而错失满分。A:题意:给定一个数字串,问每一个前缀串是否是素数。模拟题不多解释。#include#include#include#include#include#include#includeusingnamespacestd;constintMAX=2e5+6;strings;boolisprime(intx
韬光养晦_
·
2020-08-10 20:47
PAT
【
PAT甲级
笔记】别人经验总结和整理
时间有限,针对PAT考试,花了一点时间整理了一下学习内容:【推荐资源】1.柳神按题型整理的
PAT甲级
【链接】2.个人觉得不错的网站’【链接】3.甲级刷题资源,还是一个比较全的分类,知识点总结等【链接】4
Patrick Star@wust
·
2020-08-10 19:36
算法
PAT甲级笔记
Head of a Gang (30)
PAT甲级
刷题
题目描述Onewaythatthepolicefindstheheadofagangistocheckpeople'sphonecalls.IfthereisaphonecallbetweenAandB,wesaythatAandBisrelated.Theweightofarelationisdefinedtobethetotaltimelengthofallthephonecallsmadeb
有希N
·
2020-08-10 19:47
Head of a Gang (30)-
PAT甲级
真题(图的遍历dfs)
Onewaythatthepolicefindstheheadofagangistocheckpeople'sphonecalls.IfthereisaphonecallbetweenAandB,wesaythatAandBisrelated.Theweightofarelationisdefinedtobethetotaltimelengthofallthephonecallsmadebetwe
柳婼
·
2020-08-10 17:38
PAT
PAT
Longest Symmetric String (25)-
PAT甲级
真题
Givenastring,youaresupposedtooutputthelengthofthelongestsymmetricsub-string.Forexample,given“IsPAT&TAPsymmetric?”,thelongestsymmetricsub-stringis“sPAT&TAPs”,henceyoumustoutput11.InputSpecification:Eac
柳婼
·
2020-08-10 17:38
PAT
1034 Head of a Gang (30 分)--
PAT甲级
1034HeadofaGang(30分)Onewaythatthepolicefindstheheadofagangistocheckpeople’sphonecalls.IfthereisaphonecallbetweenAandB,wesaythatAandBisrelated.Theweightofarelationisdefinedtobethetotaltimelengthofallth
NullObjectError
·
2020-08-10 17:03
PAT
PAT甲级
1034 Head of a Gang (30 分)(图的dfs遍历,map映射)
1034HeadofaGang(30分)Onewaythatthepolicefindstheheadofagangistocheckpeople'sphonecalls.IfthereisaphonecallbetweenAandB,wesaythatAandBisrelated.Theweightofarelationisdefinedtobethetotaltimelengthofallth
Joyceyang_999
·
2020-08-10 14:07
PAT甲级
2019年浙江大学计算机九推
机试可以选择
PAT甲级
*1,或者PAT乙级*0.8(好像是0.8)去抵本次成绩,但是这个必须提前申请,也就是说你选择了抵成绩那么就算你这次参加
LifeMaker
·
2020-08-10 00:47
PAT甲级
真题 1009 Product of Polynomials (25分) C++实现(使用map,注意测试点0的坑)
题目Thistime,youaresupposedtofindA*BwhereAandBaretwopolynomials.InputSpecification:Eachinputfilecontainsonetestcase.Eachcaseoccupies2lines,andeachlinecontainstheinformationofapolynomial:KN1aN1N2aN2…NKaN
zhang35
·
2020-08-09 16:08
PAT
浙大
PAT甲级
(1074)java题解
;importjava.io.IOException;importjava.io.InputStreamReader;importjava.util.ArrayList;/***@program:浙大
PAT
国氏一雄
·
2020-08-09 15:47
浙大PAT甲级
java题解
[
PAT甲级
]1010. Radix (25)(求另一个数的基数)
1010.Radix(25)原题链接Givenapairofpositiveintegers,forexample,6and110,canthisequation6=110betrue?Theansweris“yes”,if6isadecimalnumberand110isabinarynumber.NowforanypairofpositiveintegersN1andN2,yourtaskis
whl_program
·
2020-08-09 15:30
PAT甲级
[
PAT甲级
]1009. Product of Polynomials (25)(求多项式的积)
1009.ProductofPolynomials(25)原题链接相似题目1002.A+BforPolynomials(25)(求两个多项式的和)Thistime,youaresupposedtofindA*BwhereAandBaretwopolynomials.InputSpecification:Eachinputfilecontainsonetestcase.Eachcaseoccupie
whl_program
·
2020-08-09 15:29
PAT甲级
PAT甲级
1009
Product-of
Polynomial
两个多项式的积
【python】
PAT甲级
1007 Maximum Subsequence Sum (25/25分)
题目GivenasequenceofKintegers{N1,N2,…,NK}.Acontinuoussubsequenceisdefinedtobe{Ni,Ni+1,…,Nj}where1≤i≤j≤K.TheMaximumSubsequenceisthecontinuoussubsequencewhichhasthelargestsumofitselements.Forexample,given
汪汪碎冰冰
·
2020-08-09 15:37
PAT
python
【pathon】
PAT甲级
1008 Elevator (20/20分)
题目Thehighestbuildinginourcityhasonlyoneelevator.ArequestlistismadeupwithNpositivenumbers.Thenumbersdenoteatwhichfloorstheelevatorwillstop,inspecifiedorder.Itcosts6secondstomovetheelevatoruponefloor,an
汪汪碎冰冰
·
2020-08-09 15:37
PAT
python
【c++】
PAT甲级
1093/乙级1040 Count PAT's (25/25分)
题目ThestringAPPAPTcontainstwoPAT’sassubstrings.Thefirstoneisformedbythe2nd,the4th,andthe6thcharacters,andthesecondoneisformedbythe3rd,the4th,andthe6thcharacters.Nowgivenanystring,youaresupposedtotellth
汪汪碎冰冰
·
2020-08-09 15:37
PAT
c++
【python】
PAT甲级
1006 Sign In and Sign Out (25/25分)
题目Atthebeginningofeveryday,thefirstpersonwhosignsinthecomputerroomwillunlockthedoor,andthelastonewhosignsoutwilllockthedoor.Giventherecordsofsigningin’sandout’s,youaresupposedtofindtheoneswhohaveunloc
汪汪碎冰冰
·
2020-08-09 15:37
PAT
python
【python】
PAT甲级
1004 Counting Leaves (30/30分)
题目Afamilyhierarchyisusuallypresentedbyapedigreetree.Yourjobistocountthosefamilymemberswhohavenochild.InputSpecification:Eachinputfilecontainsonetestcase.Eachcasestartswithalinecontaining0
汪汪碎冰冰
·
2020-08-09 15:36
PAT
PAT甲级
1063 Set Similarity (25分)
1063SetSimilarity(25分)题目链接:PATA1063题目大意:输入第一行给出一个数n,代表集合的个数,随后n行每行给出一个集合的元素个数,以及集合中的数字。然后给出k次查询,要求求出指定两个集合的相同元素率nc/nt*100%,其中nc是指两个集合共有的不同元素的个数(说白了就是在去重之后求交集),nt是指两个集合总的不同元素的个数(说白了就是在去重之后求并集),之后保留到小数点
sosalt8
·
2020-08-09 15:20
PAT甲级题解
PAT甲级
刷题记录——1010 Radix (25分)
Givenapairofpositiveintegers,forexample,6and110,canthisequation6=110betrue?Theanswerisyes,if6isadecimalnumberand110isabinarynumber.NowforanypairofpositiveintegersN1andN2,yourtaskistofindtheradixofonen
囷囷
·
2020-08-09 15:30
PAT甲级
pat甲级
1084Perfect Sequence
同乙级1030完美数列有两种解法二分法#include#include#includeusingnamespacestd;constintmaxn=100010;intn,p;inta[maxn];intbinarysearch(inti,intn,longlongx){intleft=i+1,right=n-1,mid;if(a[n-1]<=x)returnn;while(left
菜鸟的飞行日记
·
2020-08-09 15:39
pat甲级
PAT甲级
1048
第一次ac坑点:1.直接输入m找a+b会很烦,所以m-a[i]会省事点2.因为定义的m,a[0],这样的计数方式会多一位,所以,输出判断如果是(i==n),会看不到nosolution的输出,所以判断条件是i==n-1#include#include#includeusingnamespacestd;intsum[100010];boolcmp(inta,intb){returna0&&j!=i)
菜鸟的飞行日记
·
2020-08-09 15:39
pat甲级
pat甲级
1062 Talent and Virtue
#include#include#include#includeusingnamespacestd;constintmaxn=100010;structpeople{charid[10];intde,cai;intsum;intflag;}peo[maxn];boolcmp(peoplea,peopleb){if(a.flag!=b.flag)returna.flagb.sum;elseif(a.
菜鸟的飞行日记
·
2020-08-09 15:39
pat甲级
pat甲级
1044
原题链接https://pintia.cn/problem-sets/994805342720868352/problems/994805439202443264晴神算法笔记题解(第一次ac)#include#include#includeusingnamespacestd;constintN=100010;intn,s,nears=100000010;intsum[N];intupper_bou
菜鸟的飞行日记
·
2020-08-09 15:38
pat甲级
算法笔记
PAT甲级
——A1009 Product of Polynomials
Thistime,youaresupposedtofindA×BwhereAandBaretwopolynomials.InputSpecification:Eachinputfilecontainsonetestcase.Eachcaseoccupies2lines,andeachlinecontainstheinformationofapolynomial:KN1aN1N2aN2...NKaN
weixin_30632089
·
2020-08-09 13:45
PAT甲级
A1009 Product of Polynomials (25)
Thistime,youaresupposedtofindA*BwhereAandBaretwopolynomials.InputSpecification:Eachinputfilecontainsonetestcase.Eachcaseoccupies2lines,andeachlinecontainstheinformationofapolynomial:KN1a~N1~N2a~N2~...
小·幸·运
·
2020-08-09 13:52
PAT甲级
数学问题
PAT甲级
1011 World Cup Betting
题目描述:Withthe2010FIFAWorldCuprunning,footballfanstheworldoverwerebecomingincreasinglyexcitedasthebestplayersfromthebestteamsdoingbattlesfortheWorldCuptrophyinSouthAfrica.Similarly,footballbettingfanswe
Sun990o
·
2020-08-09 12:12
PAT甲级
【
PAT甲级
ArrayList存放class】1011 World Cup Betting (20 分) Java版 3/3通过 四舍五入保留两位小数
题目一共给9个数,3*3,找到每行最大,按照题目要求套算式,计算就行坑&心得没啥坑,一次通过,用到的知识点是:自定义排序、四舍五入保留两位小数DecimalFormatdf=newDecimalFormat("#0.00");//保留两位小数System.out.println(df.format(max));代码importjava.text.DecimalFormat;importjava.u
寒泉Hq
·
2020-08-09 12:24
PAT官网练习题
pat甲级
-1044-Shopping in Mars (25)
欢迎访问我的
pat甲级
题解目录哦https://blog.csdn.net/richenyunqi/article/details/84981078题目描述题意分析给定一组数字,判断这组数字中能否找出连续的一串数字
日沉云起
·
2020-08-09 11:51
pat甲级
pat甲级
1009-Product of Polynomials
欢迎访问我的
pat甲级
题解目录哦https://blog.csdn.net/richenyunqi/article/details/84981078题目描述算法设计
pat甲级
1002题要求实现了多项式加法
日沉云起
·
2020-08-09 11:51
pat甲级
上一页
6
7
8
9
10
11
12
13
下一页
按字母分类:
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
其他