题目链接 这题恶心死我了. bfs染色,统计每个联通块两色的个数,ans加它们的最小值. #include<cstdio> #include<cctype> #include<algorithm> #include<cstring> using namespace std; inline long long max(long long a,long long b){ return a>b?a:b; } inline long long read(){…
题目传送门 题意:题意坑爹.问符合条件的的山顶个数 分析:降序排序后从每个点出发,假设为山顶,如果四周的点的高度>h - d那么可以走,如果走到已经走过的点且染色信息(山顶高度)不匹配那么就不是山顶.重点在于就算知道不是山顶也要染色完. #include <bits/stdc++.h> using namespace std; const int N = 5e2 + 5; const int INF = 0x3f3f3f3f; int h, w, d; struct Point { in…
链接: https://vjudge.net/problem/CodeForces-598D 题意: Igor is in the museum and he wants to see as many pictures as possible. Museum can be represented as a rectangular field of n × m cells. Each cell is either empty or impassable. Empty cells are marke…