上一页 1 ··· 3 4 5 6 7 8 9 10 11 12 下一页

E. Iva & Pav

摘要: 链接:https://codeforces.com/problemset/problem/1878/E 洛谷链接:https://www.luogu.com.cn/problem/CF1878E 知识点:st表+二分(我不知道为什么有的题解说不用二分...反正我的在第11个测试点会TLE) 思路就是 阅读全文
posted @ 2024-05-05 14:07 WHUStar 阅读(2) 评论(0) 推荐(0) 编辑

A. Anonymous Informant

摘要: 题面: 链接:https://codeforces.com/problemset/problem/1893/A 洛谷链接:https://www.luogu.com.cn/problem/CF1893A 思路:逆着推 有一个非常重要的结论得观察出来: 所以当倒过来推的时候(b->a),同理可以直接取 阅读全文
posted @ 2024-05-05 11:54 WHUStar 阅读(5) 评论(0) 推荐(0) 编辑

括号转树的模板

摘要: 电子书板子: 希冀平台: #include<iostream> #include<vector> #include<algorithm> #include<math.h> #include<sstream> #include<string> #include<string.h> #include<i 阅读全文
posted @ 2024-05-04 17:06 WHUStar 阅读(1) 评论(0) 推荐(0) 编辑

C. Matching Arrays

摘要: 链接:https://codeforces.com/problemset/problem/1896/C 洛谷:https://www.luogu.com.cn/problem/CF1896C 这题疑似有点水了?为什么还有绿题hhhh 思路:结构体+排序 首先对a,b各自排序:取b的下x和a的上x比较 阅读全文
posted @ 2024-05-01 10:50 WHUStar 阅读(5) 评论(0) 推荐(0) 编辑

C. Add, Divide and Floor

摘要: 链接:https://codeforces.com/problemset/problem/1901/C 洛谷链接:https://www.luogu.com.cn/problem/CF1901C 思路: 首先去重:这里建议分清楚总操作数n和元素总数cnt。 然后把去重的元素放在数组中,sort让它升 阅读全文
posted @ 2024-05-01 10:25 WHUStar 阅读(7) 评论(0) 推荐(0) 编辑

C. Theofanis' Nightmare

摘要: 链接:https://codeforces.com/problemset/problem/1903/C 洛谷链接(有翻译):https://www.luogu.com.cn/problem/CF1903C 解答: 观察可知:如果后面连续的和大于等于0,那么后面就可以连成一段(贪心),就是说因为前面每 阅读全文
posted @ 2024-05-01 09:48 WHUStar 阅读(8) 评论(0) 推荐(0) 编辑

Jumping Through Segments

摘要: 题目: 链接: https://www.luogu.com.cn/problem/CF1907D 大致思路: 二分模拟 关键点: ①确定二分区间:最小值为第一次跳的左边界,最大值为连续两个线段的最远值(注意,应该有四种情况:左1减右1,左2减右1,左1减右2,左2减右2,取绝对值); ②确定如何模拟 阅读全文
posted @ 2024-04-29 19:45 WHUStar 阅读(3) 评论(0) 推荐(0) 编辑

E. Klever Permutation

摘要: 链接:https://codeforces.com/problemset/problem/1927/E 思路:观察,可知每隔k个数据就是+1/-1,且间隔而分,思路如下: 然后按顺序打表就行 代码: #include<iostream> #include<vector> #include<algor 阅读全文
posted @ 2024-04-23 11:59 WHUStar 阅读(4) 评论(0) 推荐(0) 编辑

C. How Does the Rook Move?

摘要: https://codeforces.com/contest/1957/problem/C 题面: 题解: 补充说明: 把n阶棋盘想成n-1阶和外面套了一圈的如上图 则可以分成下面两种情况: 1. 下在(1,1)处,那么为dp[n-1] 2. 从(1,2)...(1,n-1)|(2,1)...(n- 阅读全文
posted @ 2024-04-22 20:27 WHUStar 阅读(24) 评论(0) 推荐(0) 编辑

LR-remainders

摘要: 网站:https://www.luogu.com.cn/problem/CF1932C https://codeforces.com/problemset/problem/1932/C 离线处理思想,分配id和val 先读入一整行输入,然后按照处理顺序给每个字母打上id sort:注意,按照id从大 阅读全文
posted @ 2024-04-17 19:47 WHUStar 阅读(5) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 12 下一页