会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Evence
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
3
4
5
6
7
8
9
10
11
···
13
下一页
2015年3月6日
PAT:1015. Reversible Primes (20) AC
摘要: #include#include#includeusing namespace std;int D[111]; //存放拆解的数字int DI=0; //D的数组下标bool isPrime(int n){ if(n<=1) return 0; int ...
阅读全文
posted @ 2015-03-06 11:48 Evence
阅读(111)
评论(0)
推荐(0)
2015年3月5日
PAT:1019. 数字黑洞 (20) AC(同甲级1069)
摘要: #include#includeusing namespace std;const int AIM=6174;int n;int arr[4];bool NonIncreasingOrder(int a,int b){ return a>b;}bool NonDecreasingOrder(int...
阅读全文
posted @ 2015-03-05 20:08 Evence
阅读(462)
评论(0)
推荐(0)
PAT:1069. The Black Hole of Numbers (20) AC
摘要: #include#includeusing namespace std;const int AIM=6174;int n;int arr[4];bool NonIncreasingOrder(int a,int b){ return a>b;}bool NonDecreasingOrder(int...
阅读全文
posted @ 2015-03-05 20:06 Evence
阅读(100)
评论(0)
推荐(0)
PAT:1008. Elevator (20) AC
摘要: #includeint main(){ int n,ans=0,now=0; //要停n层,ans是总时间,now代表当前层数 scanf("%d",&n); for(int i=0 ; inow) //上楼,每上一层6秒 { ans+=(tmp...
阅读全文
posted @ 2015-03-05 17:24 Evence
阅读(104)
评论(0)
推荐(0)
PAT:1052. Linked List Sorting (25) 部分错误
摘要: #include#include#includeusing namespace std;struct node{ int address; int data; int next; bool tag;}Node[100066];bool cmp(node a,node b){ re...
阅读全文
posted @ 2015-03-05 12:14 Evence
阅读(128)
评论(0)
推荐(0)
PAT:1032. Sharing (25) AC
摘要: #include#include#includestruct node{ char data; int next; bool tag;}Node[100066];int main(){ int add1,add2,n; //连表1首地址, scanf("%d%d%d",&...
阅读全文
posted @ 2015-03-05 03:16 Evence
阅读(125)
评论(0)
推荐(0)
PAT:1059. Prime Factors (25) AC
摘要: #include#include#include#includeusing namespace std;const int MAX=100010; //int型素数一定在这个范围内int PrimeArr[MAX]; //素数表int cnt=0; //...
阅读全文
posted @ 2015-03-05 01:25 Evence
阅读(175)
评论(0)
推荐(0)
2015年3月4日
素数表(筛选法)
摘要: #include#includeusing namespace std;bool arr[101]; //标记是否为素数:false就是素数,true就不是素数void isF(){ for(int i=2 ; i<101 ; ++i) { if(arr[i]==false) ...
阅读全文
posted @ 2015-03-04 16:09 Evence
阅读(199)
评论(0)
推荐(0)
PAT:1048. Find Coins (25)(双指针法) AC
摘要: #include#includeusing namespace std;int arr[100066];int main(){ int n,m; scanf("%d%d",&n,&m); for(int i=0 ; i<n ; ++i) scanf("%d",&arr[i]); sor...
阅读全文
posted @ 2015-03-04 01:42 Evence
阅读(112)
评论(0)
推荐(0)
PAT:1048. Find Coins (25)(二分查找) AC
摘要: #include#includeusing namespace std;int arr[100066];int FIND(int l,int r,int aim) //二分查找,从l到r,查找aim{ int mid; while(l<=r) { mid=(l+r)/2; i...
阅读全文
posted @ 2015-03-04 01:28 Evence
阅读(96)
评论(0)
推荐(0)
上一页
1
···
3
4
5
6
7
8
9
10
11
···
13
下一页