摘要: https://atcoder.jp/contests/abc056/tasks/arc070_b #### solution1: 贪心 ``` // https://atcoder.jp/contests/abc056/tasks/arc070_b // 查到多种做法 二分 / dp ... // 阅读全文
posted @ 2023-06-21 15:43 O2iginal 阅读(35) 评论(0) 推荐(0)
摘要: https://atcoder.jp/contests/abc055/tasks/arc069_b 使用二进制枚举会更加简洁, 要有从进制角度思考问题的习惯 ``` // https://atcoder.jp/contests/abc055/tasks/arc069_b // 枚举, 尝试前两个动物 阅读全文
posted @ 2023-06-21 11:52 O2iginal 阅读(12) 评论(0) 推荐(0)
摘要: https://atcoder.jp/contests/abc054/tasks/abc054_d ``` // https://atcoder.jp/contests/abc054/tasks/abc054_d // 背包 // 这里开始的时候数据规模想错了, 所以用了map, 实际上可以用数组 阅读全文
posted @ 2023-06-21 11:23 O2iginal 阅读(31) 评论(0) 推荐(0)
摘要: https://atcoder.jp/contests/abc052/tasks/arc067_b ``` // https://atcoder.jp/contests/abc052/tasks/arc067_b // 贪心即可, 从左到右行动, 每步选择代价小的方式 #include #inclu 阅读全文
posted @ 2023-06-21 10:44 O2iginal 阅读(34) 评论(0) 推荐(0)
摘要: https://atcoder.jp/contests/abc051/tasks/abc051_d ``` // https://atcoder.jp/contests/abc051/tasks/abc051_d // 一条边不含于任何一条最短路中, 当且仅当w[i][j] > dist[i][j] 阅读全文
posted @ 2023-06-21 10:24 O2iginal 阅读(27) 评论(0) 推荐(0)
摘要: ``` #include #include #include using namespace std; typedef long long LL; map mp; const LL mod = 1e9 + 7; LL f(LL n) { if (mp[n]) return mp[n]; if (n 阅读全文
posted @ 2023-06-21 09:35 O2iginal 阅读(19) 评论(0) 推荐(0)