上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: [D - ###](https://atcoder.jp/contests/abc058/tasks/arc071_b) 原计算公式为: $$ \sum\limits_{1\le i #include using namespace std; typedef long long LL; const 阅读全文
posted @ 2023-06-23 16:54 O2iginal 阅读(29) 评论(0) 推荐(0)
摘要: [D - Maximum Average Sets](https://atcoder.jp/contests/abc057/tasks/abc057_d) ``` // https://atcoder.jp/contests/abc057/tasks/abc057_d // 贪心, 尽可能拿大的, 阅读全文
posted @ 2023-06-23 15:40 O2iginal 阅读(58) 评论(0) 推荐(0)
摘要: 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)
摘要: https://atcoder.jp/contests/abc049/tasks/arc065_b ``` // https://atcoder.jp/contests/abc049/tasks/arc065_b // 使用两个并查集维护连通关系 // 求并集, 使用每个并查集的祖宗节点组成的pai 阅读全文
posted @ 2023-06-20 18:57 O2iginal 阅读(28) 评论(0) 推荐(0)
摘要: https://atcoder.jp/contests/abc048/tasks/arc064_b - 有意识地想办法简化问题, 缩小问题规模 - 尝试打表找规律 ``` // https://atcoder.jp/contests/abc048/tasks/arc064_b // 考虑当出现不能操 阅读全文
posted @ 2023-06-20 13:52 O2iginal 阅读(26) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 下一页