随笔分类 - luogu
摘要:题目来源:https://www.luogu.com.cn/problem/P1162 bfs水题,把1和其包围圈视为一个整体,对其周围“注水”。 第一次提交过了两个测试点,查询后发现在bfs函数中 void bfs(int x, int y) { q.push({ 0,0 }); while (!
阅读全文
摘要:题目来源:https://www.luogu.com.cn/problem/P1135 ` typedef pair<int, int>Pi; int N, A, B;bool hs[201]; int K[250];queueq; int bfs(int nown, int fn) { q.pus
阅读全文
摘要:题目来源:https://www.luogu.com.cn/problem/P1443 简单的bfs,然而写x和y的限制时把矩阵的行列搞反了,(因为太简单了代码略)
阅读全文
摘要:题目来源:https://www.luogu.com.cn/problem/P1923 nth_element(a,a+k,a+n),所有a+k左边的都比它小(但不一定单调),所有右边的都比它大。这道题算是模板,不用stl的话可以用快排思想 耗时:cin > scanf > getchar,超时逐级
阅读全文
摘要:题目来源:https://www.luogu.com.cn/problem/P5019 解读: 两道题一模一样的答案可A 第一反应是贪心,又想套路排序了,不过很显然排不了,, 硬要说思路感觉很像是找山峰,低的位置被高地吞掉,后面的山峰的高度又要以前部的山谷为“地平线”来计算,就是那种相对高度。 看了
阅读全文
摘要:题目来源:https://www.luogu.com.cn/problem/P1616 ` int a[10010];int b[10010]; long long int dp[10000010]; int main() { int t, m;cin >> t >> m; for (int i =
阅读全文

浙公网安备 33010602011771号