PAT_Advance
xxzccccccc
python/C++, 深度学习,ACM算法竞赛
阿里算法工程师
前百度算法工程师
前滴滴算法工程师
展开
-
PAT Advanced 1001 1002 1003
///1001 简单那字符串处理 #include typedef long long ll; using namespace std; int main(){ ll a,b,ans; while(scanf("%lld%lld",&a,&b)!=EOF){ string s,s1; ans=a+b; if(ans<0)cout<<'-'; if(原创 2018-01-14 21:41:20 · 204 阅读 · 0 评论 -
1024. Palindromic Number (25)
题目链接:https://www.patest.cn/contests/pat-a-practise/1024#include<bits/stdc++.h> const int maxn =10100; using namespace std; string s1,s2; int num1[11],num2[11]; string fun(string s){ string a...原创 2018-03-17 09:06:00 · 218 阅读 · 1 评论 -
1025. PAT Ranking (25)
题目链接:https://www.patest.cn/contests/pat-a-practise/1025结构体排序#include<bits/stdc++.h> const int maxn =10100; using namespace std; int n,k; struct Node{ string s; int fin_rak; int loc_...原创 2018-03-17 09:40:46 · 105 阅读 · 0 评论 -
1069. The Black Hole of Numbers (20)
题目链接:https://www.patest.cn/contests/pat-a-practise/1069#include<bits/stdc++.h> #define cle(n) memset(n,0,sizeof(n)) const int maxn =10100; using namespace std; int a[4]; int cmp(int a,int b){re...原创 2018-03-17 14:18:08 · 290 阅读 · 0 评论 -
1071. Speech Patterns (25)
题目链接:https://www.patest.cn/contests/pat-a-practise/1071#include<bits/stdc++.h> #define cle(n) memset(n,0,sizeof(n)) const int maxn =10100; using namespace std; map<string,int> q; int main...原创 2018-03-17 15:11:05 · 95 阅读 · 0 评论 -
1140. Look-and-say Sequence (20)
1140. Look-and-say Sequence (20)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueLook-and-say sequence is a sequence of integers as the following:D, D1, D111, D113, D11231, D112213111, ... wh...原创 2018-03-18 19:14:18 · 1115 阅读 · 0 评论 -
1141. PAT Ranking of Institutions (25)
1141. PAT Ranking of Institutions (25)时间限制500 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueAfter each PAT, the PAT Center will announce the ranking of institutions based on their students' perfor...原创 2018-03-18 20:32:07 · 348 阅读 · 0 评论 -
1142. Maximal Clique (25)
1142. Maximal Clique (25)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA clique is a subset of vertices of an undirected graph such that every two distinct vertices in the clique are adjac...原创 2018-03-18 21:03:33 · 344 阅读 · 0 评论 -
2018年春季PAT_Advance题解
第一题:1140. Look-and-say Sequence (20)读懂题意,模拟一下就好。题解:http://blog.csdn.net/baidu_32048673/article/details/79603275第二题:1141. PAT Ranking of Institutions (25)结构体排序题解:http://blog.csdn.net/baidu_32048673/art...原创 2018-03-18 21:12:39 · 1028 阅读 · 0 评论 -
1051. Pop Sequence (25)
1051. Pop Sequence (25)时间限制100 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You ar...原创 2018-03-12 19:22:29 · 95 阅读 · 0 评论 -
1143. Lowest Common Ancestor (30)
1143. Lowest Common Ancestor (30)见过最简单的一个代码#include<bits/stdc++.h> using namespace std; int n,m,u,v,a; map<int,bool>q; int main(){ scanf("%d%d",&m,&n); vector<int>pr...转载 2018-03-18 22:15:07 · 600 阅读 · 0 评论 -
1133. Splitting A Linked List (25)
题目链接:1133. Splitting A Linked List (25)#include<bits/stdc++.h> const int maxn =100100; using namespace std; struct Node { int data,next; }q[maxn]; int st,n,k,a; vector<int>v[3]; int m...原创 2018-03-29 18:21:12 · 162 阅读 · 0 评论 -
1074. Reversing Linked List (25)
题目链接:1074. Reversing Linked List (25)#include<bits/stdc++.h> const int maxn =100100; using namespace std; int n,k,sum,first,add,data[maxn],next1[maxn],list1[maxn],result[maxn]; int main(){ ...原创 2018-03-24 10:53:36 · 234 阅读 · 0 评论 -
1054. The Dominant Color (20)
题目链接:1054. The Dominant Color (20)map的使用#include<bits/stdc++.h> const int maxn =100100; using namespace std; int n,m,len; string s,ans; map<string,int>q; int main(){ char a[24]; s...原创 2018-03-20 18:34:36 · 101 阅读 · 0 评论 -
1055. The World's Richest (25)
题目链接:1055. The World's Richest (25)结构体排序#include<bits/stdc++.h> const int maxn =100100; using namespace std; int n,k,m,st,en; struct Node{ string name; int age; int net; bool op...原创 2018-03-20 19:12:22 · 215 阅读 · 0 评论 -
1084. Broken Keyboard (20)
题目链接:1084. Broken Keyboard (20) #include<bits/stdc++.h> const int maxn =100100; using namespace std; int len1,len2; char change(char t){ if(t>='a'&&t<='z')t-=32; return t;...原创 2018-03-21 18:50:15 · 111 阅读 · 0 评论 -
1023. Have Fun with Numbers (20)
题目链接:https://www.patest.cn/contests/pat-a-practise/1023水题 #include<bits/stdc++.h> const int maxn =10100; using namespace std; string s1,s2; int num1[11],num2[11]; string fun(string s){ strin...原创 2018-03-17 08:51:40 · 115 阅读 · 0 评论 -
L1-046. 整除光棍
L1-046. 整除光棍时间限制400 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者翁恺这里所谓的“光棍”,并不是指单身汪啦~ 说的是全部由1组成的数字,比如1、11、111、1111等。传说任何一个光棍都能被一个不以5结尾的奇数整除。比如,111111就可以被13整除。 现在,你的程序要读入一个整数x,这个整数一定是奇数并且不以5结尾。然后,经过计算,输出两个...原创 2018-03-10 23:22:18 · 127 阅读 · 0 评论 -
1036. Boys vs Girls (25)
https://www.patest.cn/contests/pat-a-practise/1036水题,结构体找出最大值最小值#include<bits/stdc++.h> using namespace std; typedef long long ll; struct Node{ string name; char sex; string id; ...原创 2018-03-10 21:32:25 · 151 阅读 · 0 评论 -
pat 1004. Counting Leaves (30)
1004. Counting Leaves (30) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A family hierarchy is usually presented by a原创 2018-01-24 15:34:14 · 133 阅读 · 0 评论 -
pat 1003. Emergency (25)
1003. Emergency (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue As an emergency rescue team leader of a city, yo原创 2018-01-24 15:39:02 · 136 阅读 · 0 评论 -
PAT Advance 1005、1006
///1005 简单字符串处理 #include using namespace std; vectorq; mapnum; int main() { num[0]="zero"; num[1]="one"; num[2]="two"; num[3]="three"; num[4]="four"; num[5]="five"; num[6]=原创 2018-01-24 15:41:58 · 155 阅读 · 0 评论 -
PAT (Advanced Level) 1008
水题,模拟题 #include using namespace std; const int maxn =10010; int n,a[maxn]; int ans=0; int main() { while(scanf("%d",&n)!=EOF){ memset(a,0,sizeof(a)); for(int i=0;i<n;i++)scanf("%d原创 2018-02-06 12:05:04 · 145 阅读 · 0 评论 -
1015. Reversible Primes (20)
进制转换+低范围素数判定///1015 #include<bits/stdc++.h> using namespace std; int zhuanhuan1(int n,int d) { string s; while(n){ int t=n%d; char c=t+'0'; s+=c; n/=d; ...原创 2018-02-11 16:04:56 · 130 阅读 · 0 评论 -
1029. Median (25)
排序#include<bits/stdc++.h> using namespace std; typedef long long ll; ll a[2000001]; int main() { int n,len,i=0; scanf("%d",&n); len=n; for(i=0;i<n;i++)scanf("%lld",&a[...原创 2018-02-13 18:27:41 · 115 阅读 · 0 评论 -
1009. Product of Polynomials (25)
This 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...原创 2018-02-08 15:53:05 · 130 阅读 · 0 评论 -
1100. Mars Numbers (20)
题目链接:点击打开链接 #include<bits/stdc++.h> using namespace std; typedef long long ll; string gewei[13]={"tret","jan", "feb", "mar", "apr", "may", "jun", "jly", "aug原创 2018-03-15 18:04:52 · 91 阅读 · 0 评论 -
1092. To Buy or Not to Buy (20)
题目链接:https://www.patest.cn/contests/pat-a-practise/1092#include<bits/stdc++.h> using namespace std; string s1,s2; int num1[256]={0},num2[256]={0}; int main(){ int flag=1; int cnt=0; ...原创 2018-03-16 18:40:58 · 110 阅读 · 0 评论 -
1093. Count PAT's (25)
题目链接:https://www.patest.cn/contests/pat-a-practise/1093简单题#include<bits/stdc++.h> typedef long long ll; using namespace std; const int maxn =100100; const int mod=1000000007; string s; int P,T; ...原创 2018-03-16 19:09:52 · 109 阅读 · 0 评论 -
1094. The Largest Generation (25)
题目链接:https://www.patest.cn/contests/pat-a-practise/1094dfs#include<bits/stdc++.h> const int maxn =10010; using namespace std; vector<vector<int> >mp; int n,m,a,k,t,maxt; int level[ma...原创 2018-03-16 20:47:17 · 92 阅读 · 0 评论 -
1019. General Palindromic Number (20)
题目链接:https://www.patest.cn/contests/pat-a-practise/1019水题#include<bits/stdc++.h> const int maxn =100010; using namespace std; int n,m; int a[maxn]; int cnt=0; int main(){ cin>>n>&g...原创 2018-03-16 21:46:27 · 97 阅读 · 0 评论 -
最长回文子串 1040. Longest Symmetric String (25)
1040. Longest Symmetric String (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given a string, you are supposed to output the length of the longest symmetric sub...原创 2018-03-10 21:08:52 · 142 阅读 · 0 评论 -
1144. The Missing Number (20)
题目链接:1144. The Missing Number (20)水题#include<bits/stdc++.h> const int maxn =100100; using namespace std; int n,a[maxn],t; int main(){ scanf("%d",&n); for(int i=0;i<n;i++){ s...原创 2018-03-26 20:16:01 · 142 阅读 · 0 评论