Stay Hungry,Stay Foolish!

03 2023 档案

摘要:D - Bank https://atcoder.jp/contests/abc294/tasks/abc294_d 思路 准备一个优先队列wait,用于所有取钱者的排队,按照ID从小到大排队; 准备一个集合called,用于存储所有已经被叫到号的取钱者; 每次teller叫号后,将叫到号的取钱者放 阅读全文
posted @ 2023-03-27 21:48 lightsong 阅读(30) 评论(0) 推荐(0) 编辑
摘要:E - Geometric Progression https://atcoder.jp/contests/abc293/tasks/abc293_e 思路 根据矩阵递推式 找出转移矩阵的幂形式。 利用矩阵快速幂计算。 Code https://atcoder.jp/contests/abc293/ 阅读全文
posted @ 2023-03-22 22:02 lightsong 阅读(40) 评论(0) 推荐(0) 编辑
摘要:C - Merge Sequences https://atcoder.jp/contests/abc294/tasks/abc294_c 思路 归并排序思想。 Code https://atcoder.jp/contests/abc294/submissions/39930476 #include 阅读全文
posted @ 2023-03-21 22:07 lightsong 阅读(16) 评论(0) 推荐(0) 编辑
摘要:D - Tying Rope https://atcoder.jp/contests/abc293/tasks/abc293_d 思路 /* one rope model: one end color -- rope number -- another end color short form: c 阅读全文
posted @ 2023-03-16 21:11 lightsong 阅读(12) 评论(0) 推荐(0) 编辑
摘要:C - Make Takahashi Happy https://atcoder.jp/contests/abc293/tasks/abc293_c 思路 回溯遍历算法, dfs从1,1位置开始遍历,把所有可能分支都跑遍, 统计总的数目。 Code https://atcoder.jp/contes 阅读全文
posted @ 2023-03-13 09:30 lightsong 阅读(45) 评论(0) 推荐(0) 编辑
摘要:A. Plant https://codeforces.com/contest/185/problem/A 思路 发现状态转移矩阵M 目标状态-上三角 目标状态-下三角 源状态-上三角 3 1 源状态-下三角 1 3 初始状态为向量V 初始状态-上三角 1 初始状态-下三角 0 过第一年V的转变为 阅读全文
posted @ 2023-03-13 09:20 lightsong 阅读(25) 评论(0) 推荐(0) 编辑
摘要:P1551 亲戚 https://www.luogu.com.cn/problem/P1551 思路 并查集统计亲戚集合。 Code https://www.luogu.com.cn/record/104070571 #include <iomanip> #include <bits/stdc++. 阅读全文
posted @ 2023-03-08 22:27 lightsong 阅读(22) 评论(0) 推荐(0) 编辑
摘要:E - Transitivity https://atcoder.jp/contests/abc292/tasks/abc292_e 思路 https://blog.csdn.net/a1845613403/article/details/129343684 记录每个点的入节点集合, 和 出节点集合 阅读全文
posted @ 2023-03-08 22:23 lightsong 阅读(24) 评论(0) 推荐(0) 编辑
摘要:Sorting It All Out http://poj.org/problem?id=1094 思路 每加入一条边需要进行一次拓扑排序,如果拓扑排序发现有环,或者排序唯一那么就可以直接输出结果,如果所有的边输入完成还不是上述两种情况,那就输出不能判断。 这里的重点在于如何判断拓扑排序的唯一性 判 阅读全文
posted @ 2023-03-06 00:33 lightsong 阅读(34) 评论(0) 推荐(0) 编辑
摘要:D - Redistribution https://atcoder.jp/contests/abc178/tasks/abc178_d 思路 设f[i]:表示用3~i数凑出和为i的方案数 f[i]=f[i-3]+f[i-4]+f[i-5]+…+f[i-i] https://blog.csdn.ne 阅读全文
posted @ 2023-03-05 22:35 lightsong 阅读(15) 评论(0) 推荐(0) 编辑
摘要:1009. K-based Numbers https://acm.timus.ru/problem.aspx?space=1&num=1009 思路 典型dp问题 对于n位k位底的数, 求不存在连续0出现的数目。 设f(i) 为 i位,最后一位为不为0的数目 设g(i)为i位,最后一位为0的数目 阅读全文
posted @ 2023-03-05 22:30 lightsong 阅读(15) 评论(0) 推荐(0) 编辑
摘要:D - Unicyclic Components https://atcoder.jp/contests/abc292/tasks/abc292_d 思路 并查集,统计连通子图, 并记录edges 数 和 vertices数。 CANKAO: https://blog.csdn.net/karry_ 阅读全文
posted @ 2023-03-04 22:38 lightsong 阅读(46) 评论(0) 推荐(0) 编辑
摘要:P1983 [NOIP2013 普及组] 车站分级 https://www.luogu.com.cn/problem/P1983 思路 https://www.cnblogs.com/tomori/p/14331510.html Code https://www.luogu.com.cn/recor 阅读全文
posted @ 2023-03-03 12:40 lightsong 阅读(26) 评论(0) 推荐(0) 编辑
摘要:C. Fox And Names https://codeforces.com/problemset/problem/510/C 思路 使用拓扑序算法,找出前后的依赖的可能情况。 如果拓扑序未找到所有的节点,表明存在依赖环,这种情况不满足。 Code https://codeforces.com/p 阅读全文
posted @ 2023-03-01 10:25 lightsong 阅读(21) 评论(0) 推荐(0) 编辑
摘要:E - Make it Palindrome https://atcoder.jp/contests/abc290/tasks/abc290_e 思路 参考: https://zhuanlan.zhihu.com/p/608325900 双指针部分,添加解释: Code https://zhuanl 阅读全文
posted @ 2023-03-01 00:03 lightsong 阅读(42) 评论(0) 推荐(0) 编辑

千山鸟飞绝,万径人踪灭
点击右上角即可分享
微信分享提示