随笔分类 -  cf

摘要:题目:点我转移 【题意】 x轴上有m个连续的点,从1标号到m.其中有n个点是特殊点。让你用k段区间将这n个点覆盖。要求区间的总长度最小。 解: 一开始假设我们需要n个胶带(即包含每一个点)然后因为m<=n所以可能胶带不够用。那么就得一个胶带跨过两个点。怎么选择最好呢?可以把b[i]-b[i-1]-1 阅读全文
posted @ 2019-02-10 20:21 悲离 阅读(108) 评论(0) 推荐(0)
摘要:这个运用一点数学知识就能解决偶数*偶数结果是偶数,奇数乘偶数也是偶数,奇数乘奇数是奇数,然后奇数个奇数相加的到奇数,偶数和奇数相加,如果奇数是奇数个那么这个最终结果就是奇数, 反之结果就是偶数 所以看a*b的奇偶性 如果是奇就是说明a 和b都是奇数,那么再在后面乘奇数答案绝对是奇数 反之a*b是偶数 阅读全文
posted @ 2019-02-10 20:12 悲离 阅读(134) 评论(0) 推荐(0)
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define INF 0x3f3f3f3f; #define ll long long ll gcd(ll p,ll q){r... 阅读全文
posted @ 2019-01-22 12:13 悲离 阅读(109) 评论(0) 推荐(0)
摘要:原题链接:点我转移 阅读全文
posted @ 2019-01-21 16:33 悲离 阅读(165) 评论(0) 推荐(0)
摘要:The heat during the last few days has been really intense. Scientists from all over the Berland study how the temperatures and weather change, and the 阅读全文
posted @ 2019-01-21 10:52 悲离 阅读(198) 评论(0) 推荐(0)
摘要:A. A Compatible Pairtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output Nian is a monster which live 阅读全文
posted @ 2019-01-20 21:12 悲离 阅读(261) 评论(0) 推荐(0)
摘要:就是直接肛就对了 阅读全文
posted @ 2019-01-07 21:31 悲离 阅读(311) 评论(0) 推荐(0)