POJ 3086 Triangular Sums (ZOJ 2773)】的更多相关文章

http://poj.org/problem?id=3086 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1773 让你计算两个递推式: T(n)=sum[1--n] W(n) = SUM[k = 1-n; k * T(k + 1)] 思路: 直接计算即可. #include<cstdio> const int MAXN=302; int T[MAXN]={0} , w[MAXN]={0}; int main() { f…
POJ :http://poj.org/problem?id=1065 ZOJ: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=25 看大神的代码的研究的... 心情不好该学习还是要学习的....QAQ 其实题目的意思就是把所有元素分为最少的堆数,每堆有l<=l' and w<=w' 按l排序后(l相等则按w),问题转化为把所有元素分为最少的堆数,每堆有w<=w'(l<=l' 显然成立) 即已知一个数列,要求最…
ZOJ:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=312 POJ:http://poj.org/problem?id=1595 题目大意: 给你两个数n和c,如果1~n(包括1和n)之间的素数个数为偶数个,则输出中间c*2个素数否则输出中间c*2-1个素数. 思路: 呀呀呀,玩了一天了,A道水题洗洗睡吧. 直接筛选素数打表. 注意c比1~n的个数大的情况要把1~n中所以素数输出. OK,然后这题1也算素数.. #incl…
最短路变形或最大生成树变形. 问 目标两地之间能通过的小重量. 用最短路把初始赋为INF.其它为0.然后找 dis[v]=min(dis[u], d); 生成树就是把最大生成树找出来.直到出发和终点能沟通的时候,最小的边就是. Kruskal: #include<cstdio> #include<cstring> #include<string> #include<queue> #include<algorithm> #include<ma…
两题二分图匹配的题: 1.一个农民有n头牛和m个畜栏,对于每个畜栏,每头牛有不同喜好,有的想去,有的不想,对于给定的喜好表,你需要求出最大可以满足多少头牛的需求. 2.给你学生数和课程数,以及学生上的课,如果可以做到每个学生代表不同的课程并且所有的课程都被代表输出"YES"(学生能代表一门课当且仅当他上过). 1.POJ 1274 The Perfect Stall http://poj.org/problem?id=1274 和上一题过山车一样,也是二分图匹配的. 水题. #incl…
Triangular Sums 时间限制:3000 ms  |  内存限制:65535 KB 难度:2   描述 The nth Triangular number, T(n) = 1 + … + n, is the sum of the first n integers. It is the number of points in a triangular array with n points on side. For example T(4): XX X X X X X X X X Wri…
传送门: poj:http://poj.org/problem?id=1979 zoj:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1165 题目大意: 给你初始坐标,标记为'#'的格子不能走,求你能走的所有格子的个数(能走的为'.',初始坐标用'@'表示) 思路: 一看直接DFS就好了嘛.... 好几天没刷题了,回到家来水一发先~ #include<cstdio> #include<cstring> con…
Mobile phones Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 14489   Accepted: 6735 Description Suppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. The area is divided into squares. The…
Mobile phones Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 14391   Accepted: 6685 Description Suppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. The area is divided into squares. The…
POJ   1681---Painter's Problem(高斯消元) Description There is a square wall which is made of n*n small square bricks. Some bricks are white while some bricks are yellow. Bob is a painter and he wants to paint all the bricks yellow. But there is something…