这名用户暂未设置签名。
追踪最近的用户名外显变动记录。
最近的文章、讨论、云剪贴板与社区记录
在文章《题解:P14363 [CSP-S 2025] 谐音替换 / replace(民间数据)》发表评论:
还是太有实力了,c题都能切
在文章《题解:P13761 Chess》发表评论:
感谢反馈,这里只需要在while之前把cnt==3的时候,把cnt设为-1
## [P13790](https://www.luogu.com.cn/problem/P13790)题解 ### 题目大意 这道题让我们修改题目所给的字符串 $s$,使字符串 $s$ 的 border 长度最大。 ### 思路解析 我们看到题目,我们要找到一个字符串 $b$,使得 $b$ 为字符串 $s$ 的前缀和…
## [P13761](https://www.luogu.com.cn/problem/P13761)题解 题目大意 没啥好说的就是看象能否从 $(1,1)$ 走到 $(n,m)$,$ (n−1,m)$,$(n-1,m-1)$,$(n,m−1)$。 解题思路 因为象从 $(1,1)$ 开始走,且象走的是田字格,所以只…
## [P13728](https://www.luogu.com.cn/problem/P13728)题解 ### 题目大意: 题目给定一个长度为 $n$ 的数组,我们要将它变成一个上升序列且后一项只比前一项大一,使每一项改变前后的差值的绝对值相加最小。 ### 思路解析: 这道题的贪心思路是定义一个 $b[i]$…
# [P13316](https://www.luogu.com.cn/problem/P13316) 祝贺自己切掉一道绿题 ## 题目大纲 这道题是一道贪心加排序的题(个人认为贪心思路好想,排序思路较难)。 ## 思路讲解 这题的贪心思路是要将一颗星与两颗星分开计算并记录他们的 $id$ 利用 $sort$ 函数进行…
# [P13672](https://www.luogu.com.cn/problem/P13672)题解 ## 题目大意 这道题题目让我们求出倒计时所需最少数字牌数量,我们可以通过对 $n$ 的数位进行操作来得到答案。 ## 思路 求出 $n$ 的位数为 $sum$,答案就为 $(sum-1)\times10$ 之后…
## [P13677](https://www.luogu.com.cn/problem/P13677)题解 一行包含平衡序列 $s(2≤|s|≤1 \times 10^6 )$,卢娜那张羊皮纸条上的序列。输出格式 如果无法通过切割环形序列得到不同的平衡序列,则输出 “no”,否则给出任意一个这样的序列。 ## 思路…
## [P13600](https://www.luogu.com.cn/problem/P13600)题解 这道题是一个简单贪心,难度大约为橙题左右。 ## 思路 题目意思是有 $n$ 个电脑,我们要将每个电脑接到集线器上而集线器只有 $m$ 个接口,剩下的电脑要连接到已连接的电脑上,且延迟时间为这条线路上的延迟时间…
[P13193](https://www.luogu.com.cn/problem/P13193)题解 这道题是偏贪心的大模拟,码量较大,但思路比较简单。本蒟蒻调了整整两天。 **总体思路** 我们看到题目,要我们将题目输入的 $A$,$B$ 两个字符串中的问号变为数字使它们差值的绝对值最小。 我们先会想到把 $A$,…
在文章《题解:P13078 [NOISG 2019] Rigged Roads》发表评论:
膜拜大佬
在讨论《随机样例代码》回复:
```cpp #include using namespace std; void dfs(int pos, string& c, string& j, string& bc, string& bj, long long& d) { if (pos == c.size()) { long long num1 = sto…
```cpp #include #define int long long using namespace std; int A; signed main(){ freopen("test.out","w",stdout); cin>>A; ios::sync_with_stdio(0),cin.tie(0),cout…
在讨论《代码越改越乱,求调》回复:
```cpp #include using namespace std; long long n,T,ans; int main(){ cin>>T; for(int q=1;q >a>>b; int opa=0,opb=0; for(int i=0;i =b[i+1]+5&&a[i]!='0') { a[i]--;…
在讨论《代码越改越乱,求调》回复:
```cpp #include using namespace std; long long n,T,ans; int main(){ cin>>T; for(int q=1;q >a>>b; int opa=0,opb=0; for(int i=0;i =b[i+1]+5&&a[i]!='0') { a[i]--;…
```cpp #include using namespace std; long long n,T,ans; int main(){ cin>>T; for(int q=1;q >a>>b; int opa=0,opb=0; for(int i=0;i =b[i+1]+5&&a[i]!='0') { a[i]--;…
## 标题 **[题目传送门](https://www.luogu.com.cn/problem/P4092)** ```cpp #include #include using namespace std; int n,q,tr[100005]; vector v[100005]; void dfs(int x,int…