自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(14)
  • 资源 (5)
  • 收藏
  • 关注

原创 PAT(甲级)2020年冬季考试 7-1 The Closest Fibonacci Number (20 分)

题目The Fibonacci sequence FnF_nFn​​​ is defined by Fn+2=Fn+1+FnF_{n+2}=F_{n+1}+F_{n}Fn+2​=Fn+1​+Fn​​​ for n≥0, with F0=0F_{0}=0F0​=0and F1=1F_{1}=1F1​=1. The closest Fibonacci number is defined as the Fibonacci number with the smallest absolute differen

2021-03-10 15:18:52 86

原创 PAT (Advanced Level) Practice 1125 Chain the Ropes (25 分)

思路每两条绳子折叠并为一条绳子的时候,长度折半,为了得到最长的绳子,需要先从小到大排序,由最短的向最长的折叠。代码#include<iostream>#include<algorithm>using namespace std;int main(){ int n; scanf("%d",&n); double a[n]; for(int i = 0;i < n;i++) scanf("%lf",&a[i]); sort(a,a+n);

2021-03-09 16:23:52 55

原创 PAT (Advanced Level) Practice 1121 Damn Single (25 分) 测试点

吐槽点第一次6分,第二次25分,只差了一行代码#include<iostream>#include<vector>#include<algorithm>using namespace std;struct Node{ int cp = -1; bool yq = false;};int main(){ int n; scanf("%d",&n); Node node[100000]; for(int i = 1;i <= n;i

2021-03-09 15:05:14 170

原创 PAT (Advanced Level) Practice 1041 Be Unique (20 分)

题目Being unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: one bets on a number chosen from [1,10410^4104​​ ]. The first one who bets on a unique number wins. For example, if there

2021-03-07 20:46:14 95

原创 PAT (Advanced Level) Practice 1046 Shortest Distance (20 分)

题目The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits.Input Specification:Each input file contains one test case. For each case, the first line contai

2021-03-07 13:04:28 70

原创 PAT (Advanced Level) Practice 1048 Find Coins (25 分)

题目Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However, there was a special requirement of the payment: for

2021-03-07 11:37:37 96

原创 PAT (Advanced Level) Practice 1050 String Subtraction (20 分)

代码#include<iostream>using namespace std;int main(){ string s1,s2; getline(cin,s1); getline(cin,s2); int a[300]; fill(a,a+300,1); for(int i = 0;i < s2.length();i++) { a[s2[i]] = 0; } for(int i = 0;i < s1.length();i++) { if(a[s1

2021-03-07 10:34:57 59

原创 PAT (Advanced Level) Practice 1051 Pop Sequence (25 分)

题目Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, …, N and pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequence of the stack. For example, if M is 5 and N is 7, we can obt

2021-03-06 23:03:12 120

原创 PAT (Advanced Level) Practice 1052 Linked List Sorting (25 分)

题目A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integer key and a Next pointer to the next structure. Now given a linked list, you are supposed to sort the structu

2021-03-06 22:25:59 75

原创 PAT (Advanced Level) Practice 1059 Prime Factors (25 分)

题目Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N=p1k1×p2k2×⋅⋅⋅×pmkmN=p_1^{k_1}\times p_2^{k_2}\times ···\times p_m^{k_m}N=p1k1​​×p2k2​​×⋅⋅⋅×pmkm​​吐槽点一开始是测试点3通过不了,看网上说是“1=1”没有,但是我当时是有的,具体如代

2021-03-06 10:26:56 107

原创 PAT (Advanced Level) Practice 1064 Complete Binary Search Tree (30 分)

题目A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less than the node’s key.The right subtree of a node contains only nodes with keys greater

2021-03-04 11:43:46 128 1

原创 PAT (Advanced Level) Practice 1080 Graduate Admission (30 分)

题目It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if you could write a program to automate the admission procedure.Each applicant will have to provide two g

2021-03-02 14:26:10 77

原创 PAT (Advanced Level) Practice 1083 List Grades (25 分)

题目Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grades are in a given interval.Input Specification:Each in

2021-03-02 13:05:50 112

原创 PAT (Advanced Level) Practice 1093 Count PAT‘s (25 分)

题目The string APPAPT contains two PAT’s as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and the 6th characters.Now given any string, you are supposed to tell the number

2021-03-01 14:03:38 61

树莓派 消防系统操作代码

树莓派 消防系统操作代码

2022-02-25

2022美赛C题所用数据

2022美赛C题所用数据

2022-02-18

Python程序设计期末考复习资料

Python.zip

2021-07-13

高级数据库综合考核(项目9).doc

高级数据库综合考核(项目9).doc

2021-03-09

2021美赛d题数据

2021美赛d题数据

2021-02-23

空空如也

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

TA关注的人

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