摘要: Coins Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 20860 Accepted Submission(s): 8198 Problem 阅读全文
posted @ 2018-12-21 22:07 柠檬加糖 阅读(245) 评论(0) 推荐(0) 编辑
摘要: mybatis的分页插件jar包: 配置方法: 在mybatis配置文件中加下面代码 1 <plugin interceptor="com.github.pagehelper.PageInterceptor"> 2 <!-- 设置数据库类型 Oracle,Mysql,MariaDB,SQLite,H 阅读全文
posted @ 2018-12-21 19:17 柠檬加糖 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 传送门 关键在于到根节点的距离,如果两个点到根节点的距离相等,那么他们性别肯定就一样(因为前面如果没有特殊情况,两个点就是一男一女的)。一旦遇到性别一样的,就说明找到了可疑的 1 #include<bits/stdc++.h> 2 using namespace std; 3 int f[2005] 阅读全文
posted @ 2018-11-21 22:06 柠檬加糖 阅读(421) 评论(0) 推荐(0) 编辑
摘要: 传送门 迷宫中不能有回路,还要连通 如果最后集合数是一个那就是连通,否则不联通 要合并的两个顶点在相同集合内,表示出现了回路 输入时注意一下 1 #include<bits/stdc++.h> 2 using namespace std; 3 int f[100005]; 4 int getf(in 阅读全文
posted @ 2018-11-20 20:58 柠檬加糖 阅读(284) 评论(0) 推荐(0) 编辑
摘要: 传送门 最少好要修多少条路太能使全部城镇连通。只要用并查集算可以连通的城市的组数,修的路就是组数减1 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define C getchar() 4 template <typename T> 5 in 阅读全文
posted @ 2018-11-20 19:10 柠檬加糖 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 传送门 第一道拓扑排序题 每次删除入度为0的点,并输出 这题要求队名小的排前面,所以要用到重载的优先队列 1 #include<bits/stdc++.h> 2 using namespace std; 3 priority_queue<int,vector<int>,greater<int> > 阅读全文
posted @ 2018-11-20 16:09 柠檬加糖 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 传送门 成语接龙,找每个单词都需要一点时间,问最少的时间 把字符串用map处理成数字编号,之后用floyd 1 #include<bits/stdc++.h> 2 using namespace std; 3 map<string,int>g; 4 int road[1005][1005]; 5 i 阅读全文
posted @ 2018-11-20 14:02 柠檬加糖 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 传送门 dijkstra 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int INF=0x3f3f3f3f; 4 const int maxn=1200; 5 6 int dist[maxn],g[maxn][maxn],N; 7 阅读全文
posted @ 2018-11-19 18:41 柠檬加糖 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 传送门 结点中的l和r表示层数,maxx表示这层最多还剩下多少宽度。根据公告的宽度取找到可以放的那一层 找到后返回层数,并修改maxx 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn= 200000+5; 4 int 阅读全文
posted @ 2018-11-19 14:42 柠檬加糖 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 传送门 有更新单个学生成绩和查询某个区间内学生成绩最大值两种操作 线段树代码 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn=200000+5; 4 using namespace std; 5 int a[maxn 阅读全文
posted @ 2018-11-19 00:05 柠檬加糖 阅读(156) 评论(0) 推荐(0) 编辑