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甲级
——1009 Product of Polynomials (25分)(最后一个测试点段错误)
思路:我记得乙级有一道题是多项式相加,这里是相乘,差不多的借鉴木桶排序的思想,定义一个木桶数组,木桶的下标代表指数,元素值代表系数数组开小了后面三个测试点都会段错误我还有一个段错误想不明白,如果有路过的dalao麻烦指点一下#include#includeusingnamespacestd;staticconstintMAX=2010;structP{intexp;//指数floatcoef;//
沉迷单车的追风少年
·
2020-08-09 11:26
PAT甲级
PAT甲级
1012,我用Java这样写,最后一个测试例会超时!
PAT甲级
的1012题,排序题,我用Java这样写的,思路跟C++代码思路类似,但是最后一个测试用例会超时,还请大佬们看一看怎么修改可以通过~~感谢!感谢!感谢!
Zihan_James
·
2020-08-09 11:45
求助!PAT甲级1012
pat 甲级 1011
pat甲级
1011#includeusingnamespacestd;intmain(){doublea,b,c,mul=1.0;for(inti=0;i>a>>b>>c;if(a>b&&a>c){couta
累了丶晚安
·
2020-08-09 11:32
PAT甲级
pat 甲级 1010
pat甲级
10101.不仅仅要考虑36以内的进制,radix可以很大2.题目数据中radix的范围很大,所以数据需要用longlong.
累了丶晚安
·
2020-08-09 11:31
PAT甲级
PAT甲级
1010
1010.Radix(25)时间限制400ms内存限制65536kB代码长度限制16000B判题程序Standard作者CHEN,YueGivenapairofpositiveintegers,forexample,6and110,canthisequation6=110betrue?Theansweris"yes",if6isadecimalnumberand110isabinarynumber
qq_36317016
·
2020-08-09 11:39
PAT
PAT甲级
1011
水题。。。。#includeusingnamespacestd;intmain(){floatnum[3][3];for(inti=0;i>num[i][j];}}floatsum=1.0;for(inti=0;i<3;++i){floatm=-1.0;intt=0;for(intj=0;j<3;++j){if(m
Erick_Lv
·
2020-08-09 10:29
PAT甲级
【
PAT甲级
】1010 Radix (25 分)
1010Radix题目描述Givenapairofpositiveintegers,forexample,6and110,canthisequation6=110betrue?Theanswerisyes,if6isadecimalnumberand110isabinarynumber.NowforanypairofpositiveintegersN1andN2,yourtaskistofindt
初见还是重逢
·
2020-08-09 10:56
PAT考试
PAT甲级
-1010 Radix (25分)【推荐!!!】
点击链接
PAT甲级
-AC全解汇总题目:Givenapairofpositiveintegers,forexample,6and110,canthisequation6=110betrue?
邂逅模拟卷
·
2020-08-09 10:59
PAT
PAT甲级
查找元素1011 World Cup Betting
昨天看了一本书,《你的灯亮着吗》,用一些小例子讲述各种情况下问题解决者面对问题做出的反应,很薄,不到两个小时就看完了,会反复读。里面有一句话:当你以为你认为问题很好地解决了,其实并没有。正如下面这道题很简单,但显然有更简单的方法。Withthe2010FIFAWorldCuprunning,footballfanstheworldoverwerebecomingincreasinglyexcite
Nj-sdut
·
2020-08-09 10:17
PAT
PAT甲级
1009
#include#includestructnode{intx;doubley;};intmain(){structnodeone[20];doubleans[2001]={0.0};intflag[2001]={0};intk1,k2,i,j;scanf("%d",&k1);for(i=0;i=0;i--)if(ans[i]!=0.0)num+=1;//有坑NK---X的幂nkaN1---前面的
平凡之路漫漫
·
2020-08-09 10:12
PAT甲级
PAT甲级
1011
#includeintmain(){doublew,t,l;doublemax=1,temp=0.0;chars[1000];intnum=0,i=0;while(scanf("%lf%lf%lf",&w,&t,&l)!=EOF)//inti=3;//题目只说输入三次,不过无所谓了//while(i--){//(scanf("%lf%lf%lf",&w,&t,&l)!=EOF);temp=w;s[
平凡之路漫漫
·
2020-08-09 10:12
PAT甲级
PAT甲级
1018 Public Bike Management
1018PublicBikeManagement(30分)思路:DFS遍历求出所有可能的最短路径,对于每条可能的最短路径求其send和take_back,比较选择最优的;注意点:不可以从后经过的城市中取自行车给前面的城市;看别的博客说可以用Dijkstra算法修改一下做DFS,我jio着效率可能会高点,等有时间了我去研究研究!#includeusingnamespacestd;structway{
qq_33231894
·
2020-08-09 10:03
PAT甲级刷题历程
PAT甲级
1011
1011WorldCupBetting(20分)这个吧,比较简单所以也没采坑,就是觉得还挺迷的这个profit的计算方法;#includeusingnamespacestd;intmain(){vector>game(3,vector(3,0));for(inti=0;i>game[i][j];}vectorans;floattmp=1;for(inti=0;imax(game[i][1],gam
qq_33231894
·
2020-08-09 10:03
PAT甲级刷题历程
PAT甲级
1020 Tree Traversals
1020TreeTraversals(25分)思路:层序遍历的变形,用队列存储左右子树,只不过这个左右子树是根据后序和中序推导得到的;#includeusingnamespacestd;vectorlevel;voidtolevel(vectorpost,vectorin){queue>ps,is;vectortmp;tmp.push_back(0);tmp.push_back(post.size
qq_33231894
·
2020-08-09 10:03
PAT甲级刷题历程
PAT甲级
1017 Queueing at Bank
1017QueueingatBank(25分)测试点5:要注意只要顾客是在17点之前进入银行,那么即使他等待到了17点之后,他依然将被服务,依然需要计算等待时间思路和前面有一题的排队问题很像,模拟整个过程;#includeusingnamespacestd;structrecord{inthour,min,sec,protime;inttime;intendtime;};boolcmp(recor
qq_33231894
·
2020-08-09 10:03
PAT甲级刷题历程
PAT甲级
1009 测试点0
1009ProductofPolynomials(25分)测试点0:系数项可能为负数,所以有些项的系数会为零,此时不应输出#includeusingnamespacestd;intmain(){intn;cin>>n;mapa;for(inti=0;i>tmp1>>tmp2;a[tmp1]=tmp2;}cin>>n;mapb;for(inti=0;i>tmp1>>tmp2;b[tmp1]=tmp2
qq_33231894
·
2020-08-09 10:03
PAT甲级刷题历程
PAT甲级
1019
1019GeneralPalindromicNumber(20分)emm一次就过了所以也没看出来测试点。。。大概需要注意的就是当N为0时直接输出Yes吧思路:比较直接,首先进行进制的转换,转换后的数字判断是否是对称的即可#includeusingnamespacestd;vectortobase(intn,intb){vectornum;if(n==0){num.push_back(0);retu
qq_33231894
·
2020-08-09 10:03
PAT甲级刷题历程
PAT甲级
1014 测试点4、5
1014WaitinginLine(30分)直接模拟整个过程就好啦,没啥弯弯绕绕的;测试点4、5:顾客只要是在17:00前开始服务的都可以被服务完,所以判断条件里还要加上这一条;及代码中注释部分#includeusingnamespacestd;structman{intid,ServTime;intETime;};intmain(){intn,m,k,q;cin>>n>>m>>k>>q;vect
qq_33231894
·
2020-08-09 10:03
PAT甲级刷题历程
PAT甲级
1026 Table Tennis
1026TableTennis(30分)测试点测试点1,2:没有VIP球桌空闲时,VIP球员正常排队;测试点4:球员打球时间超过两小时的,都按照两小时计算;测试点5,7:VIP球员在普通球桌和VIP球桌同时空闲时,会优先选择编号较小的VIP球桌;测试点8:球员等待时间从秒转换为分钟时按照四舍五入计算;球桌的编号为1~N;思路:和前面的银行排队题一样,进行简单的模拟,不过我写的好长呀=。=模拟的过程
qq_33231894
·
2020-08-09 10:03
PAT甲级刷题历程
PAT甲级
真题(二分)——1010 Radix (25 分)
1010Radix(25分)Givenapairofpositiveintegers,forexample,6and110,canthisequation6=110betrue?Theansweris“yes”,if6isadecimalnumberand110isabinarynumber.NowforanypairofpositiveintegersN1andN2,yourtaskistofi
逃课去学习:)
·
2020-08-09 10:57
PAT
c++
算法学习
二分
PAT甲级
1001 A+B Format 20分
题目简介Calculatea+bandoutputthesuminstandardformat–thatis,thedigitsmustbeseparatedintogroupsofthreebycommas(unlesstherearelessthanfourdigits).输入信息Eachinputfilecontainsonetestcase.Eachcasecontainsapairofi
离域小派键
·
2020-08-09 10:58
PAT甲级
算法
java
c++
PAT甲级
1010 (进制和二分法)
题目Givenapairofpositiveintegers,forexample,6and110,canthisequation6=110betrue?Theansweris“yes”,if6isadecimalnumberand110isabinarynumber.NowforanypairofpositiveintegersN1andN2,yourtaskistofindtheradixof
我家面试官最好看
·
2020-08-09 10:50
刷子刷题
PAT甲级
1010
1010.Radix(25)时间限制400ms内存限制65536kB代码长度限制16000B判题程序Standard作者CHEN,YueGivenapairofpositiveintegers,forexample,6and110,canthisequation6=110betrue?Theansweris"yes",if6isadecimalnumberand110isabinarynumber
strivinging
·
2020-08-09 10:08
PAT
C++
C++程序设计
程序设计
PAT甲级
1010.Radix(25) 题目翻译与答案
题目来源自PAT网站https://www.patest.cn/题目描述:1010.Radix(25)ivenapairofpositiveintegers,forexample,6and110,canthisequation6=110betrue?Theansweris"yes",if6isadecimalnumberand110isabinarynumber.Nowforanypairofpo
漂流瓶jz
·
2020-08-09 10:02
PAT甲级
PAT甲级
1011.World Cup Betting(20) 题目翻译与答案
题目来源自PAT网站https://www.patest.cn/题目描述:1011.WorldCupBetting(20)Withthe2010FIFAWorldCuprunning,footballfanstheworldoverwerebecomingincreasinglyexcitedasthebestplayersfromthebestteamsdoingbattlesfortheWor
漂流瓶jz
·
2020-08-09 10:02
PAT甲级
PAT甲级
1009 Product of Polynomials(C++实现)
PAT甲级
1009ProductofPolynomials(C++实现)Thistime,youaresupposedtofindA×BwhereAandBaretwopolynomials.InputSpecification
皓空Fly
·
2020-08-09 09:36
C++
PAT
PAT 甲级 1009 Product of Polynomials (25 分)
题目:
PAT甲级
1009ProductofPolynomials(25分)经验总结:使用unordered_map来存储第一行的项。在输入第二行多项式时,计算并用map来存储最终结果。
资深小透明
·
2020-08-09 09:06
PAT
甲级
Radix (25)-
PAT甲级
1010.Radix(25)Givenapairofpositiveintegers,forexample,6and110,canthisequation6=110betrue?Theansweris“yes”,if6isadecimalnumberand110isabinarynumber.NowforanypairofpositiveintegersN1andN2,yourtaskistofi
柳婼
·
2020-08-09 09:46
PAT
PAT甲级
1010. Radix (25)
Givenapairofpositiveintegers,forexample,6and110,canthisequation6=110betrue?Theansweris“yes”,if6isadecimalnumberand110isabinarynumber.NowforanypairofpositiveintegersN1andN2,yourtaskistofindtheradixofon
liaotl10
·
2020-08-09 09:17
PAT甲级
PAT甲级
1010TMD的坑
##TMLGB一切皆有可能内容:简介:故事要从博主今天中午睡了个午觉说起,博主醒了浑身乏力只能祭出一道PAT题来找回精神,从此踏上一条不归路。。。废话不多说,祭题。题目大概意思:N1,N2为输入的两个非负整数redix为第tag数的进制数,让我们求最小的redix2使得N1=N2,比如例子6110110的答案为2:十进制下的6等于二进制下的110。先说一下笔者遇到的坑,首先是二分查找。假设N1进制
knswd
·
2020-08-09 09:35
PAT甲级
_1009(Product of Polynomials)
1009多项式乘积这次,你应该求出多项式A和B的乘积(A*B)输入规范每个输入文件包含一个测试用例。每个测试用例占行,每行包含一个多项式的信息:KN1aN1N2aN2…NKaNK其中K表示多项式中非零项的个数,Ni和aNi(i=1,2,3,…,K)分别表示指数和系数。它们的范围位1#includeusingnamespacestd;constintMAXN=1005;pairp[MAXN];//保
i_meteor_shower
·
2020-08-09 08:43
PAT甲级
PAT甲级
1010【Radix】二分搜索
之前想暴力过的结果第7个测试点过不去。。其实我一直没想明白最大进制为啥可以大于36,明明表示的时候是到z(35)。。一直WA。。后来看了其他大神的题解才知道用二分做。left=n2中的最大值+1。right=n1的十进制值+1。由于java的各种慢,以下代码也只能在Pat最快的那台评测机(据姥姥说是1/6的概率)下AC。。TAT补充:2018.8.9更新,博主二刷这题同样是暴力WA在第7个点。。。
gq97
·
2020-08-09 08:39
二分
pat甲级
1010
本题几个注意点1、注意进制上限是n2+12、用二分法不然会超时3、统一转换为十进制再比较但可能会溢出(一开始用的进制方法有一个测试点过不去不知为何)#include#include#include#includeusingnamespacestd;//俩种求十进制的方法结果不同?longconverse(stringn,longradix){longi,result=0;for(i=0;i='0'
大庭小藏
·
2020-08-09 07:42
PAT甲级
1010Radix25分/二分法猜进制转换/详细解读精准求出上限下限
题目来源:https://pintia.cn/problem-sets/994805342720868352/problems/994805507225665536代码参考:https://www.liuchuo.net/archives/2458题目大意翻译:已知r进制的数n1,求n2在什么进制能等于n1解法分析:假如已经能想到先将n1换成十进制数,然后就该测试n2的进制了难点:1.目标进制的下
浒鱼鱼
·
2020-08-09 07:15
PAT甲级
pat甲级
1010. Radix (25)
1010.Radix(25)时间限制400ms内存限制65536kB代码长度限制16000B判题程序Standard作者CHEN,YueGivenapairofpositiveintegers,forexample,6and110,canthisequation6=110betrue?Theansweris"yes",if6isadecimalnumberand110isabinarynumber
active2489595970
·
2020-08-09 06:53
pat甲级解题报告
PAT甲级
—— World Cup Betting
Withthe2010FIFAWorldCuprunning,footballfanstheworldoverwerebecomingincreasinglyexcitedasthebestplayersfromthebestteamsdoingbattlesfortheWorldCuptrophyinSouthAfrica.Similarly,footballbettingfanswereput
Xiao2018428
·
2020-08-09 06:27
PAT
PAT甲级
1010,1011解题报告
1010Radix(25分)Givenapairofpositiveintegers,forexample,6and110,canthisequation6=110betrue?Theanswerisyes,if6isadecimalnumberand110isabinarynumber.NowforanypairofpositiveintegersN1andN2,yourtaskistofind
Tate_Brown
·
2020-08-09 06:27
C++
PAT
C
PAT甲级
真题1009. Product of Polynomials
题目链接:https://www.patest.cn/contests/pat-a-practise/1009题意:给我们两个多项式每一项的系数以及指数,让我们求出这两个多项式的乘积。题目中给出的指数范围为0~1000,那么显然乘积的指数范围为0~2000,那么我们可以直接用2000大小的数组存储每一位的系数,在乘法完成后我们再将不等于0的位数找出来即可。这里需要注意的是,比较系数是否等于0的方法
RaAlGhul
·
2020-08-09 06:47
ACM_Water
PAT考题练习题解
PAT甲级
1010:Radix
Givenapairofpositiveintegers,forexample,6and110,canthisequation6=110betrue?Theansweris“yes”,if6isadecimalnumberand110isabinarynumber.NowforanypairofpositiveintegersN1andN2,yourtaskistofindtheradixofon
Nick12138_2017
·
2020-08-09 06:01
1
PAT甲级
-1010. Radix (25)进制
1010.Radix(25)时间限制400ms内存限制65536kB代码长度限制16000B判题程序Standard作者CHEN,YueGivenapairofpositiveintegers,forexample,6and110,canthisequation6=110betrue?Theansweris"yes",if6isadecimalnumberand110isabinarynumber
kewlgrl
·
2020-08-09 06:33
C4
top
/
PAT
PAT甲级
1009. Product of Polynomials (25)
1009.ProductofPolynomials(25)时间限制400ms内存限制65536kB代码长度限制16000B判题程序Standard作者CHEN,YueThistime,youaresupposedtofindA*BwhereAandBaretwopolynomials.InputSpecification:Eachinputfilecontainsonetestcase.Eachc
Sitlos
·
2020-08-09 05:42
PAT甲级
pat甲级
1010 Radix (二分查找)
做题+看代码2h...debug半小时#include#include#include#include#includeusingnamespacestd;longlongconvert(stringn,longlongradix){longlong_n=0;inttemp=0,index=0;for(autoc=n.rbegin();c!=n.rend();c++){temp=isdigit(*c
Alternative_19
·
2020-08-09 05:11
pat甲级
PAT甲级
1011 World Cup Betting (20 分)
直接选大小#include#defineFIfirst#defineSEsecondusingnamespacestd;typedeflonglongll;constllmaxn=1e8+7;doublea1,a2,a3;doubleb1,b2,b3;doublec1,c2,c3;doubleans;voidsolve(doublea,doubleb,doublec){if(a>=b&&a>=c)
冰冰的小宝贝
·
2020-08-09 05:27
PAT甲级
PAT甲级
A1009 Product of Polynomials
PAT甲级
A1009ProductofPolynomials题目:Thistime,youaresupposedtofindA×BwhereAandBaretwopolynomials.InputSpecification
遇见更好的自己.jpg
·
2020-08-09 05:44
PAT甲级题解
【python】
PAT甲级
1010 Radix (24/25分)
题目Givenapairofpositiveintegers,forexample,6and110,canthisequation6=110betrue?Theanswerisyes,if6isadecimalnumberand110isabinarynumber.NowforanypairofpositiveintegersN1andN2,yourtaskistofindtheradixofon
汪汪碎冰冰
·
2020-08-09 05:43
PAT
【python】
PAT甲级
1011 World Cup Betting (20/20分)
题目Withthe2010FIFAWorldCuprunning,footballfanstheworldoverwerebecomingincreasinglyexcitedasthebestplayersfromthebestteamsdoingbattlesfortheWorldCuptrophyinSouthAfrica.Similarly,footballbettingfanswerep
汪汪碎冰冰
·
2020-08-09 05:43
PAT
PAT甲级
1011 World Cup Betting (20分)
1011WorldCupBetting(20分)题目链接:PATA1011思路分析:嗯…这道题就很迷,我不知道它那个公式是怎么来的,开始还以为是按照题意,不同的数据对应不同的公式,后来才发现所有数据都是那个公式,但是我不太理解(原谅笨笨的我,大家有明白的别忘了告诉我啊~),但是不影响做题。就是找每行中赔率最大的输出它所对应的的字母,然后用那个公式计算收益就可以了。AC代码:#includeusin
sosalt8
·
2020-08-09 05:38
PAT甲级题解
PAT甲级
1009 Product of Polynomials第一个测试点不通过
注意事项第一个测试点一直不过,后来把cnt计数放在外面就通过了。。。我这边的建议就是不要在计算乘积的时候计数,另外在循环一次计数原始代码#include#include#includeusingnamespacestd;structpolynomial{intexponent;doublecoefficient;};intmain(){intcnt=0,numa,numb;doubleresult
哦啦哦啦!
·
2020-08-09 05:02
PAT甲级
PAT甲级
1010radix
第一次题解(20分)#include#include#includeusingnamespacestd;typedeflonglongLL;stringN1,N2;intradix,tag;LLtemp[256];LLinf=(1LLt)return-1;}returnans;}LLfind_left(stringn){intlen=n.size();intans=-1;for(inti=0;ia
菜鸟的飞行日记
·
2020-08-09 05:00
pat甲级
PAT甲级
1011 World Cup Betting
PAT甲级
1011WorldCupBettingWiththe2010FIFAWorldCuprunning,footballfanstheworldoverwerebecomingincreasinglyexcitedasthebestplayersfromthebestteamsdoingbattlesfortheWorldCuptrophyinSouthAfrica.Similarly
旺 崽
·
2020-08-09 05:33
PAT甲级
排序
vector
上一页
7
8
9
10
11
12
13
14
下一页
按字母分类:
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
其他