摘要:
队列和栈的头文件以及常用函数 #include<stack> 先进后出 using namespace std; stack <类型> s(变量); s.pop() 删除栈顶元素 s.empty() 判断栈是否为空,为空返回1 s.push(i) 将i压入栈中 s.top() 返回栈顶元素 s.si 阅读全文
摘要:
队列和栈的头文件以及常用函数 #include<stack> 先进后出 using namespace std; stack <类型> s(变量); s.pop() 删除栈顶元素 s.empty() 判断栈是否为空,为空返回1 s.push(i) 将i压入栈中 s.top() 返回栈顶元素 s.si 阅读全文
摘要:
埃氏筛法 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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
“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 阅读全文
|