自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 收藏
  • 关注

原创 PAT A1074 最后一个测试点不过

建议试试这个测试用例能不能过主要就是因为最后形成的链表长度和题目给出的n不一定是一样的,有可能形不成长度为n的链表。00100 6 300000 4 9999900100 1 1230968237 6 0000133218 3 0000099999 5 -112309 2 33218自己写的C++代码#include <cstdio>const int maxn = 100010;struct node { int data; int next = -1

2022-03-19 20:43:26 149

原创 PAT甲级1015 Reversible Primes 测试点一未通过原因及注意点

1015 Reversible Primes思路:我的思路比较暴力,就是直接判断翻转之前和翻转之后的数字是否都为素数,如果都是就输出"Yes",否则输出"No"。注意点:题中的要求是在翻转之前和翻转之后必须都为素数才能输出Yes;关于翻转的规则是按照输入的数制翻转的,例如输入为23 2,则首先要将23转换为2进制10111,再将10111翻转;关于素数的判断:1既不是素数也不是合数,所以1不是素数,刚开始测试点1没有通过就是因为没有判断数字是否为1,后来改过来之后测试点就通过了。另外:刚

2020-08-07 17:29:20 942

原创 PAT甲级1014 Waiting in Line 思路、Java代码及相关注意点

1014 Waiting in Line数据结构:采用队列,每个队伍用一个队列来保存,形成一个队列的数组queues[N];设置与队列数量相等大小的数组sumTimeEachQueue[N]来保存队列中已有的人所需的总时间;设置与客户数量相等大小的数组processingTime[K]来接收输入保存每个客户业务进行的时间。设置与客户数量相等大小的数组startTime[K]来记录每位客户业务开始的时间。思路:在队列没有满之前,也就是没有达到限制之前,依次输入数据将队列填满,并更新数组su

2020-08-07 12:07:08 397

原创 PAT甲级1013 Battle Over Cities Java运行超时

1013 Battle Over CitiesIt is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we need to repair any other highways t

2020-08-06 19:16:45 222

原创 PAT甲级1010 Radix Java

RadixGiven a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number and 110 is a binary number.Now for any pair of positive integers N​1​​ and N​2​​, your task is to find the radix

2020-08-05 13:56:08 174

原创 PAT甲级1009 Product of Polynomials 测试点0未解决

1009 Product of PolynomialsThis time, you are supposed to find A×B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial:K N​1​​ a

2020-08-04 10:57:20 429

原创 PAT甲级1008 Elevator Java

1008 ElevatorThe highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, an

2020-08-02 18:38:03 153

原创 PAT甲级1007 Maximum Subsequence Sum 测试点5不通过解决

1007 Maximum Subsequence SumGiven a sequence of K integers { N​1​​, N​2​​, …, N​K​​ }. A continuous subsequence is defined to be { N​i​​, N​i+1​​, …, N​j​​ } where 1≤i≤j≤K. The Maximum Subsequence is the continuous subsequence which has the largest sum of

2020-08-02 17:38:10 840

原创 PAT甲级1003 Emergency 测试点2一直不通过的原因

1003 EmergencyAs an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the length of each road between any pair of ci

2020-07-21 21:35:55 931

原创 ConstraintLayout中使用RecyclerView导致最后一个item显示不全问题的解决方法

ConstraintLayout中使用RecyclerView导致最后一个item显示不全问题的解决方法在ConstraintLayout中使用RecylerView时,当List中元素数量比较多出现屏幕滑动时,会导致最后一个item显示不全,只能出现一半的问题的出现。此时,可以修改布局:android:layout_width="match_parent"android:layout_height="0dp"app:layout_constraintBottom_toBottomOf="pare

2020-07-10 08:42:11 2840 2

转载 Kotlin学习——Lambda表达式

Kotin学习——Lambda表达式一、Lambda介绍Lambda表达式的本质是匿名函数,因为在其底层实现中还是通过匿名函数来实现的。但是在使用时不必关心起底层实现。不过Lambda的出现确实是减少了代码量的编写,同时也是代码变得更加简洁明了。二、Lambda使用2.1 Lambda表达式的特点Lambda表达式总是被大括号括着其参数(如果存在)在->之前声明(参数类型可以省略)函数体(如果存在)在->后面2.2 Lambda语法1. 无参数的情况val/var 变量名

2020-06-13 15:44:02 187

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除