摘要: from PIL import Image ascii_char = list("$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~i!lI;:,\"^`'. ") height=100 weight=100 def get_char(r,g,b,alpha=256): if alpha==0: retur... 阅读全文
posted @ 2018-01-26 14:20 小九xD 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 题目:http://www.51nod.com/onlineJudge/submitDetail.html#!judgeId=427658 先将圆的在X轴上左起点按升序排序,再用二分查找第一个起点比待查找圆的终点大的圆(即相离) 阅读全文
posted @ 2017-12-17 17:03 小九xD 阅读(314) 评论(0) 推荐(0) 编辑
摘要: package test; import java.awt.EventQueue; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.Timer; import javax.swing.JTextField; import javax.swing.JTextArea; import java... 阅读全文
posted @ 2017-12-17 11:12 小九xD 阅读(3049) 评论(0) 推荐(0) 编辑
摘要: http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1007 先把数据分成两组,那么必定有一组趋近于所有数的和/2 我们可以把数的和看成包的重量,每个数看成要放入包的物体,这样就能把问题当作01背包处理,找到小于sum/2的最大 阅读全文
posted @ 2017-12-13 19:57 小九xD 阅读(516) 评论(0) 推荐(0) 编辑
摘要: http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1050 两种情况: 1 最大子段和没有循环 第i个位置的最大子段和由它i-1的最大子段和决定。dp[i-1]>=0,则dp[i]=dp[i-1]+a[i];dp[i-1]<0 阅读全文
posted @ 2017-12-12 19:57 小九xD 阅读(358) 评论(0) 推荐(0) 编辑
摘要: #if _MSC_VER>=1900 #include "stdio.h" _ACRTIMP_ALT FILE* __cdecl __acrt_iob_func(unsigned); #ifdef __cplusplus extern "C" #endif FILE* __cdecl __iob_func(unsigned i) { return __acrt_io... 阅读全文
posted @ 2017-12-10 13:30 小九xD 阅读(614) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://lx.lanqiao.cn/problem.page?gpid=T419 将中缀表达式通过栈转换为后缀表达式 阅读全文
posted @ 2017-12-10 13:22 小九xD 阅读(282) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include using namespace std; struct HT { int weight, parent, l, r, idx; }; bool cmp(HT a, HT b) { return a.weight a, b; cin >> n; for (int i = 0; i > x.w... 阅读全文
posted @ 2017-11-11 21:43 小九xD 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 题目:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1428 先按开始时间排序,可以想象有一些教室(vector),然后有新活动举行,遍历vector看是否有教室活动结束,该教室活动结束就在这个教室举行活动,没有就新开教室 阅读全文
posted @ 2017-10-29 17:55 小九xD 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 题目:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1873 用java的BigDecimal模拟小数,注意构造时候要用string 用split方法分割 . 左右数字来判断第一位是否为0 用stripTrailingZe 阅读全文
posted @ 2017-10-26 22:42 小九xD 阅读(190) 评论(0) 推荐(0) 编辑