摘要: 题目链接 D: 完全模拟一定超时,设2个数组来存加在前面的/加在后面的,如果出现reverse操作,交换这两个数组即可 #include<bits/stdc++.h> using namespace std; #define ms(x,y) memset(x, y, sizeof(x)) #defi 阅读全文
posted @ 2020-06-01 21:11 GRedComeT 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 题目链接 B: 边最少点最多的方式是2个点一条边,不连通,边最多点最少的方式是完全图,边数为$n*(n-1)/2$ #include<bits/stdc++.h> using namespace std; #define ms(x,y) memset(x, y, sizeof(x)) #define 阅读全文
posted @ 2020-06-01 14:59 GRedComeT 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 题目链接 D: 将第一种关系建图,求出图上每个点,满足不相邻但可达且不含第二种关系的点的数量,直接建图,注意减数量的时候不要重复即可 #include<bits/stdc++.h> using namespace std; #define ms(x,y) memset(x, y, sizeof(x) 阅读全文
posted @ 2020-06-01 14:48 GRedComeT 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 题目链接 A: 数据范围为100,可以直接O(n^2)暴力,对于s中每一个字符,分别替换为小写、大写、数字,然后贪心检验,若更改每一个都不符合,则随便更改3个字符,分别为小写、大写、数字即可 #include<bits/stdc++.h> using namespace std; #define m 阅读全文
posted @ 2020-06-01 14:35 GRedComeT 阅读(92) 评论(0) 推荐(0) 编辑