-
/*
http://blog.csdn.net/lcl_data/article/details/12117349
按照目的来分,设计模式可以分为创建型模式、结构型模式和行为型模式。5+7+11=23
【创建型模】式用来处理对象的创建过程;结构型模式用来处理类或者对象的组合;行为型模式用来对类或对象怎样交互和怎样分配职责进行描述。
创建型模式用来处
-
一种简单实现并查集;类封装,如果可以动态地开辟 就较好一点
#include <iostream>
using namespace std;
/*
对与n个元素间是否有关系
请自动将1-n序列一一与之对应
下面进行数组操作
*/
#define n 10// 本例 最大1
-
#include <bits/stdc++.h>
using namespace std;
void prem(int list[],int k,int m)
{
if(k==m)
{
 
-
/*
题目描述
有一个int数组arr其中只含有1、2和3,分别代表所有圆盘目前的状态,1代表左柱,2代表中柱,3代表右柱,arr[i]的值代表第i+1个圆盘的位置。比如,arr=[3,3,2,1],代表第1个圆盘在右柱上、第2个圆盘在右柱上、第3个圆盘在中柱上、第4个圆盘在左柱上。如果arr代表的状态是最优移动轨迹过程中出现的状态,返回arr这种状态是最优移动轨迹中的第几个状态。如果arr代表
-
#include <bits/stdc++.h>
using namespace std;
typedef struct node
{
int x;
node*next;
node(){next=NULL;}
}nod
-
/*
二叉树小练习 子数组 8皇后92种情况
*/
#include<bits/stdc++.h>
using namespace std;
#include <iostream>
using namespace std;
-
Q:N次正确操作后栈还是为空的操作序列。 #include<bits/stdc++.h>using namespace std;int pow1(int n,int x){ int m=n; while(x-->1) &
-
/*
文档较长 注意这分区
文档包括
哈希表平面点距
字典项目
排序等
ncurses库测试
*/
☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
★ │ 心想 │ 事成 │
☆ ╭═╮  
-
moremore :http://blog.csdn.net/wusecaiyun/article/details/48947595 Given a circle on a two-dimentional plane.Output the integral point in or on the b
-
//百万数内 看数列离散点 根据 x 找接近 的数列数
#include<bits/stdc++.h>
using namespace std;
int funsteap(int xx)
{
 
-
关于一些取点,数组下标等等的处理数组下标来源于STL的代码思考2点技术:x !!X 这个可以让 不是0 的数全返回 1【8 16 24 32 数组分段是这样的话】X(X+7)/8-1 这个可以找到对应的下标值X二进制编码相关 128 64 32 16 8 4 2
-
#include <bits/stdc++.h>
using namespace std;
int judge_palindrome(string s)
{
string tmp=s;&nbs
-
-
/*
本算法的缺点 在于开的空间太大
分三类情况
线段
(-10,-1)在负区间
(-10,10)双区间
(1,10)正区间
一下给出正区间的代码,已考虑小数
思路是
绝对正区间,覆盖到数轴 sz[]数组上 小数部分 用sum1 累计
*/
#include&nbs
-
#include <iostream>
using namespace std;
//自己坐标 敌人的坐标(a,b)
double a[6]={0,1,2,3,4,5};
double b[6]={0,1,2,3,4,5};
double c[6]={999};
int who=0;
void
-
#include<bits/stdc++.h>
using namespace std;
char fun(char s[])
{
char ret='\0';
if(s==NULL) 
-
/*http://blog.csdn.net/feliciafay/article/details/17238611
http://www.cnblogs.com/glorywu/p/5256968.html
*/
#include<bits/stdc++.h>
using namespace std;
-
/*
ABC XYZ abc xyz
i j
i指向A if a[i]>=a i++
 
-
/*************************
【题目】 未排序正数数组中累加和为给定值的最长子数组长度
给定一个数组 arr,该数组无序,但每个值均为正数,再给定一个正数 k。求 arr
的所有子数组中所有元素相加和为 k 的最长子数组长度。
例如,arr=[1,2,1,1,1],k=3。
累加和为 3 的最长
-
//#include "header.h" //AnycodeX includes the header.h by default, needn't cancle the notation.
#include <iostream>