摘要: 题目来源:https://www.luogu.com.cn/problem/P1364 这道题因为是数据范围比较小,用bfs硬过的,但是看标签似乎还有dp和重心的做法,等到后面统一整理dp的时候可以考虑再做一遍。 阅读全文
posted @ 2025-08-04 13:39 yubai111 阅读(11) 评论(0) 推荐(0)
摘要: 题目来源:https://www.luogu.com.cn/problem/P1825 代码导航:https://www.luogu.com.cn/record/228645977 我是绝对不会说这道题我WA卡了半个小时是因为偷懒用了vs里的ai自动填充代码功能!我是绝对不会说出来的! 阅读全文
posted @ 2025-08-03 22:55 yubai111 阅读(3) 评论(0) 推荐(0)
摘要: 题目导航:https://www.luogu.com.cn/problem/P3743 思路题,想通了很简单,想不通会被小数除法搞懵, 注:注意一下数据范围 阅读全文
posted @ 2025-07-31 10:45 yubai111 阅读(9) 评论(0) 推荐(0)
摘要: 基础思路:答案是具有连续性的,它首先一定可以通过for循环一个个枚举出来判断是不是真正答案,在此基础上想要优化,才应该想到‘二分’这个算法。大多数时候,二分是复合在别的算法中出现的小优化。 二分的板子不算难抄,但是有很多随机应变的小问题: 1、二分L和R的边界问题。打个比方:洛谷P1182(数列分段 阅读全文
posted @ 2025-07-29 10:54 yubai111 阅读(21) 评论(0) 推荐(0)
摘要: 题目来源:https://www.luogu.com.cn/problem/P2895 代码导航:https://www.luogu.com.cn/record/226995923 简单的bfs,但是容易出问题: debug第一次: if (nx >= 0 && ny >= 0) { if (mp[ 阅读全文
posted @ 2025-07-26 15:51 yubai111 阅读(7) 评论(0) 推荐(0)
摘要: 题目导航:https://codeforces.com/gym/105910 int main() { int T; cin >> T; while (T--) { int n; cin >> n; int haveans = 0; int all = 0; int du[1000010]; int 阅读全文
posted @ 2025-07-25 13:08 yubai111 阅读(8) 评论(0) 推荐(0)
摘要: 题目来源:https://www.luogu.com.cn/problem/P2440 ` int n, k; int maxlen = -1; int lenss[100010]; int main() { cin >> n >> k; for (int i = 0; i < n; i++) { 阅读全文
posted @ 2025-07-25 09:58 yubai111 阅读(15) 评论(0) 推荐(0)
摘要: 题目来源:https://www.luogu.com.cn/problem/P1101 bool bfs(int x, int y, int idx,int fx) { if (idx == 6) { return true; } if (fx == -1) { for (int i = 0; i 阅读全文
posted @ 2025-07-23 10:44 yubai111 阅读(22) 评论(0) 推荐(0)
摘要: 题目导航:https://codeforces.com/gym/105949/problem/I ` const int P = 131; const int MOD1 = 1e9 + 7; const int MOD2 = 1e9 + 9; map<pair<int, int>, int> mp; 阅读全文
posted @ 2025-07-19 14:22 yubai111 阅读(9) 评论(0) 推荐(0)
摘要: 题目来源:https://www.luogu.com.cn/problem/P4447 借鉴的佬的题解:https://www.luogu.com.cn/article/ywh0hzst 记录一下思路出错得很彻底的一道题,且(偷)看题解之前一直没想到自己错在哪———— 错误版:一开始就是觉得从头开始 阅读全文
posted @ 2025-07-19 12:42 yubai111 阅读(28) 评论(0) 推荐(0)