上一页 1 ··· 3 4 5 6 7 8 9 下一页
摘要: ![](https://pic.imgdb.cn/item/64a2d4841ddac507cc632486.png) ![](https://pic.imgdb.cn/item/64a60b061ddac507ccf0ad41.png) 阅读全文
posted @ 2023-07-03 22:02 liukejie 阅读(150) 评论(0) 推荐(0)
摘要: # [《从 C++98 到 C++20,寻觅甜甜的语法糖们》](https://www.luogu.com.cn/blog/AccRobin/grammar-candies#) # 这篇文章对《从 C++98 到 C++20,寻觅甜甜的语法糖们》稍有改动 - find(bg,ed,val) - 返回 阅读全文
posted @ 2023-07-01 11:28 liukejie 阅读(151) 评论(0) 推荐(1)
摘要: # $ 自编 2048 小游戏$ ```cpp //2048小游戏原创 #include #include #include #pragma GCC optimize(2) #pragma GCC optimize(3) inline int max1 (int x, int y) { return 阅读全文
posted @ 2023-07-01 11:25 liukejie 阅读(39) 评论(0) 推荐(0)
摘要: # $ 自编 2048 朝代版 $ ```cpp #include #include #include #pragma GCC optimize(2) #pragma GCC optimize(3) void chaodai (int n) { if (n == 2) printf ("商") ; 阅读全文
posted @ 2023-07-01 11:25 liukejie 阅读(27) 评论(0) 推荐(0)
摘要: ### [题目传送门](https://www.luogu.com.cn/problem/AT4160) ### 思路 对于这道题,读入的 $a$ 数组最终肯定会变成 $1$。 $\because$ 读入的是 $1 \sim n$,最小值是 $1$。 $\therefore$ $a$ 数组最终肯定会 阅读全文
posted @ 2023-07-01 11:23 liukejie 阅读(15) 评论(0) 推荐(0)
摘要: ### [题目传送门](https://www.luogu.com.cn/problem/AT3732) ### 思路 $\because$ 要求的是 $k$ 的最大长度, $\therefore$ 无需考虑翻转次数。 对于第 $i$ 个字符来说,假设它不等于前 $i - 1$ 个字符,前 $i - 阅读全文
posted @ 2023-07-01 11:22 liukejie 阅读(13) 评论(0) 推荐(0)
摘要: ### [题目传送门](https://www.luogu.com.cn/problem/AT2299) ___ ### 思路 这道题我们可以开一个桶, 统计一共有多少个不同的数。 如果个数是偶数的话, 最后的答案要 $-1$。 比如样例 ```cpp 5 1 2 1 3 7 ``` 不同的数有 $ 阅读全文
posted @ 2023-07-01 11:21 liukejie 阅读(12) 评论(0) 推荐(0)
摘要: ### [题目传送门](https://www.luogu.com.cn/problem/solution/AT3882) ___ ### 思路 这道题很简单,就是纯 Dfs。 先建图,表示 $l$ 在 $r$ 的左边,距离为 $d$,$r$ 在 $l$ 的右边,距离为 $-d$。 再开一个 $f$ 阅读全文
posted @ 2023-07-01 11:21 liukejie 阅读(15) 评论(0) 推荐(0)
摘要: ### [题目传送门](https://www.luogu.com.cn/problem/AT4733) ___ ### 思路 分层图跑最短路。 ___ $∵$ 题目中说每次只能走 $3$ 步, $∴$ 我们可以把一条边拆成三条边, 拆成 $1$ 到 $2$,$2$ 到 $3$,$3$ 到 $2$ 阅读全文
posted @ 2023-07-01 11:20 liukejie 阅读(25) 评论(0) 推荐(0)
摘要: ### [题目传送门](https://www.luogu.com.cn/problem/AT4848) ___ ### 思路 这道题,如果一边输入一边 Dfs,肯定会超时的。 那么,我们注意到题目中说的一句话: **每次操作将 $p_i$ 的子树中所有点的计数器增加 $x_i$。** 那么可以离线 阅读全文
posted @ 2023-07-01 11:16 liukejie 阅读(36) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 下一页