- 博客(19)
- 资源 (3)
- 收藏
- 关注
原创 ExecutorService使用
参考Android API:http://www.android-doc.com/reference/java/util/concurrent/ExecutorService.htmleg:ExcecutorService为线程池接口,将线程加进线程池中,execute后不是马上执行,在不久未来异步执行线程。所以会产生并发问题,需要对线程中的共享资源加锁。import java.uti
2016-08-31 15:07:39 421
原创 nyoj_16_dag
#include#include#includeint n;int a[1100][2];int get[1100][1100];int d[1100];int dp(int i){ if(d[i]>0){ return d[i]; } d[i]=1; int j; for(j=0;j<n;j++){ if(get[i][j]){ int m=dp(j)+1
2016-08-25 01:18:31 204
原创 nyoj skiin代码笔记
#includeint a[1000][1000];int b[1000][1000];int dir[4][2]={0,-1,0,1,-1,0,1,0};int r,c;bool isAhead(int i,int j){ if(i>=0&&i=0&&j<c){ return true; } return false;}int dfs(int i,int j){
2016-08-22 09:51:53 204
原创 nyoj独木舟上的旅行
#include#include#include#includeusing namespace std;int a[500];int visit[500];bool cmp(int a,int b){ return a>b;}int main(){ int t,i,j; cin>>t; while(t--){ memset(visit,0,sizeof(visit)
2016-08-20 23:37:02 269
原创 最小生成树的Prim算法笔记
#includeusing namespace std;const int max=7;const int mm=100;int matrix[max];int edge[max][max];int newedge[max][max];bool visited[max];void insert(int a,int b,int w){ edge[a][b]=edge[b][a]=
2016-08-20 22:58:09 340
原创 nyoj221 Tree
//软件工程的分析方法#include#includeusing namespace std;char a[100],b[100];int v[100];class node{public: char ch; node* left; node* right; node(int c){ ch=c; left=right=NULL; }};node* f(n
2016-08-17 12:12:58 203
原创 Add All
//这里是堆和队列的思想结合#include#includeusing namespace std;int main(){ priority_queue q; int n,i,x; while(cin>>n){ while(!q.empty()){ q.pop(); } if(n==0){ break; } for(i=0;i<n;i++){ c
2016-08-17 08:59:15 404
原创 Printer Queue
#include#include#include#include#includeusing namespace std;class node{public: int x; bool flag; node(int i,bool f):x(i),flag(f){ }};node* a[110];int n,m;void pai(){ //这个函数
2016-08-17 08:58:00 341
原创 看病要排队
#include#include#include#includeusing namespace std;class node{public : int id; int priority; node(int i,int p):id(i),priority(p){ }};bool operator < (const node& a,const node& b){ //注意这
2016-08-17 08:56:34 543
原创 I Can Guess the Data Structure!
#include#include#include#includeusing namespace std;int a[10110][10];int main(){ stack s; queue q; priority_queue pq; int t; while(cin>>t){ int i; while(!s.empty()){ s.pop(); }
2016-08-17 08:54:21 412
原创 POJ3984迷宫问题(搜索)
#include#include#includeusing namespace std;int flag[5][5];int a[5][5];class node{public: int x,y; node(int a,int b):x(a),y(b){ }};stack s;stack s1;void output(){ while(!s.empty()){
2016-08-15 15:42:51 331
原创 重载运算符
#include#includeusing namespace std;class node{public: int x,y,z; node(int a,int b,int c):x(a),y(b),z(c){ }};bool operator > (const node &a,const node &b){ return a.z>b.z;}int main(){ pr
2016-08-14 22:42:11 209
原创 hdu排列2
#include#includeusing namespace std;int a[10];int n;int temp2=a[0];int flag=1;void output(){ int i; for(i=0;i<n;i++){ cout<<a[i]; }}int findMinFromRight(){ //1.从右到左,两个两个比较,直到找到左一个比右一个
2016-08-13 14:18:31 348
原创 net.sf.json.JSONException: Unterminated string at character 1801
在解析json格式数据时,出现此错误。错误意思是没有终结的字符串。原因是原始的字符串的末尾的一段子字符串未处理。
2016-08-12 11:35:38 4721
原创 排名
C++中string的用法 string字符串的使用方法_百度经验 http://jingyan.baidu.com/article/20b68a8854f919796dec6265.html#include#include#includeusing namespace std;int s[10];struct stu{public : char id[100]; int n
2016-08-09 09:59:28 240
原创 相同的雪花(哈希)
#include#include#include#includeusing namespace std;const int N=19373;const int M=100;int a[6];int l[N];int hash[N][M][6];bool Judge(int *a, int *b) //判断雪花形状是否相同(即可以将对应的棱角重合){ int i
2016-08-06 22:31:56 736
原创 红黑树
寒江独钓的博客(红黑树详细讲解):http://www.cnblogs.com/yangecnu/p/Introduce-Red-Black-Tree.html 个人尝试写的红黑树代码://红黑树:1.一个节点有且仅有一条左子女边为红色。特点1:黑色平衡,从根节点到各个叶节点的路径上,黑色边的条数都相同#includeusing namespace std;const bool
2016-08-05 19:16:04 345 1
原创 树的判定(并查集)
并查集:提供对集合的查找(比如找到树的根节点),和对集合的并操作。初始化为各个原子子集合。可通过压缩路径法对该结构进行优化。#include#include#includeusing namespace std;int p[10010];int v[10010];int find(int x){ if(p[x]==-1) return x; return find(p
2016-08-04 18:40:41 304
原创 士兵杀敌(三)
士兵杀敌(三)时间限制:2000 ms | 内存限制:65535 KB描述南将军统率着N个士兵,士兵分别编号为1~N,南将军经常爱拿某一段编号内杀敌数最高的人与杀敌数最低的人进行比较,计算出两个人的杀敌数差值,用这种方法一方面能鼓舞杀敌数高的人,另一方面也算是批评杀敌数低的人,起到了很好的效果。所以,南将军经常问军师小工第i号士兵到第j号士兵中,杀敌
2016-08-03 17:22:55 334
javascript轮播图
2018-01-06
gradle-2.4-all.zip
2017-08-12
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人