上一页 1 2 3 4 5 6 7 8 ··· 12 下一页

C. Tenzing and Balls

摘要: 链接:https://codeforces.com/problemset/problem/1842/C or https://www.luogu.com.cn/problem/CF1842C 大概的思路就是利用dp[i]记录前i个数据最多消掉的数字个数,然后对∀j:a[i] == a[j] && j 阅读全文
posted @ 2024-05-31 14:27 WHUStar 阅读(2) 评论(0) 推荐(0) 编辑

E.Power of Points

摘要: 题目: 链接:https://www.luogu.com.cn/problem/CF1857E or https://codeforces.com/problemset/problem/1857/E 思路 我的思路可能比较复杂: 首先由于覆盖的是整点,那么可以想到排序后用前缀和,比如1 4 3 -- 阅读全文
posted @ 2024-05-29 15:33 WHUStar 阅读(2) 评论(0) 推荐(0) 编辑

E. Data Structures Fan

摘要: 非常有意思的一道思维题!!!! 先上两个题解: 题解1: 题解2: 总的思路就是伪“前缀和”,然后维护选0还是选1的异或和就够了。 如果改变,就直接像前缀和那样改,证明理由就是0^a = a ;a^a =0; 代码: #define _CRT_SECURE_NO_WARNINGS #include< 阅读全文
posted @ 2024-05-28 19:25 WHUStar 阅读(5) 评论(0) 推荐(0) 编辑

P1504 积木城堡/01背包板子

摘要: 代码: #define _CRT_SECURE_NO_WARNINGS #include<iostream> #include<vector> #include<algorithm> #include<math.h> #include<sstream> #include<string> #inclu 阅读全文
posted @ 2024-05-26 17:29 WHUStar 阅读(2) 评论(0) 推荐(0) 编辑

P1474 [USACO2.3] Money System / [USACO07OCT]Cow Cash G

摘要: 有点水,但是细究还是有点意思的题目 https://www.luogu.com.cn/problem/P1474 一开始的代码: #define _CRT_SECURE_NO_WARNINGS #include<iostream> #include<vector> #include<algorith 阅读全文
posted @ 2024-05-26 15:11 WHUStar 阅读(5) 评论(0) 推荐(0) 编辑

E. IT Restaurants

摘要: 链接:https://www.luogu.com.cn/problem/CF212E https://codeforces.com/problemset/problem/212/E 题目: 思路: 首先题目说要保证最大的数量,并且每个颜色的点至少有一个,那么很显然染色的点有n-1个,且唯一没染色的点 阅读全文
posted @ 2024-05-26 14:26 WHUStar 阅读(2) 评论(0) 推荐(0) 编辑

P1944 最长括号匹配

摘要: 链接:https://www.luogu.com.cn/problem/P1944 题目: 思路:注意题目里说的: 1.(),[]是括号匹配的字符串。 2.若A是括号匹配的串,则(A),[A]是括号匹配的字符串。 3.若A,B是括号匹配的字符串,则AB也是括号匹配的字符串。 所以设dp[i]是以i结 阅读全文
posted @ 2024-05-26 11:28 WHUStar 阅读(1) 评论(0) 推荐(0) 编辑

P1929 迷之阶梯

摘要: 链接:https://www.luogu.com.cn/problem/P1929 题目: 思路:动态规划:以times[i]表示跳到第i号台阶的最小步数。 如果height[i] == height[i-1] + 1那么显然有times[i] = times[i-1] + 1 然后是遍历的状态转移 阅读全文
posted @ 2024-05-26 09:58 WHUStar 阅读(2) 评论(0) 推荐(0) 编辑

P1853 投资的最大效益

摘要: 链接:https://www.luogu.com.cn/problem/P1853 题目: 总的思路就是完全背包模板加上空间优化 完全背包参考:https://blog.csdn.net/qq_40802813/article/details/119609917 空间优化见代码 #define _C 阅读全文
posted @ 2024-05-25 22:32 WHUStar 阅读(3) 评论(0) 推荐(0) 编辑

P1057 [NOIP2008 普及组] 传球游戏

摘要: 链接:https://www.luogu.com.cn/problem/P1057 思路:左手倒右手,建立递推方程 建立初始参数:定义dp[j][k]是第k次,以j结尾的方法,就是传k次最后传到j的方法。 那么状态转移方程:dp[j][k]=dp[next][k-1]+dp[before][k-1] 阅读全文
posted @ 2024-05-20 16:42 WHUStar 阅读(14) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 12 下一页