上一页 1 2 3 4 5 6 7 8 9 10 ··· 31 下一页

2016年3月31日

codeforces 659D . Bicycle Race 几何

摘要: 题目链接 对相邻的三个点叉积判断一下就好。 include include include include include include include include include include include include include using namespace std; def 阅读全文

posted @ 2016-03-31 11:11 yohaha 阅读(194) 评论(0) 推荐(0) 编辑

codeforces 659E . New Reform 强连通

摘要: 题目链接 对于每一个联通块, 如果有一个强连通分量, 那么这个联通块对答案的贡献就是0。 否则对答案贡献是1. include include include include include include include include include include include includ 阅读全文

posted @ 2016-03-31 11:09 yohaha 阅读(120) 评论(0) 推荐(0) 编辑

2016年3月30日

codeforces 552 E. Vanya and Brackets 表达式求值

摘要: 题目链接 讲道理距离上一次写这种求值的题已经不知道多久了。 括号肯定是左括号在乘号的右边, 右括号在左边。 否则没有意义。 题目说乘号只有15个, 所以我们枚举就好了。 include include include include include include include include i 阅读全文

posted @ 2016-03-30 21:23 yohaha 阅读(123) 评论(0) 推荐(0) 编辑

codeforces 553D . Nudist Beach 二分

摘要: 题目链接 有趣的题。 给一个图, n个点m条边。 有k个点不可选择。 现在让你选出一个非空的点集, 使得点集中strength最小的点的strength最大。 strength的定义:一个点周围的点中在集合里的点/一个点周围的点。 我们二分这个strength值。 每次二分, 我们遍历每个点, 然后 阅读全文

posted @ 2016-03-30 19:32 yohaha 阅读(218) 评论(0) 推荐(0) 编辑

poj 3378 Crazy Thairs dp+线段树+大数

摘要: 题目链接 题目大意: 给出n个数, 让你求出有多少个5元组满足 i include include include include include include include include include include include include include using namesp 阅读全文

posted @ 2016-03-30 15:07 yohaha 阅读(126) 评论(0) 推荐(0) 编辑

2016年3月28日

高精度 java的一些题

摘要: poj 1001 Exponentiation poj 1503 Integer Inquiry 大数加法 hdu 1042 N! 大数乘法 hdu 1316 How Many Fibs? 大数乘法, 求给出的两个数之间有多少个fib数 import java.util. ; import java 阅读全文

posted @ 2016-03-28 23:13 yohaha 阅读(148) 评论(0) 推荐(0) 编辑

hdu 5637 Transform 最短路

摘要: 题目链接 异或的性质。 求s到t的最少步骤, 等价于求0到s^t的最少步骤。 通过最少的步骤达到s^t的状态, 等价于求0到s^t的最短路。 先将最短路求出来然后O(1)查询。 阅读全文

posted @ 2016-03-28 20:34 yohaha 阅读(126) 评论(0) 推荐(0) 编辑

hdu 5649 DZY Loves Sorting 二分+线段树

摘要: 题目链接 给一个序列, 两种操作, 一种是将[l, r]里所有数升序排列, 一种是降序排列。 所有操作完了之后, 问你a[k]等于多少。 真心是涨见识了这题..好厉害。 因为最后只询问一个位置, 所以我们二分这个位置的值。 将所有大于等于它的值赋为1, 小于的赋为0. 然后现在整个序列只有01, 更 阅读全文

posted @ 2016-03-28 19:29 yohaha 阅读(153) 评论(0) 推荐(0) 编辑

project euler 48 Self powers 解决乘法爆long long

摘要: 题目链接 求 $ 1^1+2^2+\cdots + 1000^{1000} $ %1e10 的结果。 唯一的坑点是会爆longlong, 所以用特殊的乘法。 include include include include include include include include include 阅读全文

posted @ 2016-03-28 16:01 yohaha 阅读(288) 评论(0) 推荐(0) 编辑

hdu 5654 xiaoxin and his watermelon candy 莫队

摘要: 题目链接 求给出的区间中有多少个三元组满足i+1=j=k 1 && a[i] include include include include include include include include include include include include using namespace 阅读全文

posted @ 2016-03-28 12:27 yohaha 阅读(133) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 10 ··· 31 下一页

导航