自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

L_Aster的专栏

相逢的人会再相逢

  • 博客(15)
  • 收藏
  • 关注

原创 1082. Read Number in Chinese (25)

1082. Read Number in Chinese (25)自己不想写了,完全copy的别人的代码,加了点注释 [原地址1082. Read Number in Chinese (25) ](http://blog.csdn.net/kakitgogogo/article/details/52021994) #include <iostream> #include <string> using

2017-01-30 14:59:07 422

原创 1079. Total Sales of Supply Chain (25)

1079. Total Sales of Supply Chain (25)dfs方法https://github.com/GLAster/PAT-Advanced-Level/blob/master/1079.%20Total%20Sales%20of%20Supply%20Chain%20(25).cpp#include <iostream> #include <cmath> #include

2017-01-30 13:21:14 494

原创 1112. Stucked Keyboard (20)

1112. Stucked Keyboard (20) 思路:只要满足连续相同字符个数不是k的整数倍,那么一定是好键 #include &lt;bits/stdc++.h&gt; using namespace std; bool isWell[178],isprt[178]; int k,i; char keys[1024]; string poskeys,ans; int main() {...

2017-01-30 10:47:25 306

原创 C++ sort()函数和C qsort()函数用法总结

C++sort函数 头文件:#include <algoritnm>用法:sort(begin,end,method);//如果method缺省,则默认从小到大排序用法示例: 1.缺省用法:从小到大排序 int a[]={2,3,10,7,8,1,0,12};//数组 sort(a,a+8); for(int i=0;i!=8;++i) cout<<a[i]

2017-01-29 22:13:35 1448

原创 1114. Family Property (25)

1114. Family Property (25)#include <iostream> #include <vector> #include <map> #include <cstdio> #include <algorithm> using namespace std; struct family { vector<int> memid; int estate; int

2017-01-29 21:05:17 387

原创 1106. Lowest Price in Supply Chain (25)

1106. Lowest Price in Supply Chain (25) #include &lt;iostream&gt; #include &lt;cstdio&gt; #include &lt;vector&gt; #include &lt;algorithm&gt; using namespace std; int n,cnt,mindepth=0x7fffffff; doub...

2017-01-28 12:58:23 273

原创 1101. Quick Sort (25)

1101. Quick Sort (25)#include <stdio.h> #include <stdlib.h> #define N 100000+10 #define Min -1 #define Max 1000000000+10 int comp(const void*a,const void*b) { return (*(int*)a)-(*(int*)b); } int ma

2017-01-28 11:56:52 284

原创 1113. Integer Set Partition (25)

1113. Integer Set Partition (25)#include <stdio.h> #include <stdlib.h> int comp(const void*a,const void*b) { return (*(int*)a)-(*(int*)b); } int main() { int n,set[100000+10]; scanf("%d",&n

2017-01-28 10:18:58 332

原创 1117. Eddington Number(25)

1117. Eddington Number(25) 题解:乙级

2017-01-26 15:34:12 319

原创 排序算法之归并排序<Merge_Sort>及其C语言代码实现

概述:额,还是举个栗子吧: 初始序列[ 98 , 1 , 23 , 4 , 2 , 9 , 8 , 18]//第一步[ 98 | 1 | 23 | 4 | 2 | 9 | 8 | 18] //第二步[ 1 98 | 4 23 | 2 9 | 8 18] //第三步[ 1 4 23 98 | 2 8 9 18] //第三步[ 1 2 4 9

2017-01-26 15:24:44 13442 1

原创 并查集

关于并查集,网上已经有许多相应介绍,推荐一篇不错的文章并查集详解 (转) ; 一个PAT题目应用到并查集的例子:1118. Birds in Forest (25) 题解:1118. Birds in Forest (25) 并查集的三个操作函数,现记录如下:void Init();//初始化并查集 int Find(int x);//找到x的根节点 void Union(int x,int

2017-01-26 15:00:42 250

原创 1118. Birds in Forest (25)

1118. Birds in Forest (25)#include <stdio.h> int DalaoSet[10000+8]; void InitDalaoSet() { for(int i=1;i<=10000;++i) DalaoSet[i]=i; } int FindDalao(int x) { int r=x; while(DalaoSet[r

2017-01-26 14:47:49 313

原创 排序算法之堆排序<Heap_Sort>及其C语言代码实现

概述:堆排,实际上是一种选择排序,只不过采用了堆这种数据结构,利用这种数据结构,使得在每次查找最大元素时,直接选取堆顶元素,从而时间大大缩短,相对简单选择排序算法来说,比较高效。 堆排序算法可描述如下: 1.将待排元素依次存入数组,该数组即为一颗完全二叉树; 2.从最后一个非叶节点开始递减,逐次将每个相应的二叉树调整成最大堆,最后,整个二叉树即为最大堆; 3.交换堆顶元素与堆尾元素,调整新的

2017-01-24 13:45:21 7574 1

原创 1098. Insertion or Heap Sort (25)

1098. Insertion or Heap Sort (25)#include <stdio.h> int heap[101]={200}; int a[101],b[101]; void HeapAdjust(int heap[],int s,int e) { int temp=heap[s]; int parent=s,child; while(2*parent<=e

2017-01-07 11:21:23 315

原创 1089. Insert or Merge (25)

1089. Insert or Merge (25) 注:存在等值数据#include <stdio.h> #include <stdlib.h> int n,b[101],a[101]; int comp(const void*a,const void*b) { return *((int*)a)-*((int*)b); } int juge(int s,int e) { if(

2017-01-04 21:41:30 408

空空如也

空空如也

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

TA关注的人

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