YunYan

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2019年7月18日

摘要: 队列和栈的头文件以及常用函数 #include<stack> 先进后出 using namespace std; stack <类型> s(变量); s.pop() 删除栈顶元素 s.empty() 判断栈是否为空,为空返回1 s.push(i) 将i压入栈中 s.top() 返回栈顶元素 s.si 阅读全文
posted @ 2019-07-18 23:31 Target--fly 阅读(135) 评论(0) 推荐(0) 编辑

摘要: 埃氏筛法 o(nlogn) prim[1]=1; for(int i=2;i<=maxn1;i++) if(!prim[i]) { for(int j=2*i;j<=maxn1;j+=i) prim[j]=1; } 欧拉筛法o(n) void inint(){ prime[1]=1; int num 阅读全文
posted @ 2019-07-18 20:11 Target--fly 阅读(182) 评论(0) 推荐(0) 编辑

摘要: Given a sequence 1,2,3,......N, your job is to calculate all the possible sub-sequences that the sum of the sub-sequence is M. InputInput contains mul 阅读全文
posted @ 2019-07-18 16:56 Target--fly 阅读(241) 评论(0) 推荐(1) 编辑

摘要: Limak is a little polar bear. He has n balls, the i-th ball has size ti. Limak wants to give one ball to each of his three friends. Giving gifts isn't 阅读全文
posted @ 2019-07-18 16:35 Target--fly 阅读(151) 评论(0) 推荐(0) 编辑

摘要: “Point, point, life of student!” This is a ballad(歌谣)well known in colleges, and you must care about your score in this exam too. How many points can 阅读全文
posted @ 2019-07-18 16:32 Target--fly 阅读(151) 评论(0) 推荐(0) 编辑