![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT
think-weige
这个作者很懒,什么都没留下…
展开
-
PAT甲1140字符串
PAT甲1140字符串题目链接1140 Look-and-say Sequence (20分)Look-and-say sequence is a sequence of integers as the following:D, D1, D111, D113, D11231, D112213111, …where D is in [0, 9] except 1. The (n+1)st number is a kind of description of the nth number. For e原创 2020-06-12 13:15:23 · 181 阅读 · 0 评论 -
PAT甲1005字符串
PAT甲1005字符串题目链接1005 Spell It Right (20分)Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:Each input file contains one test case. Each case occupies原创 2020-06-12 13:05:21 · 170 阅读 · 0 评论 -
PAT甲1035字符串
PAT甲1035题目链接1035 Password (20分)To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish 1 (one) from l (L in lowercase), or 0 (z原创 2020-06-12 12:18:02 · 232 阅读 · 0 评论 -
PAT甲1077字符串
PAT甲1077题目链接1077 Kuchiguse (20分)The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker’s personality. Such a preference is called “Kuchiguse” and is of原创 2020-06-12 12:11:51 · 231 阅读 · 0 评论 -
PAT甲1112字符串
PAT甲11121112 Stucked Keyboard (20分)On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters corresponding to those keys will appear repeatedly on screen for k times.Now given a resulting string on screen原创 2020-06-12 12:05:06 · 144 阅读 · 0 评论 -
PAT甲1022
10221022 Digital Library (30分)A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigned an unique 7-digit number as its ID. Given any quer原创 2020-05-29 21:29:55 · 164 阅读 · 0 评论 -
PAT甲1063Set的使用
10631063 Set Similarity (25分)Given two sets of integers, the similarity of the sets is defined to be Nc /Nt ×100%, where Nc is the number of distinct common numbers shared by the two sets, and Nt is the total number of distinct numb原创 2020-05-28 18:22:48 · 142 阅读 · 0 评论 -
PAT甲1047Map的使用
PAT10471047 Student List for Course (25分)Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses.Input Specification:原创 2020-05-27 12:45:03 · 138 阅读 · 0 评论 -
PAT甲1039Map的使用
PAT10391039 Course List for Student (25分)Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered course list for each student who comes for a query.原创 2020-05-27 12:18:02 · 125 阅读 · 0 评论 -
PAT甲1054Map的使用
PATA10541054 The Dominant Color (20分)Behind the scenes in the computer’s memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color with the largest proportional area is called the dominant color. A原创 2020-05-27 12:04:23 · 140 阅读 · 0 评论 -
PAT甲1065 简单模拟
坑点:溢出,当表现为负溢出,当a,b都大于0时,表示a+b>c,当表现为正溢出,且当a,b都小于0,时表示a+b<c,其它类型则正常判断。坑点在于刚好在long long 的界限边缘,存在溢出可能。代码:#include<iostream>using namespace std;typedef long long ll;ll a,b,c,res;int main(){ int t; cin>>t; for(int i=1;i<=t;i++)原创 2020-05-17 20:09:24 · 155 阅读 · 0 评论 -
PAT甲1046 简单模拟
题目链接思路:用前缀和计算前缀的和为多少,然后判断两种方法直接到还是走两段的付出少,记为ans代码:#include<iostream>using namespace std;const int maxn=1e5+7;typedef long long ll;ll sum[maxn],total;int a[maxn];void pd(int &x,int &y){ int t; if(x>y) { t=x; x=y; y=t; }原创 2020-05-17 20:05:25 · 128 阅读 · 0 评论 -
PAT甲1042 简单模拟
题目链接代码:#include<iostream>#include<string.h>#include<stdio.h>using namespace std;const int N = 54;int current[N];int next[N];int trans[N];char t[5]={'S','H','C','D','J'};int main(){ int k; cin>>k; for(int i=1;i<=N;i原创 2020-05-14 15:10:04 · 111 阅读 · 0 评论 -
PAT甲1124 简单模拟
题目链接代码:#include<iostream>#include<set>using namespace std;const int maxn=1004;string s[maxn];string ans[maxn];set<string> st;int main(){ int m,n,k; cin>>m>>n>>k; for(int i=1;i<=m;i++) cin>>s[i];原创 2020-05-14 07:52:36 · 167 阅读 · 0 评论 -
PAT甲1011 简单模拟
题目链接代码:#include<iostream>#include<algorithm>using namespace std;struct node{ double a; char c;};node A[4][4];bool cmp(node a,node b){ return a.a>b.a;}int main(){ for(int i=1;i<=3;i++) { for(int j=1;j<=3;j++) { c原创 2020-05-13 12:58:20 · 138 阅读 · 0 评论 -
PAT甲1036 简单模拟
题目链接代码#include<iostream>#include<algorithm>#include<vector>using namespace std;struct node{ string name; string id; int score;};vector<node> v1,v2;bool cmp(node a,node b){ return a.score<b.score;}int main(){ int原创 2020-05-13 12:36:41 · 122 阅读 · 0 评论 -
PAT甲1006 简单模拟
A1006题目链接#include<iostream>using namespace std;int hour=3600,minute=60;struct node{ int start; int endd;};int main(){ int n; cin>>n; int start=24*3600; int endd=0; string anss,anse,str; int a,b,c,k1,k2; for(int i=1;i<=n;i++)原创 2020-05-13 12:19:15 · 127 阅读 · 0 评论 -
PAT甲1008 简单模拟
题目链接模拟即可代码:#include<iostream>using namespace std;int main(){ int n,t,ans,k; cin>>n; ans=n*5; cin>>t; ans+=t*6; for(int i=2;i<=n;i++) { cin>>k; if(k-t==0) continue; else if(k-t>0) { ans+=(k-t)*6; }原创 2020-05-13 12:16:37 · 89 阅读 · 0 评论