codeforces
文章平均质量分 58
无奈>_<
这个作者很懒,什么都没留下…
展开
-
有关前缀和知识的总结
前缀和顾名思义就是求一个序列的前缀之和,它能够在O(1)的时间复杂度内求得区间的值。前缀和的最基本用法:典型例题E. Yonagi and YOASOBI#include<bits/stdc++.h>using namespace std;const long long N=1e6+7;struct node{ long long a; long long ah; long long ahh;}b[N];char c[N];int main(){ cin>原创 2022-04-24 17:04:26 · 399 阅读 · 0 评论 -
Codeforces Round #768 (Div. 2) A~C题解
Problem A:本题大意为存在两个长度相等的数组a、b,任意选择索引i,交换数组ai,bi的值,使得a数组的最大值乘以b数组的最大值最小。本题不难想到我们可以遍历数组,依次将比较大的放到a数组内,否则放到b数组内。AC代码:#include<bits/stdc++.h>using namespace std;int a[1000001];int b[1000001];int main(){ int t; cin>>t; while原创 2022-01-28 14:36:28 · 1220 阅读 · 1 评论 -
Educational Codeforces Round 121 [Rated for Div. 2]A~C题解
A题:本题目大意为输出一个字符串,其字符串的每一个相同字符的距离为定值,输出任意一种情况即可。做题的时候可以直接统计字符串的个数,并统一一起输出。题目较简单,具体代码如下:...原创 2022-01-17 14:20:15 · 427 阅读 · 0 评论