上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 33 下一页
摘要: 链接 [https://codeforces.com/contest/985/problem/B] 题意 给你n,m,分别是n个开关,m个灯 给一个n m的字符矩阵aij=1,表示i可以控制j这个灯 为你能否去掉一个开关使得,所有灯都亮,开始灯是暗的 分析 思维了, 统计第j个灯被多少个开关控制 每 阅读全文
posted @ 2018-12-07 15:22 ChunhaoMo 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 链接 [https://codeforces.com/contest/985/problem/A] 题意 给你一个偶数n,输入n/2个数,代表棋子的位置,有一个1 n的棋盘是黑白相间的 问你使得所有棋子在同一种颜色所需移动的最小步数 分析 先对所有棋子的位置排序 贪心枚举两种颜色都算在比较 代码 i 阅读全文
posted @ 2018-12-07 15:17 ChunhaoMo 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 链接 [https://codeforces.com/contest/985/problem/C] 题意 给你n,k,l,分别表示木桶数,一个木桶所需的 木块数,以及最大最小体积之差不超过l, 根据短板定律,的最大体积和 分析 就是很典型的贪心,先排序二分查找可能的最大的那个体积 eg:4 3 17 阅读全文
posted @ 2018-12-07 15:11 ChunhaoMo 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 代码 include using namespace std; define ll long long const int inf=99999999; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int e[20 阅读全文
posted @ 2018-12-06 18:15 ChunhaoMo 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 链接 [http://poj.org/problem?id=1979] 题意 问能走多少格子 分析 简单基础DFS 代码 include include include include using namespace std; const int N=22; char mp[N][N]; int d 阅读全文
posted @ 2018-12-05 19:50 ChunhaoMo 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 链接 [http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1412] 题意 Sample Input 2 2 DK HF 3 3 ADC FJK IHE 1 1 Sample Output 2 3 分析 用二进制表示每个字母,位运算 阅读全文
posted @ 2018-12-05 16:36 ChunhaoMo 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 链接 [http://poj.org/problem?id=1562] 题意 求联通块数量 分析 DFS 代码 include include include using namespace std; const int N=110; char a[N][N]; int d[8][2]={{ 1, 阅读全文
posted @ 2018-12-05 14:56 ChunhaoMo 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 题意 给你n,m,t,一个n m矩阵 S代表起点,D代表终点,X代表墙,问是否可以刚好t步走到,而且走过的路不能重复走 分析 DFS 代码 include include using namespace std; int n,m,t,sx,sy,ex,ey; char mp[10][10]; int 阅读全文
posted @ 2018-12-05 14:11 ChunhaoMo 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 链接 [https://codeforces.com/contest/1088/problem/C] 题意 n个数,最多n+1操作,要么前i个数加x,要么前i个数对x取余,最后使得严格递增 分析 直接进行n+1次,开始所有数都加上5e5+10; 后面n次,从1开始到n对a[i] i+1取余,就能保证 阅读全文
posted @ 2018-12-05 12:19 ChunhaoMo 阅读(381) 评论(2) 推荐(0) 编辑
摘要: 恢复内容开始 链接 [https://codeforces.com/contest/1077/problem/D] 题意 给你n,k,n个数,找出长度为k,的子串(不需连续),使得该子串数量最多 分析 1.肯定统计每个数字的数量 2.看那些数字数量大于0,保存数量和该数数值 3.对保存的根据数量从小 阅读全文
posted @ 2018-12-04 23:17 ChunhaoMo 阅读(197) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 33 下一页