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甲级
A1130 Infix Expression (25 分)
Givenasyntaxtree(binary),youaresupposedtooutputthecorrespondinginfixexpression,withparenthesesreflectingtheprecedencesoftheoperators.InputSpecification:Eachinputfilecontainsonetestcase.Foreachcase,the
小·幸·运
·
2020-09-15 05:22
PAT甲级
树
【
PAT甲级
题解】1052 Linked List Sorting (25分)
本题常规链表题,与乙级有区别的地方是,这次要求对值排序,而不是翻转或者区块翻转,对于值排序,我选择使用第一个结构体按照散列存入list数组中,为了处理脏数据还能实现排序,选择使用第二个结构体node1存入vector中,然后对vector中的数据排序,排序后循环输出,坑点一:存在全部都是脏数据的情况,需要输出0和-1,但是第一次做测试点3错误扣3分,最终拿到22分,一直没找到答案,先放在这里,今后
苯酸氨酰糖化物
·
2020-09-15 05:06
PAT甲级题解
算法
c++
PAT甲级
1028(列表排序)
1028ListSorting(25point(s)) Excelcansortrecordsaccordingtoanycolumn.Nowyouaresupposedtoimitatethisfunction.InputSpecification: Eachinputfilecontainsonetestcase.Foreachcase,thefirstlinecontainstwoint
_云胡
·
2020-09-15 05:05
PAT甲级
OJ
PAT
甲级
PAT甲级
1119
1119.Pre-andPost-orderTraversals(30)时间限制400ms内存限制65536kB代码长度限制16000B判题程序Special作者CHEN,YueSupposethatallthekeysinabinarytreearedistinctpositiveintegers.Auniquebinarytreecanbedeterminedbyagivenpairofpos
strivinging
·
2020-09-15 05:43
PAT
浙大
PAT甲级
1038
就是求由这几数构成的数最小,对于两个字符串a,b。如果a+b#include#include#include#include#include#include#include#defineinf10000000usingnamespacestd;strings[10005];boolcmp(stringx,stringy){returnx+y>n;for(inti=0;i>s[i];}sort(s,
luowei5513
·
2020-09-15 05:50
浙大pat
PAT甲级
1043. Is It a Binary Search Tree (25)
ABinarySearchTree(BST)isrecursivelydefinedasabinarytreewhichhasthefollowingproperties:Theleftsubtreeofanodecontainsonlynodeswithkeyslessthanthenode’skey.Therightsubtreeofanodecontainsonlynodeswithkeys
liaotl10
·
2020-09-15 05:02
PAT甲级
浙大
pat甲级
题目---1098. Insertion or Heap Sort (25)
AccordingtoWikipedia:Insertionsortiterates,consumingoneinputelementeachrepetition,andgrowingasortedoutputlist.Ateachiteration,insertionsortremovesoneelementfromtheinputdata,findsthelocationitbelongswi
dijiang0473
·
2020-09-15 04:20
数据结构与算法
PAT甲级
练习1028. List Sorting (25)
1028.ListSorting(25)时间限制200ms内存限制65536kB代码长度限制16000B判题程序Standard作者CHEN,YueExcelcansortrecordsaccordingtoanycolumn.Nowyouaresupposedtoimitatethisfunction.InputEachinputfilecontainsonetestcase.Foreachca
a1025461748
·
2020-09-15 04:42
PAT甲级练习
浙大
PAT甲级
-1016
PhoneBills1.更改文件输入输出方式:freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);******//中间代码正常cin,coutfclose(stdin);fclose(stdout);2.vector删除某一项:删除v[i]:v.erase(v.begin()+i);【注】:删除某项后其后面的项会自动向前补
zbyue_
·
2020-09-15 04:14
浙大PAT甲级练习题
PAT甲级
1130. Infix Expression (25)
1130.InfixExpression(25)时间限制400ms内存限制65536kB代码长度限制16000B判题程序Standard作者CHEN,YueGivenasyntaxtree(binary),youaresupposedtooutputthecorrespondinginfixexpression,withparenthesesreflectingtheprecedencesofth
Jelly_acm
·
2020-09-15 04:28
----二叉树
PAT
pat甲级
1028. List Sorting (25)
欢迎访问我的
pat甲级
题解目录哦https://blog.csdn.net/richenyunqi/article/details/84981078题目描述C++代码#includeusingnamespacestd
日沉云起
·
2020-09-15 04:15
pat甲级
List Sorting (25)-
PAT甲级
真题
Excelcansortrecordsaccordingtoanycolumn.Nowyouaresupposedtoimitatethisfunction.InputEachinputfilecontainsonetestcase.Foreachcase,thefirstlinecontainstwointegersN(#include#includeusingnamespacestd;cons
柳婼
·
2020-09-15 04:02
PAT
Linked List Sorting (25)-
PAT甲级
真题
Alinkedlistconsistsofaseriesofstructures,whicharenotnecessarilyadjacentinmemory.WeassumethateachstructurecontainsanintegerkeyandaNextpointertothenextstructure.Nowgivenalinkedlist,youaresupposedtosortt
柳婼
·
2020-09-15 04:02
PAT
PAT甲级
1028. List Sorting (25)
Excelcansortrecordsaccordingtoanycolumn.Nowyouaresupposedtoimitatethisfunction.InputEachinputfilecontainsonetestcase.Foreachcase,thefirstlinecontainstwointegersN(#include#include#includeusingnamespace
liaotl10
·
2020-09-15 04:01
PAT甲级
浙大
pat甲级
题目---1028. List Sorting (25)
Excelcansortrecordsaccordingtoanycolumn.Nowyouaresupposedtoimitatethisfunction.InputEachinputfilecontainsonetestcase.Foreachcase,thefirstlinecontainstwointegersN(#include#include#includeusingnamespace
dijiang0473
·
2020-09-15 04:18
1028. List Sorting (25)
题目解析:
PAT甲级
再也没有比它更简单排序题了,解析略。
佩奇哥哥
·
2020-09-15 04:33
排序
PAT甲级真题题解
List Sorting (25)
PAT甲级
传送门#include#include#include#defineMAX_N100100usingnamespacestd;structStudent{intid;charname[15];intgrade;}stu[MAX_N];boolcmp1(structStudenta,structStudentb){returna.id
老虞面馆
·
2020-09-15 04:32
PAT
甲级
PAT甲级
1028. List Sorting (25)
题目链接:https://www.patest.cn/contests/pat-a-practise/1028题目大意:根据输入要求将所给学生按照id、name、grade排序,按姓名和分数排序时若出现相同的情况,则将相同的按照id升序排列。解题思路:使用sort()函数,自定义比较方式cmp1代码如下:#include#include#include#includeusingnamespaces
NJU_Flipped
·
2020-09-15 04:01
PAT甲级
PAT甲级
1007 Maximum Subsequence Sum (25 分)
题意:给定长度为n的序列,寻找最大字段和,按要求输出思路:滑动窗口,当前子段sum>=0时,右指针一直往右边滑动,如果当前序列sum变成的负数,那就把左指针往右滑动,直到序列sum变成非负数或者序列变空了;ps:如果最大子段和为负,如下操作:"IfalltheKnumbersarenegative,thenitsmaximumsumisdefinedtobe0,andyouaresupposedt
冰冰的小宝贝
·
2020-09-15 01:55
PAT甲级
pat甲级
1007 Maximum Subsequence Sum (动态规划)
1007MaximumSubsequenceSum(25分)GivenasequenceofKintegers{N1,N2,...,NK}.Acontinuoussubsequenceisdefinedtobe{Ni,Ni+1,...,Nj}where1≤i≤j≤K.TheMaximumSubsequenceisthecontinuoussubsequencewhichhasthelargests
whisperlzw
·
2020-09-15 01:44
pat
dp
PAT甲级
1007
1007MaximumSubsequenceSum(25分)最大字段和加记录开始结束位置1#include2#include3#include4#include5#include6#include7#include8#include9usingnamespacestd;10intn,a[10005];11intmain()12{13intans,sum,start,endd,s,e;14cin>>
weixin_30644369
·
2020-09-15 01:06
PAT甲级
C语言.1006. 换个格式输出整数
#includeintmain(){voidgewei(int);voidshiwei(int);voidbaiwei(int);inti,k;ints,b,g;scanf("%d",&k);g=k%10;if((k=k/10)!=0){s=k%10;if((k=k/10)!=0){b=k%10;baiwei(b);}shiwei(s);}gewei(g);return0;}voidgewei(i
Yoiker
·
2020-09-14 06:02
PAT甲级
PAT甲级
1028 List Sorting (25分)
#pragmawarning(disable:4996)#include#include#include#includeusingnamespacestd;structinformation{charid[10];charname[10];intgrade;}info[100010];intC;boolcmp(structinformationa,structinformationb){if(C=
Douglas_LT
·
2020-09-14 06:56
PAT
PAT甲级
1012 The Best Rank (25分)
#pragmawarning(disable:4996)#include#include#include#includeusingnamespacestd;structstudentinfo{intid;intgrade[4];}student[2010];intnow;boolcmp(structstudentinfoa,structstudentinfob){returna.grade[now
Douglas_LT
·
2020-09-14 06:56
PAT
PAT甲级
1025 PAT Ranking (25分)
#pragmawarning(disable:4996)#include#include#include#includeusingnamespacestd;structinformation{charid[15];intlocation_number;intscore;intlocal_rank;intfinal_rank;}info[30010];boolcmp(structinformatio
Douglas_LT
·
2020-09-14 06:56
PAT
PAT甲级
1062/乙级1015 德才论 (25分)
抓住了8月份的尾巴✨#pragmawarning(disable:4996)#include#include#include#includeusingnamespacestd;structstudentinfo{intid;intde;intcai;intsum;intfigure;}student[100010];boolcmp(structstudentinfoa,structstudenti
Douglas_LT
·
2020-09-14 06:56
PAT
PAT甲级
1016 Phone Bills (25分) 只拿到了15分
在时间差额和费用的计算上有些问题,既繁琐还容易出错,可以参考柳婼PAT1016,也算是为以后类似的计算提供了一种通法#pragmawarning(disable:4996)#include#include#include#includeusingnamespacestd;structinformation{charname[22];intMM,dd,hh,mm;charline[10];}info
Douglas_LT
·
2020-09-14 06:56
PAT
PAT甲级
1065 A+B and C (64bit) (20分)
哈哈没想到竟然用到了计算机组成原理的知识(通过判断是否溢出来比较大小)#pragmawarning(disable:4996)#include#include#includeusingnamespacestd;intmain(){intn;scanf("%d",&n);for(inti=0;i=0)printf("Case#%d:false",i+1);elseif(a>0&&b>0&&tempc
Douglas_LT
·
2020-09-14 06:56
PAT
PAT甲级
1008题(Elevator)
#include#includeintmain(){intN,i,j;intsum=0;inta[100];scanf("%d",&N);sum+=5*N;for(i=0;ia[j]){sum+=6*(a[j+1]-a[j]);}elseif(a[j+1]
docker_007
·
2020-09-14 05:04
PAT甲级题目
1001 A+B Format (20 分)
PAT原题【注】转载自柳婼女神的1001.A+BFormat(20)-
PAT甲级
真题Calculatea+bandoutputthesuminstandardformat–thatis,thedigitsmustbeseparatedintogroupsofthreebycommas
MNSmile
·
2020-09-14 04:36
C/C++
PAT
PAT甲级
题目(纯C语言)
PAT甲级
题目目录1001100210031004100510061007100810091010101110011001A+BFormat(20分)Calculatea+bandoutputthesuminstandardformat–thatis
Funny�
·
2020-09-13 19:11
浙江大学
在线pat
题库集合
PAT
真题
c语言
【
PAT甲级
】PAT (Advance Level) 训练记录【纪念19年9月8号
PAT甲级
满分~】
最近找工作较忙,之后会继续更新~--------------------------------分割线--------------------------------为了继续增加自己的编程与算法能力,继续刷
PAT
初见还是重逢
·
2020-09-13 19:20
PAT考试
PAT甲级
1004(C语言)
1004CountingLeaves(30分)Afamilyhierarchyisusuallypresentedbyapedigreetree.Yourjobistocountthosefamilymemberswhohavenochild.InputSpecification:Eachinputfilecontainsonetestcase.Eachcasestartswithalinecon
Caohengpy
·
2020-09-13 19:20
PAT
PAT甲级
1005
#include#include#includeusingnamespacestd;intmain(){intn=0;chartemp[110];scanf("%s",temp);inti;for(i=0;temp[i]!='\0';i++)n+=temp[i]-'0';intnum[110];intj;if(n==0){printf("zero");return0;}for(i=0;i=0;j-
平凡之路漫漫
·
2020-09-13 19:41
PAT甲级
【C语言】
PAT甲级
训练题目 1001题总结
其他题目:【C语言】
PAT甲级
训练题目答案、知识点梳理及总结链接:原题原题内容:Calculatea+bandoutputthesuminstandardformat--thatis,thedigitsmustbeseparatedintogroupsofthreebycommas
UlyssesXC
·
2020-09-13 18:03
PAT
【
PAT甲级
】1002 A+B for Polynomials 两种解法
【题意】输入俩多项式,计算加和并输出;注意系数可以是小数,并且输出时要保留一位小数,同时要按指数递降顺序输出结果。【原题链接】Thistime,youaresupposedtofindA+BwhereAandBaretwopolynomials.InputSpecification:Eachinputfilecontainsonetestcase.Eachcaseoccupies2lines,an
咚唔
·
2020-09-12 14:29
数据结构学习&PAT刷题
PAT甲级
——1109 Group Photo (排序)
1109GroupPhoto(25分)Formationisveryimportantwhentakingagroupphoto.GiventherulesofformingKrowswithNpeopleasthefollowing:ThenumberofpeopleineachrowmustbeN/K(rounddowntothenearestinteger),withalltheextrap
Little Panda
·
2020-09-12 08:36
PAT
(Advanced
Level)
Practice
PAT甲级
备考记录
PAT甲级
牛客网备考记录一、按日期排序6.11.ToBuyorNottoBuy(20)2.InsertorMerge(25)6.2ConsecutiveFactors(20)DeduplicationonaLinkedList
qq_41123190
·
2020-09-12 06:25
PAT甲级
2020秋准备
2020.2.5刷以前的题目,20分的开始第一题(字符串处理)Kuchiguse(20)输在翻译和C++中一个特别好用的reverse(x.begin(),x.end());第二题(数学)ConsecutiveFactors(20)第三题(见面礼)A+BinHogwarts(20)这道题没什么难度,就考一个翻译。(不粘代码了,没意义。)第四题A+BandC(64bit)(20)两个64位数相加,两
TowlGol
·
2020-09-12 05:25
PAT
算法
c++
PAT甲级
--1114 Family Property(25 分)【并查集】
1114FamilyProperty(25分)Thistime,youaresupposedtohelpuscollectthedataforfamily-ownedproperty.Giveneachperson'sfamilymembers,andtheestate(房产)infounderhis/herownname,weneedtoknowthesizeofeachfamily,andth
水果妹妹踩前端的坑
·
2020-09-12 05:25
PAT
算法
PAT甲级
1007 Maximum Subsequence Sum 最大连续子序列和 dp或者暴力枚举
题意:给一个数组序列a1,a2,…,an,求i,j(1usingnamespacestd;inta[10005];intmain(){intn;cin>>n;for(inti=0;i>a[i];}intsum=-1;//记录子序列的最大和inttemp;//中间变量intstart;//记录开始下标intend1;//记录结束下标for(inti=0;isum){//若加上a[j]结果大于sums
化身孤岛的鲸o
·
2020-09-12 04:42
PAT
暴力
从零开始的动态规划qwq
PAT乙级1001-1006
近期想过
PAT甲级
证书,先从乙级开始刷吧!
不能say的秘密
·
2020-09-11 17:07
算法
【2019暑期】【
PAT甲级
】图论专练总结
发现了一个大佬总结的好文章,准备按照她的路线进行学习DFS/BFS1106统计层数和次数的时候,在判断里统计,不要在递归里不然会很麻烦也会导致结果错误注意更新最小层数时也要把次数还原intn;doublep,r,sum;intcnt=1,minl=999999;vectornode[110000];voiddfs(introot,intlevel){if(node[root].size()==0)
之井
·
2020-09-11 09:27
pat
2019暑期
PAT甲级
A1007---动态规划最大连续子序列和
1007MaximumSubsequenceSum(25分)1007.png分析:本题要求最大连续子序列的和,输出最大之和以及子序列第一个数和最后一个数。如果方案不唯一,则输出i,j最小的一组。如果所有数都是负数,则最大和为0,然后输出首尾元素。先考虑如何求最大和。以dp[i]表示以A[i]作为末尾的连续序列最大和。以本题为样例dp[0]=-10,dp[1]=1,dp[2]=3......容易知状
1nvad3r
·
2020-09-10 17:48
PAT甲级
真题 1034 Head of a Gang (30分)(用map数组模拟,注意测试点4)
题目Onewaythatthepolicefindstheheadofagangistocheckpeople’sphonecalls.IfthereisaphonecallbetweenAandB,wesaythatAandBisrelated.Theweightofarelationisdefinedtobethetotaltimelengthofallthephonecallsmadebet
zhang35
·
2020-08-25 09:41
PAT
PAT甲级
——1100 Mars Numbers (字符串操作、进制转换)
1100MarsNumbers(20分)PeopleonMarscounttheirnumberswithbase13:ZeroonEarthiscalled"tret"onMars.Thenumbers1to12onEarthiscalled"jan,feb,mar,apr,may,jun,jly,aug,sep,oct,nov,dec"onMars,respectively.Forthenex
Little Panda
·
2020-08-25 09:31
PAT
(Advanced
Level)
Practice
PAT甲级
刷题记录——1090 Highest Price in Supply Chain (25分)
Asupplychainisanetworkofretailers(零售商),distributors(经销商),andsuppliers(供应商)--everyoneinvolvedinmovingaproductfromsuppliertocustomer.Startingfromonerootsupplier,everyoneonthechainbuysproductsfromone’ssu
囷囷
·
2020-08-25 09:23
PAT甲级
pat甲级
1090. Highest Price in Supply Chain (25)
欢迎访问我的
pat甲级
题解目录哦https://blog.csdn.net/richenyunqi/article/details/84981078题目描述算法设计这道题与
pat甲级
1079.TotalSalesofSupplyChain
日沉云起
·
2020-08-25 09:42
pat甲级
PAT甲级
-1100-Mars Numbers(字符串)
PeopleonMarscounttheirnumberswithbase13:ZeroonEarthiscalled“tret”onMars.Thenumbers1to12onEarthiscalled“jan,feb,mar,apr,may,jun,jly,aug,sep,oct,nov,dec”onMars,respectively.Forthenexthigherdigit,Marspeo
波点兔
·
2020-08-25 09:04
PAT
PAT甲级
-1100 Mars Numbers(包括所有测试用例)
这道题的测试用例给我整急眼了。反复实验总结如下。1044火星数字(20)(20分)火星人是以13进制计数的:地球人的0被火星人称为tret。地球人数字1到12的火星文分别为:jan,feb,mar,apr,may,jun,jly,aug,sep,oct,nov,dec。火星人将进位以后的12个高位数字分别称为:tam,hel,maa,huh,tou,kes,hei,elo,syy,lok,mer,
LFPNB
·
2020-08-25 09:02
PAT甲级
上一页
2
3
4
5
6
7
8
9
下一页
按字母分类:
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
其他