摘要: 题意:给你两个用24时间表示的时间,输出相差多少秒,坑点23:59:59到0:0:0是86399秒 #include<iostream> #include <cstdio> #include <cstring> using namespace std; const int maxn=1e5+7; i 阅读全文
posted @ 2020-08-01 09:25 杰瑞与汤姆 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 题意:第一场签到题,给你两个字符串可以无限重复,比较两个大小 题解:直接比较a+b与b+a,具体可以举例思考一下 #include <bits/stdc++.h> using namespace std; int main(){ string a,b; string c,d; while(cin>> 阅读全文
posted @ 2020-07-31 23:33 杰瑞与汤姆 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 题解: 不会推!! 正解 手算出第4个oeis规律! 打表线性筛n!的逆元。 #include <bits/stdc++.h> #define inf 0x3f3f3f3f using namespace std; const int maxn = 2e6 + 7; typedef long lon 阅读全文
posted @ 2020-07-31 23:25 杰瑞与汤姆 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 题意:给你n个点m条边以及n个点的度(只为1或者2),选择一些边满足点的度要求,若能满足输出YES,反之NO; 题解:我们把点和边都进行拆分 例子: 3 2 1 1 2 1 3 2 3 点按照度,边拆分成两个点,跑一遍一般图的最大匹配,若能完美匹配就是YES 完美匹配就是所有点都能匹配 通俗点就是所 阅读全文
posted @ 2020-07-31 23:17 杰瑞与汤姆 阅读(296) 评论(1) 推荐(0) 编辑
摘要: 题目链接https://ac.nowcoder.com/acm/contest/5666/A 题意: 题解:结论 下面举例解释 以abaab为例 C数组为当前后面的字符与当前的字符相同时的最少位置差,注意如果是最后的a,b的话它后面无a,b那么结果是无穷大,我这边就让他等于n了,最后一位让它加一位为 阅读全文
posted @ 2020-07-31 22:59 杰瑞与汤姆 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 题意: 给一个n个点m条边的有向带权图,q次询问,每次规定每条边的容量为u/v,你需要输出总流量为1时,从点1到点n的最小费用(分数表示),若到达的流量不足为1,则输出NaN; 题解:标准费用流模板,但是q的范围是1e5,所以我们要先跑一次费用流,把有用的信息记录下来,即把每一条增广路径的费用记录下 阅读全文
posted @ 2020-07-31 22:44 杰瑞与汤姆 阅读(249) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1532 #include<bits/stdc++.h> #define inf 0x3f3f3f3f using namespace std; const int Ni = 210; struct Edge{ in 阅读全文
posted @ 2020-07-31 21:28 杰瑞与汤姆 阅读(144) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2444 Problem Description There are a group of students. Some of them may know each other, while others don't 阅读全文
posted @ 2020-07-30 16:22 杰瑞与汤姆 阅读(107) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1045 Problem Description Suppose that we have a square city with straight streets. A map of a city is a squa 阅读全文
posted @ 2020-07-30 16:07 杰瑞与汤姆 阅读(139) 评论(0) 推荐(0) 编辑
摘要: https://ac.nowcoder.com/acm/problem/17315 题目描述 Applese有1个容量为v的背包,有n个物品,每一个物品有一个价值ai,以及一个大小bi 然后他对此提出了自己的疑问,如果我不要装的物品装的价值最大,只是一定需要装m个物品,要使得求出来的物品价值的中位数 阅读全文
posted @ 2020-07-30 15:21 杰瑞与汤姆 阅读(285) 评论(0) 推荐(0) 编辑