摘要: 1e16是17位,不是16位 心态不能炸 cin和scanf同时用的时候,最后把scanf也改成cin 对于字符串问题,题目说的是由小写字母组成就有可能会出现全部的小写字母,不一定只出现固定的几个 阅读全文
posted @ 2018-09-07 18:19 Scott_Wong 阅读(110) 评论(0) 推荐(0) 编辑
摘要: $\left \lceil \frac{a}{b} \right \rceil = \left \lfloor \frac{a + b 1}{b} \right \rfloor$ 阅读全文
posted @ 2019-07-21 10:23 Scott_Wong 阅读(75) 评论(0) 推荐(0) 编辑
摘要: 123 阅读全文
posted @ 2019-07-19 22:19 Scott_Wong 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problemnew/show/P2764 有向无环图G的最小路径点覆盖包含的路径数等于n减去拆点二分图G2的最大匹配数 阅读全文
posted @ 2018-10-28 10:12 Scott_Wong 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 题目描述 有一张无限大的棋盘,你要将马从(0,0)移到(n,m)。每一步中,如果马在(x,y),你可以将它移动到(x+1,y+2),(x+1,y−2),(x−1,y+2),(x−1,y−2),(x+2,y+1),(x+2,y−1),(x−2,y+1)或(x−2,y−1)。你需要最小化移动步数。 输入 阅读全文
posted @ 2018-10-28 09:44 Scott_Wong 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 题目描述 WW 公司有 mm 个仓库和 nn 个零售商店。第 ii 个仓库有 a_iai​ 个单位的货物;第 jj 个零售商店需要 b_jbj​ 个单位的货物。 货物供需平衡,即\sum\limits_{i=1}^{m}a_i=\sum\limits_{j=1}^{n}b_ji=1∑m​ai​=j= 阅读全文
posted @ 2018-10-27 15:26 Scott_Wong 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://exam.upc.edu.cn/problem.php?id=9318&csrf=7XM2JJN7Kfq71alBWM0ZzOTygvRIv1oG 求最小循环节,只不过倒序存储一下 阅读全文
posted @ 2018-10-05 10:21 Scott_Wong 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://exam.upc.edu.cn/problem.php?id=9303&csrf=XwLpb4u93pQU7LfB4tOXe12tvq7Gc70z 最小生成树 直接套板子 阅读全文
posted @ 2018-10-05 10:18 Scott_Wong 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://exam.upc.edu.cn/problem.php?id=9264 01字典树 1 #include <bits/stdc++.h> 2 3 using namespace std; 4 int n,tot,trie[70005][2],a[1005],cnt[70005 阅读全文
posted @ 2018-10-02 22:56 Scott_Wong 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problemnew/show/P2756 经典的二分图最大匹配问题。 我们用最大流来做 首先从源点向外籍飞行员编号连容量为1的边,每个英国飞行员编号向汇点连容量为1的边,二分图内的边连容量为inf的边 跑一遍最大流,判断边是否有流量,即反向弧不 阅读全文
posted @ 2018-10-02 11:05 Scott_Wong 阅读(143) 评论(0) 推荐(0) 编辑
摘要: A题:Hard to prepare 待更新 B题:BE, GE or NE 待更新 C题:Cacti Lottery 待更新 D题:Easy Math 待更新 E题: End Fantasy VIX 待更新 F题: Features Track T组样例。每组样例输入n,代表有n个frames,编 阅读全文
posted @ 2018-09-09 19:39 Scott_Wong 阅读(528) 评论(0) 推荐(0) 编辑