![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Atcoder比赛记录
Love_xyh
这个作者很懒,什么都没留下…
展开
-
AtCoder Beginner Contest 183
貌似昨天能第一场自主ak…都怪火锅…吃完回家就睡着了…A.#include <bits/stdc++.h>using namespace std;int n;int main(){ scanf("%d",&n); printf("%d\n",max(0,n));return 0;}B.#include <bits/stdc++.h>using namespace std;double x,y,xx,yy,h,l,k,ans;int main(原创 2020-11-16 20:17:55 · 201 阅读 · 0 评论 -
ARC064补题
C.很明显,不满足条件是尽量多删后面的#include <bits/stdc++.h>#define int long longusing namespace std;const int N=1e5+5; int n,x,ans;int a[N];signed main(){ scanf("%lld%lld",&n,&x); for (register int i=1; i<=n; ++i) scanf("%lld",&a[i]); for原创 2020-10-15 02:33:30 · 212 阅读 · 0 评论 -
ARC063补题
C.#include <bits/stdc++.h>using namespace std;int n,ans;char str[100005];int main(){ scanf("%s",str+1); n=strlen(str+1); for (register int i=2; i<=n; ++i) if (str[i]!=str[i-1]) ans++; printf("%d\n",ans);return 0; }D.找a[i]<a[j]且a[j原创 2020-10-15 02:02:33 · 209 阅读 · 0 评论 -
ARC060补题
C.若干个的平均数为k,那么就相当于总和为i*k。设f[i][i * k]表示用了i个,总和为i*k的方案数。(注意是用了i个而不是前i个)#include <bits/stdc++.h>#define int long longusing namespace std;const int N=51;int n,k,x,ans;int f[N][N*N];signed main(){ scanf("%lld%lld",&n,&k); f[0][0]=1; f原创 2020-10-15 01:40:05 · 162 阅读 · 0 评论 -
ARC059补题
C.从-100到100枚举一遍。#include <bits/stdc++.h>using namespace std;int n,ans,sum;int a[105];int main(){ scanf("%d",&n); for (register int i=1; i<=n; ++i) scanf("%d",&a[i]); ans=2e9; for (register int i=-100; i<=100; ++i) { sum=0;原创 2020-10-15 01:11:51 · 146 阅读 · 0 评论 -
ARC058补题
C.发现枚举到1e5即可覆盖所有情况。#include <bits/stdc++.h>using namespace std;int n,k,x;bool vis[10];int main(){ scanf("%d%d",&n,&k); for (register int i=1; i<=k; ++i) { scanf("%d",&x); vis[x]=true; } for (register int i=n; i<=9999原创 2020-10-15 01:04:28 · 170 阅读 · 0 评论 -
Atcoder ACL Beginner Contest
D.Flat Subsequencef[i]表示:数列最后一个为第i个的最大值,它可以由之前的,数值差绝对值在m以内的若干个f[j]转移而来。所以我们用一棵线段树,在a[j]的位置上把f[j]存下来,然后对于第i个值来说,只要查询:[max(a[i]-m,0),min(a[i]+m,300000)]区间内的最大f值即可。#include <bits/stdc++.h>using namespace std;const int N=3e5+5;int n,m,l,r,mid,ans;原创 2020-09-27 21:51:35 · 286 阅读 · 0 评论