摘要: 1. 数字三角形,POJ1163,不多说。code:#include<cstdio>#include<iostream>#include<cstring>#include<fstream>#include<cstdlib>#include<memory>#include<algorithm>#definereadfreopen("numtri.in","r",stdin)#definewritefreopen("numtri.out","w& 阅读全文
posted @ 2012-05-23 17:45 追逐. 阅读(174) 评论(0) 推荐(0)
摘要: 1. 恶心的题..考虑了很久没好的想法,看了下报告,直接按图处理即可!搞毛啊,为什么能保证图示能包含所有情况??枚举每个矩形位置和放置情况时用了next_permutation(),next_permutation()是生成下一字典序最小的排列,不包含当前排列,所以一般用do..while()语句。code:#include<cstdio>#include<iostream>#include<cstring>#include<fstream>#include<cstdlib>#include<memory>#include 阅读全文
posted @ 2012-05-23 17:33 追逐. 阅读(167) 评论(0) 推荐(0)
摘要: 1. 简单贪心,价格低的优先考虑。code:#include<cstdio>#include<cstring>#include<fstream>#include<cstdlib>usingnamespacestd;#definereadfreopen("milk.in","r",stdin)#definewritefreopen("milk.out","w",stdout)structnode{intpri,cnt;}q[5001];intcmp(constvoid* 阅读全文
posted @ 2012-05-23 17:19 追逐. 阅读(173) 评论(0) 推荐(0)