摘要: 1 /**\ 2 https://codeforces.com/problemset/problem/1622/C 3 贪心: 4 先将数组排序,要么减小a[1]值,要么从后面开始变后面的数->a[1],枚举x y就可 6 后附公式证明 5 \**/ 6 #include <bits/stdc++. 阅读全文
posted @ 2022-03-01 23:42 std&ice 阅读(78) 评论(0) 推荐(0) 编辑
摘要: 1 /**\ 2 https://codeforces.com/contest/1627/problem/C 3 想要满足能够赋值的条件,必须所有点的度都不能>3 4 那么树退化成了链,就op记下输出格式,然后ans记录dfs的结果 5 由于链式 2 3 2 3 就满足prime path 6 \* 阅读全文
posted @ 2022-03-01 22:25 std&ice 阅读(70) 评论(0) 推荐(0) 编辑
摘要: 1 /**\ 2 线段树:区间查询 区间修改 3 input: 4 5 5 5 1 5 4 2 3 6 2 2 4 7 1 2 3 2 8 2 3 4 9 1 1 5 1 10 2 1 4 11 output: 12 11 13 8 14 20 15 \**/ 16 #include <bits/s 阅读全文
posted @ 2022-03-01 09:12 std&ice 阅读(49) 评论(0) 推荐(0) 编辑