上一页 1 ··· 7 8 9 10 11 12 13 下一页
摘要: "C. Phoenix and Distribution" 题意 :给定长度为n的字符串s,将s任意拆分成k个部分,求k个部分中字典序最大的最小字典序 思路: 因为是任意拆分,所以将s中的字母从小到大排序,那么字典序最小的字母为s[1],记它的个数为p 实际上要求的还是最小字典序,那么在构造这k个部 阅读全文
posted @ 2020-05-14 20:22 StreamAzure 阅读(160) 评论(0) 推荐(0)
摘要: "C.Orac and LCM" 题意: 给定一个长度为$n$的数组,求$gcd\{{lcm(a_i,a_j)|i using namespace std; const int maxn = 3e5 + 10; typedef long long LL; LL gcd(LL a, LL b) {re 阅读全文
posted @ 2020-05-13 17:07 StreamAzure 阅读(628) 评论(0) 推荐(1)
摘要: [Codeforces Round 640 (Div. 4) G. Special Permutation](https://codeforces.com/contest/1352/problem/G) 题意:输出一个全排列,要求相邻数字之差的绝对值≥2且≤4. 思路: 不难发现n必须≥4,且n=4 阅读全文
posted @ 2020-05-11 01:39 StreamAzure 阅读(443) 评论(0) 推荐(0)
摘要: [Codeforces Round 640 (Div. 4) D. Alice, Bob and Candies](https://codeforces.com/contest/1352/problem/D) 题意:两个人轮流吃数组,一个从左端开始(第一次只吃a[1]),另一个从右端开始,吃掉的元素 阅读全文
posted @ 2020-05-10 21:43 StreamAzure 阅读(265) 评论(0) 推荐(0)
摘要: [Codeforces Round 640 (Div. 4) E. Special Elements](https://codeforces.com/contest/1352/problem/E) 题意:给定元素个数8000的就不要装了,没必要并且会越界 阅读全文
posted @ 2020-05-10 21:20 StreamAzure 阅读(413) 评论(0) 推荐(1)
摘要: [Codeforces Round 640 (Div. 4) B. Same Parity Summands](https://codeforces.com/contest/1352/problem/B) 题意:给定和n与数字个数k,问能否有k个偶数/奇数之和为n 思路:先填k 1个1或者k 1个2 阅读全文
posted @ 2020-05-10 20:51 StreamAzure 阅读(314) 评论(0) 推荐(0)
摘要: 类的声明 class Stock//某人持有的股票 { private://私有成员,只能通过公用方法间接访问 std::string company;//股票所属公司 long shares;//持股数量 double share_value;//股票单价 double total_value;/ 阅读全文
posted @ 2020-04-29 22:55 StreamAzure 阅读(225) 评论(0) 推荐(0)
摘要: 快速幂 原理 求$a^b$。 例如,$b=11$时,其二进制为$1011$,又有$11=23\times 1+22 \times 0+21 \times 1+20 \times 1$ 所以 \[ a^{11}=a^{2^3+2^1+2^0}​ \] 从而 \[ a^{11}=a^{2^3} \tim 阅读全文
posted @ 2020-04-29 18:07 StreamAzure 阅读(152) 评论(0) 推荐(0)
摘要: 有n个持有若干把钥匙的人(每个人持有的钥匙数相同)和若干把锁,任选m个人可以打开所有的锁,但小于m个人就不能打开所有的锁,给定n,m,求至少要有多少把锁、每个人至少要配多少把钥匙。 阅读全文
posted @ 2020-04-24 21:41 StreamAzure 阅读(213) 评论(0) 推荐(0)
摘要: https://www.cnblogs.com/stelayuri/p/12749332.html 待整理 阅读全文
posted @ 2020-04-23 18:10 StreamAzure 阅读(325) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 下一页