![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT Advanced
文章平均质量分 70
勿到
这个作者很懒,什么都没留下…
展开
-
PAT Advanced 1066
1066. Root of AVL Tree (25) 时间限制 100 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue An AVL tree is a self-balancing binary se原创 2013-10-23 00:07:40 · 591 阅读 · 0 评论 -
PAT Advanced 1005
1005. Spell It Right (20) 时间限制 400 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given a non-negative integer N, your task is to com原创 2013-10-23 23:58:59 · 615 阅读 · 0 评论 -
PAT Advanced 1042
#include int a[55]={0}; int b[55]={0}; int c[55]={0}; char d[6]={' ','S','H','C','D','J'}; /*简单的模拟题*/ int main() { int n,i,j; scanf("%d",&n); for(i=1;i<=54;i++) { scanf("%d",&b[i]); a[i]=i; }原创 2013-10-13 11:28:23 · 544 阅读 · 0 评论 -
PAT Advanced 1043
#include #include /*代码效率太低,有待改进*/ int isBST(int *a,int count) { if(count==1 || count==0) return 1; int i,k; for(i=1;i<count;i++) { if(a[i]<a[0]) continue; break; } k=i-1; for(;i<count;原创 2013-10-13 11:25:20 · 548 阅读 · 0 评论 -
PAT Advanced 1001
#include void format(int sum,int count) { if(sum/10!=0) format(sum/10,count+1); if(count%3==0&&sum/10!=0) printf(","); printf("%d",sum%10); } int main() { int a,b; scanf("%d %d",&a,&b); in原创 2013-10-13 11:23:16 · 596 阅读 · 0 评论 -
PAT Advanced 1067
关于这道题,首先要注意的是swap函数只能用swap(0,*),而不是平常我们用的swap(i,j),也是这个原因,第一次做怎么做都是答案错误。 其次来说一下这道题的思路: 题目暗示的swap次数最少,言外之意就是中间没有过多的过渡交换(指的就是中间某个位置的元素多次为其他位置的元素交换做过渡, 典型的像 汉诺塔问题)。看示例{4, 0, 2, 1, 3},正常路线就是,4放到a[4]这个位原创 2013-10-13 11:54:37 · 1131 阅读 · 0 评论 -
PAT Advanced 1065
#include typedef long long int LONG; int main() { int n; scanf("%d",&n); LONG a,b,c,temp; int flag=0,count=0; while(scanf("%lld %lld %lld",&a,&b,&c)!=EOF) { count++; temp=a+b; /* 关键点是大数相加原创 2013-10-13 11:00:45 · 821 阅读 · 0 评论