Stay Hungry,Stay Foolish!

摘要: D - Step Up Robot https://atcoder.jp/contests/abc289/tasks/abc289_d 思路 - 1 DFS 从0开始, 否则运用所有可能步子,检查新的位置点, 遇到block返回false, 是目标点x返回true Code - 1 DFS http 阅读全文
posted @ 2023-02-11 22:32 lightsong 阅读(30) 评论(0) 推荐(0) 编辑
摘要: C - Coverage https://atcoder.jp/contests/abc289/tasks/abc289_c 思路 对所有组合,依此遍历 判断组合内所有的集合是否覆盖 1...n 判断过程中,如果发现某个数不能被覆盖,则说明此组合不满足要求, 如果满足要求,计数加1 Code htt 阅读全文
posted @ 2023-02-11 22:23 lightsong 阅读(50) 评论(0) 推荐(0) 编辑
摘要: P1015 [NOIP1999 普及组] 回文数 https://www.luogu.com.cn/problem/P1015 思路 将字符串m转换为10进制的值 翻转m,也转换为10进制值, 后运用10进制加这两个数 转换为对应进制n的字符串, 判断是否为回文 Code -- Partial AC 阅读全文
posted @ 2023-02-11 15:54 lightsong 阅读(120) 评论(0) 推荐(0) 编辑
摘要: A. One and Two https://codeforces.com/problemset/problem/1788/A 思路 统计2的个数, 如果是奇数个, 不满足 如果是偶数个, 2队列中,前半部分最后一个2则为目标位置 如果个数是0, 即都是1的情况, 则k=1 Code https:/ 阅读全文
posted @ 2023-02-11 11:04 lightsong 阅读(17) 评论(0) 推荐(0) 编辑
摘要: B. Sum of Two Numbers https://codeforces.com/problemset/problem/1788/B 思路 计算原数的所有位置上的digit和 得到digit和的一半 对于原数从左到右切分,前半部分digit和为half 例如: 1331 -->> 1300 阅读全文
posted @ 2023-02-11 11:00 lightsong 阅读(31) 评论(0) 推荐(0) 编辑
Life Is Short, We Need Ship To Travel