随笔分类 - ACM-OJ-Codeforces
摘要:Problem - D - Codeforces Fix a Tree 看完第一名的代码,顿然醒悟。。。 我可以把所有单独的点全部当成线,那么只有线和环。 如果全是线的话,直接线的条数-1,便是操作数。 如果有环和线,环被打开的同时,接入到线上。那就是线和环的总数-1. 如果只有环的话,把所有的环打
阅读全文
摘要:题目链接:HDU 5719 Arrange 昨天的B题,昨天做的时候没注意所有谷堆是全排列,看了Clarification才知道,可是不会做。 实际上只需要将自己的代码改动一步就可以了count = count*(c[i]-b[i]-i+2)%mod,也即c[i]-b[i]+1-(i-1) 看这个样
阅读全文
摘要:D. Bear and Two Paths time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output D. Bear and Two Pa
阅读全文
摘要:C. Bear and Colors time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Bear Limak has n colo
阅读全文
摘要:题目链接 A. Currency System in Geraldion 有1时,所有大于等于1的数都可由1组成。没有1时,最小不幸的数就是1. 题目链接:B .Gerald is into Art 神之队友,八个if条件秒A,orz... 最后给的两个矩形每个长和宽翻过来倒过去,有四种情况。再和给
阅读全文
摘要:time limit per test 1 second time limit per test memory limit per test 256 megabytes memory limit per test input standard input input output standard
阅读全文
摘要:A. Round House time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya lives in a round bui
阅读全文
摘要:B. Bear and Compressing 题目链接 Problem - B - Codeforces Limak is a little polar bear. Polar bears hate long strings and thus they like to compress them.
阅读全文