Loading

摘要: 题目链接 https://www.luogu.com.cn/problem/P1098 题目思路 模拟,注意记录偏移量来去掉 ''-'' 题目代码 最傻的模拟 #include <iostream> #include <algorithm> using namespace std; const in 阅读全文
posted @ 2022-03-14 17:50 vacilie 阅读(104) 评论(0) 推荐(0)
摘要: 题目链接 https://www.luogu.com.cn/problem/P1518 题目思路 模拟农夫和奶牛行动路线,为了避免死循环,当ans到一定值时跳出 题目代码 #include <iostream> #include <algorithm> using namespace std; ch 阅读全文
posted @ 2022-03-13 20:45 vacilie 阅读(109) 评论(0) 推荐(0)
摘要: 题目链接 https://www.acwing.com/problem/content/4316/ 题目思路 贪心 从最底层向高层遍历,同一分支的两个结点比较,将大值赋给父节点, ans += 最大值 + 最小值 #include <iostream> #include <algorithm> #i 阅读全文
posted @ 2022-03-13 19:56 vacilie 阅读(16) 评论(0) 推荐(0)
摘要: 题目链接 https://www.acwing.com/problem/content/4315/ 题目思路 KMP算法,再通过查询子串来计算出现次数 题目代码 #include <iostream> #include <algorithm> using namespace std; const i 阅读全文
posted @ 2022-03-13 17:28 vacilie 阅读(23) 评论(0) 推荐(0)
摘要: 题目链接 https://www.luogu.com.cn/problem/P1328 题目思路 用二维数组存每种情况的得分情况,然后枚举来计算分数 #include <iostream> using namespace std; int main() { int vs[5][5] = {{0, 0 阅读全文
posted @ 2022-03-12 22:11 vacilie 阅读(33) 评论(0) 推荐(0)
摘要: 题目链接 https://www.luogu.com.cn/problem/P4924 题目思路 顺时针转是第$i$行第$j$列的数字转移到第$j$行倒数第$i$列 \(temp[n - m + j][n + m - i] = g[i][j]\) 逆时针转是第$i$行第$j$列的数字转移到倒数第$j 阅读全文
posted @ 2022-03-10 20:40 vacilie 阅读(78) 评论(0) 推荐(0)
摘要: 题目链接 https://www.luogu.com.cn/problem/P1009 题目思路 本题为高精度乘法 + 高精度加法 题目代码 #include <iostream> #include <algorithm> #include <cstring> using namespace std 阅读全文
posted @ 2022-03-09 20:54 vacilie 阅读(46) 评论(0) 推荐(0)
摘要: 题目链接 https://www.luogu.com.cn/problem/P1303 题目思路 模板题 题目代码 #include <iostream> #include <algorithm> #include <vector> using namespace std; vector<int> 阅读全文
posted @ 2022-03-09 08:55 vacilie 阅读(25) 评论(0) 推荐(0)
摘要: 题目链接 https://www.luogu.com.cn/problem/P1601 题目思路 模板 题目代码 #include <iostream> #include <algorithm> #include <vector> using namespace std; vector<int> a 阅读全文
posted @ 2022-03-09 08:51 vacilie 阅读(55) 评论(0) 推荐(0)
摘要: 题目链接 https://www.luogu.com.cn/problem/P1563 题目思路 当谜题方向与小人朝向相同时是逆时针,相反时是顺时针,求最终小人位置 题目代码 #include <iostream> #include <algorithm> using namespace std; 阅读全文
posted @ 2022-03-09 08:30 vacilie 阅读(37) 评论(0) 推荐(0)