上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 57 下一页

2017年4月17日

csu 1552: Friends 二分图 + Miller_Rabin

摘要: http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1552 把那n个数写两次,分成相同的两堆,判断相加是质数的,连一条边,然后找最大匹配,ans = 最大匹配 / 2 做的时候一直超时,原来是Miller_Rabin的quick_pow那里需要qu 阅读全文

posted @ 2017-04-17 09:48 stupid_one 阅读(190) 评论(0) 推荐(0) 编辑

2017年4月16日

Gym - 101147J Whistle's New Car 树上差分

摘要: J. Whistle's New Car time limit per test 15 seconds memory limit per test 512 megabytes input car.in output standard output J. Whistle's New Car time 阅读全文

posted @ 2017-04-16 16:12 stupid_one 阅读(299) 评论(0) 推荐(0) 编辑

2017年4月14日

Codeforces Round #202 (Div. 1) A. Mafia 推公式 + 二分答案

摘要: http://codeforces.com/problemset/problem/348/A A. Mafia time limit per test 2 seconds memory limit per test 256 megabytes input standard input output 阅读全文

posted @ 2017-04-14 21:00 stupid_one 阅读(259) 评论(0) 推荐(0) 编辑

B. Apple Tree 暴力 + 数学

摘要: http://codeforces.com/problemset/problem/348/B 注意到如果顶点的数值确定了,那么它分下去的个数也就确定了,那么可以暴力枚举顶点的数值。 顶点的数值是和LCM相隔的,LCM就是,比如1有三个子节点,那么1的数值起码都是3的倍数,不然不能整除。 同理,1有三 阅读全文

posted @ 2017-04-14 18:26 stupid_one 阅读(212) 评论(0) 推荐(0) 编辑

2017年4月13日

wmq的队伍 BIT优化dp

摘要: http://oj.xjtuacm.com/problem/14/ wmq的队伍 发布时间: 2017年4月9日 17:06 最后更新: 2017年4月9日 17:07 时间限制: 2000ms 内存限制: 512M 描述 交大上课需要打卡,于是在上课前的几分钟打卡机前往往会排起长队。 平时早睡早起 阅读全文

posted @ 2017-04-13 21:31 stupid_one 阅读(476) 评论(0) 推荐(0) 编辑

2017年4月10日

ZOJ Seven-Segment Display 暴力dfs + 剪枝

摘要: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3954 A seven segment code of permutation p is a set of seven segment code derived from th 阅读全文

posted @ 2017-04-10 23:56 stupid_one 阅读(201) 评论(0) 推荐(0) 编辑

Codeforces Beta Round #12 (Div 2 Only) D. Ball 树状数组查询后缀、最值

摘要: http://codeforces.com/problemset/problem/12/D 这里的BIT查询,指的是查询[1, R]或者[R, maxn]之间的最值,这样就够用了。 设三个权值分别是b[1], b[2], b[2]; 首先,先把b[1]值离散化,离散成一个个id,那么只能是在id比较 阅读全文

posted @ 2017-04-10 19:39 stupid_one 阅读(225) 评论(0) 推荐(0) 编辑

51NOD 1202 子序列个数 DP

摘要: http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1202&judgeId=225600 这题看起来挺复杂,但是真正的dp还是挺好理解的。唯独是想不到的,应该把样例模拟一遍。 比如1、2、4、2 考虑第一个,只有“1”这一个子 阅读全文

posted @ 2017-04-10 00:05 stupid_one 阅读(257) 评论(0) 推荐(0) 编辑

2017年4月9日

ZOJ Saddle Point 数学思维题

摘要: http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5564 根据它的定义是行最小,列最大。 可以证明鞍点是唯一的。 单独考虑每一个元素的贡献,它能成为鞍点的情况有: 1、在这一行中,<= a[i][j]的元素肯定要删除 阅读全文

posted @ 2017-04-09 22:45 stupid_one 阅读(611) 评论(0) 推荐(0) 编辑

ZOJ How Many Nines 模拟 | 打表

摘要: If we represent a date in the format YYYY-MM-DD (for example, 2017-04-09), do you know how many 9s will appear in all the dates between Y1-M1-D1 and Y 阅读全文

posted @ 2017-04-09 22:20 stupid_one 阅读(349) 评论(0) 推荐(0) 编辑

上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 57 下一页

导航