随笔分类 - ACM - 其他 - 水题
摘要:链接 : "Here!" 思路 : 水题 代码 : c++ include include include include using namespace std; struct info { int ages; string id; }; int n, m; bool cmp(info a, in
阅读全文
摘要:POJ 1064 Cable master(二分) 题意: 现在有 个绳子,需要这 条绳子切割成 段,问长切割方案是什么. 思路: 因为长度的范围在 之间,所以不可能去枚举一个长度,只能去二分一个长度并且判断该 个绳子截取该长度能截取的个数. / File Name: 1064 Cable mast
阅读全文
摘要:链接: "传送门" 题意: 求最小生成树中的权值最大边 / File Name: poj2395.cpp Author: WArobot Blog: http://www.cnblogs.com/WArobot/ Created Time: 2017年06月19日 星期一 19时00分25秒 / i
阅读全文
摘要:链接: "传送门" 题意: 给 n 个点 , m 个关系,求这些关系的最大生成树,如果无法形成树,则输出 1 思路: 输入时将边权转化为负值就可以将此问题转化为最小生成树的问题了 / File Name: poj2377.cpp Author: WArobot Blog: http://www.cn
阅读全文
摘要:链接: "传送门!" 题意: 一个裸最小生成树,采用Kruskal。 / File Name: poj1258.cpp Author: WArobot Blog: http://www.cnblogs.com/WArobot/ Created Time: 2017年06月19日 星期一 18时20分
阅读全文
摘要:链接: "传送门" 题意: 给两个向量 v1 = { x1 , x2 , x3 , x4 .... } , v2 = { y1 , y2 , y3 , y4 ...... } 允许任意交换 v1 和 v2 各自向量的分量顺序,计算 v1,v2 内积 ( x1 y1 + x2 y2 .... )的最小
阅读全文
摘要:链接: "传送门" 思路: 裸 Floyd / File Name: codevs1077.cpp Author: WArobot Blog: http://www.cnblogs.com/WArobot/ Created Time: 2017年06月14日 星期三 20时20分57秒 / incl
阅读全文
摘要:链接: "传送门" 题意: 判断 m 组数,如果某一组中出现负数就判断这一组中是否存在与之相反的数,如果每一组中都满足要求则输出 "NO" 反之输出 "YES" 思路: 对于任意的一组数,if v[i] File Name: Codeforces787B.cpp Author: WArobot Bl
阅读全文
摘要:链接: "传送门" 题意: 这个人每次都去公园捡石子,她有两个口袋,每个口袋最多装 k 个石子,公园有 n 种石子,每种石子 w[i] 个,询问最少几天能将石子全部捡完 思路: 排个序,尽量每天都多装,如果 k w[i] ,那就直接将石子全部放入口袋,如果 k File Name: Codeforc
阅读全文
摘要:链接: "传送门" 题意: 现在给出 Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n 1) + F(n 2) (n =2). 问第 n 项能不能整除 3 思路: F(n) % 3 == 0 可以推导出 F(n) = ( F(n 1)%3 + F(
阅读全文
摘要:链接: "传送门" 题意: 求解方程 X a + Y b = 1 的一组最小非负 X 的解,如果无解输出 "sorry" 思路: 裸 exgcd / File Name: hdu2669.cpp Author: WArobot Blog: http://www.cnblogs.com/WArobot
阅读全文
摘要:链接: "传送门" 思路: Manacher模板题,寻找串中的最长回文子串 / File Name: hdu3068.cpp Author: WArobot Blog: http://www.cnblogs.com/WArobot/ Created Time: 2017年05月19日 星期五 13时
阅读全文
摘要:链接: "传送门" 思路: 拓展欧几里德模板题,设大圣至少翻转 t 次,大圣起始位置为 x ,大圣目标位置为 y + n s ( 大圣到达目标位置 y 可能需要多圈,所以用 s 来表示圈数 ),因为只能逆时针翻转所以可以得到一个方程 x + D t = y + n s ( 使用D与d区分 ),将方程
阅读全文
摘要:链接: "传送门" 题意: 求 N^N 的个位 思路: 快速幂水题 / File Name: hdu1061.cpp Author: WArobot Blog: http://www.cnblogs.com/WArobot/ Created Time: 2017年05月17日 星期三 22时50分0
阅读全文
摘要:链接: "传送门" 思路: 高精度水题 / File Name: hdu1047.cpp Author: WArobot Blog: http://www.cnblogs.com/WArobot/ Created Time: 2017年05月16日 星期二 21时16分38秒 / include u
阅读全文
摘要:链接: "传送门" 思路: 高精度乘法板子题,高精度耗时又耗空间...... / File Name: hdu1042.cpp Author: WArobot Blog: http://www.cnblogs.com/WArobot/ Created Time: 2017年05月16日 星期二 21
阅读全文
摘要:链接: "传送门" 题意: A + B 高精度,板子题 / File Name: hdu1002.cpp Author: WArobot Blog: http://www.cnblogs.com/WArobot/ Created Time: 2017年05月16日 星期二 20时08分28秒 / i
阅读全文
摘要:链接: "传送门" 思路: 现在给出 n = A % 9973,n = A A/9973×9973,已知 B|A ,设 A = Bx,可以得到如下形式的式子:Bx + 9973×y = n ,因为gcd( B , 9973 ) = 1,所以可以用 exgcd 来求出 Bx + 9973×y = 1
阅读全文
摘要:链接: "传送门" 题意: 给出 n 个线段找到交点个数 思路: 数据量小,直接暴力判断所有线段是否相交 / File Name: hdu1086.cpp Author: WArobot Blog: http://www.cnblogs.com/WArobot/ Created Time: 2017
阅读全文
摘要:链接: "传送门" 题意: 略 思路: 数据量很小,直接暴力所有线段 / File Name: hdu2150.cpp Author: WArobot Blog: http://www.cnblogs.com/WArobot/ Created Time: 2017年05月07日 星期日 23时09分
阅读全文