上一页 1 ··· 3 4 5 6 7 8 下一页
摘要: 题目链接:http://codeforces.com/problemset/problem/1133/C 题目分析 (个人感受:我看错了题目,硬是写了近一个小时!) 这个题目要求一个最长的序列,使得这个序列的每一个数之间的差值的绝对值都小于或等于5。 想到求序列中的数的差值的问题,我在想,如果这个序 阅读全文
posted @ 2019-03-30 23:33 winter-bamboo 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/1133/B 题目分析 读完题目,凡是先暴力.....(不用想,第四组数据就TLE了,QAQ) 当两个数的和为k的倍数的时候就凑成一组,那么一定有 (a+b) % k == (a%k + b %k) % k 阅读全文
posted @ 2019-03-30 20:57 winter-bamboo 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 题目链接:codeforces.com/problemset/problem/1136/B 题目分析 首先,读完题目,看了是个B题,嗯嗯...... 果断找规律,然后交了一波,居然过了!!! 代码区 阅读全文
posted @ 2019-03-29 21:43 winter-bamboo 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/1136/C 题目分析 看了题目之后,第一想法:任意位置都可以倒置,要是枚举,铁定的超时。所以需要探索规律...... 结果发现,任意的两个数,如果可以交换,其横纵坐标之和一定相同,所以我们只需要用一个数组存 阅读全文
posted @ 2019-03-29 13:37 winter-bamboo 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 原理分析 求a^n的值,按照传统的写法就是用一个数ans = 1 ,乘n次a,这样的时间复杂度为O(n),而快速幂算法是基于二进制,可以将时间复杂度将为log(n) 举个例子,我们要求3^11,我们可以写成 3^(2^3+2^1+2^0),... 阅读全文
posted @ 2019-03-28 12:57 winter-bamboo 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Description You have a string ss of length nn consisting of only characters > and <. You may do some operations with this string, for each operation y 阅读全文
posted @ 2019-03-26 15:59 winter-bamboo 阅读(347) 评论(0) 推荐(0) 编辑
摘要: Description An array of integers p1,p2,…,pnp1,p2,…,pn is called a permutation if it contains each number from 11 to nn exactly once. For example, the 阅读全文
posted @ 2019-03-26 13:21 winter-bamboo 阅读(710) 评论(0) 推荐(0) 编辑
摘要: Description There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this "How far is i 阅读全文
posted @ 2019-02-17 15:39 winter-bamboo 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Description Kiki likes traveling. One day she finds a magic lamp, unfortunately the genie in the lamp is not so kind. Kiki must answer a question, and 阅读全文
posted @ 2019-02-16 16:01 winter-bamboo 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Description The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral poste 阅读全文
posted @ 2019-02-11 21:25 winter-bamboo 阅读(134) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 下一页