• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
FightingForWorldFinal
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 ··· 4 5 6 7 8 9 10 下一页
2013年7月19日
容器使用之vector
摘要: 出处:http://blog.csdn.net/edify/article/details/4035243C++内置的数组支持容器的机制,但是它不支持容器抽象的语义。要解决此问题我们自己实现这样的类。在标准C++中,用容器向量(vector)实现。容器向量也是一个类模板。 标准库vector类型使用需要的头文件:#include 。vector 是一个类模板。不是一种数据类型,vector是一种数据类型。Vector的存储空间是连续的,list不是连续存储的。一、 定义和初始化 vector v1; //默认v1为空,故下面的赋值是错误的v1[0]=5; vectorv2(v1); 或v2=v 阅读全文
posted @ 2013-07-19 10:47 Sky-J 阅读(468) 评论(0) 推荐(0)
hdu1231最大连续子序列DP/两点法
摘要: 最大连续子序列Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 15168Accepted Submission(s): 6624 Problem Description给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ..., Nj },其中 1 6 #include 7 #define MAX 10005 8 using namespace std; 9 10 int main().. 阅读全文
posted @ 2013-07-19 10:35 Sky-J 阅读(276) 评论(0) 推荐(0)
2013年7月18日
容器之set使用
摘要: D -Problem DTime Limit:2000MSMemory Limit:0KB64bit IO Format:%lld & %lluSubmitStatusDescriptionWith water from the stream Galadriel filled the basin to the brim, and breathed on it, and when the water was still again she spoke. 'Here is the Mirror of Galadriel,' she said. 'I have bro 阅读全文
posted @ 2013-07-18 14:13 Sky-J 阅读(251) 评论(0) 推荐(0)
2013年7月17日
HDU1059 DP模板
摘要: #includeint dp[120005];int V,v;void bag01(int c,int w)//01背包{for(v=V; v>=c; v--)if(dp[v]=V)bagall(c,w);else{int k=1;while(k<p){bag01(c*k,w*k);p=p-k;k=k+k;}bag01(c*p,w*p);}}int main(){int n[8];int i,sum,p=0;while(scanf("%d%d%d%d%d%d",&n[1],&n[2],&n[3],&n[4],&n[5],& 阅读全文
posted @ 2013-07-17 21:50 Sky-J 阅读(256) 评论(0) 推荐(0)
HDU1175连连看 广度优先搜索BFS
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 using namespace std ; 15 #ifdef DeBUG 16 #define bug assert 17 #else 18 #define bug // 19 #endif 20 #define zero {0} 21 int dir... 阅读全文
posted @ 2013-07-17 13:09 Sky-J 阅读(403) 评论(0) 推荐(0)
2013年7月16日
HDUOJ2648 容器的使用之map
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 using namespace std ;15 #ifdef DeBUG16 #define bug assert17 #else18 #define bug //19 #endif20 #define zero {0}21 struct shop22 {23 string... 阅读全文
posted @ 2013-07-16 20:25 Sky-J 阅读(264) 评论(0) 推荐(0)
HDU2094容器使用之set
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int main() 7 {//freopen("C:\\Users\\Sky\\Desktop\\1.in","r",stdin); 8 int n,i; 9 string s1,s2;10 seta,b;11 set::iterator it;12 while(cin>>n,n)13 {14 for(i=1;i>s1>>s2;17 a.insert(s1);18 ... 阅读全文
posted @ 2013-07-16 16:00 Sky-J 阅读(188) 评论(0) 推荐(0)
2013年7月13日
HDUOJ 1392凸包graham算法
摘要: #include #include #include #include #include using namespace std;const int Max = 1100;struct Point{ int x; int y;};int num;Point p[Max]; ///原始点集Point ch[Max]; ///凸包点集///p0p1叉乘p0p2int xmult(const Point &p0, const Point &p1, const Point &p2){ return (p1.x-p0.x)*(p2.y-p0.y) - (p2.x-p0.x)*(p 阅读全文
posted @ 2013-07-13 22:23 Sky-J 阅读(1195) 评论(1) 推荐(2)
HDU1292 i个不同元素分成j堆的分法
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include11 #include12 using namespace std ;13 #ifdef DeBUG14 #define bug assert15 #else16 #define bug //17 #endif18 19 int main()20 {21 #ifdef DeBUG22 freopen("C:\\Users\\Sky\\D... 阅读全文
posted @ 2013-07-13 17:21 Sky-J 阅读(254) 评论(0) 推荐(0)
快速幂,就当个模板了
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include11 #include12 using namespace std ;13 #ifdef DeBUG14 #define bug assert15 #else16 #define bug //17 #endif18 int pow3(int a, int b)19 {20 int r = 1, base = a;21 while(b != 0)... 阅读全文
posted @ 2013-07-13 08:11 Sky-J 阅读(231) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3