摘要: 题解:模拟 第二行是汽车到达目的地的时间,第三行包含4*c整数TJ(1≤TJ≤75),表示JTH团队成员完成进食所需的时间(以分钟为单位)。最短距离是汽车所需要的时间和进食速度的两部分之和,最好的搭配就是把汽车时间都从大到小排,进食速度是从小到大,每四个为一组,取两个方案的最大值。 样例解释如下: 阅读全文
posted @ 2020-05-31 18:11 心不懈 阅读(116) 评论(0) 推荐(0)
摘要: 题解:dfs搜索 #include <iostream> #include <algorithm> #include <cstring> #include <stdio.h> using namespace std; int map[6][6];//地图 bool temp[6][6];//走过的标 阅读全文
posted @ 2020-05-21 22:53 心不懈 阅读(307) 评论(0) 推荐(0)
摘要: 知识点:逆元+拓展欧几米得算法 当方程符合ax+by=gcd(a,b)时,可以采用欧几里得算法求(x,y) 代码: #include<iostream> #include <algorithm> #include <stdio.h> #define ll long long using namesp 阅读全文
posted @ 2020-06-07 23:03 心不懈 阅读(145) 评论(0) 推荐(0)
摘要: 题解:dfs搜索 代码: #include <iostream>#include <cstring>using namespace std;char mp[10][10];//存#和.int vis[10];//做标记,走过1,没走过0int k,sum,n;int dfs(int x,int cn 阅读全文
posted @ 2020-05-20 22:13 心不懈 阅读(153) 评论(0) 推荐(1)
摘要: 题解:kmp算法 代码: #include <iostream>#include <algorithm>#include <cstring>#include <stdio.h>using namespace std;const int maxn=1000;char str[maxn],pattern 阅读全文
posted @ 2020-05-13 21:06 心不懈 阅读(144) 评论(0) 推荐(0)