欢乐纪中某B组赛【2019.1.24】

版权声明:原创,未经作者允许禁止转载 https://blog.csdn.net/Mr_wuyongcong/article/details/86624454

前言

划水 A K AK


成绩

R a n k Rank 是有算别人的

R a n k Rank P e r s o n Person S c o r e Score A A B B C C
1 1 2017 m y s e l f 2017myself 300 300 100 100 100 100 100 100
1 1 2017 x j q 2017xjq 300 300 100 100 100 100 100 100
9 9 2017 z y c 2017zyc 260 260 100 100 60 60 100 100
12 12 2017 x x y 2017xxy 250 250 100 100 100 100 50 50
34 34 2017 l r z 2017lrz 180 180 30 30 100 100 50 50
52 52 2017 l w 2017lw 130 130 30 30 100 100 0 0
72 72 2017 h z b 2017hzb 110 110 30 30 60 60 20 20
94 94 2017 h j q 2017hjq 60 60 30 30 30 30 0 0

正题


T1之前做过就直接放连接了

博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/82501562


T 2 : j z o j 3913 T2:jzoj3913- 艰难的选择【差分,统计】

博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/86624013


T 3 : j z o j 3914 T3:jzoj3914- 人品问题【树形 d p dp

博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/86624067


s o m e   o f   c o d e some\ of\ code


T1暴力

#include<cstdio>
#define ll long long
using namespace std;
ll x,y,ans;
int main()
{
	freopen("data.in","r",stdin);
	freopen("data.ans","w",stdout);
	scanf("%lld%lld",&x,&y);
	for(ll i=1;i<=y;i++)
	  ans+=x%i;
	printf("%lld",ans);
}

T1随机数据

#include<cstdio>
#include<cstdlib>
#include<ctime>
#define random(x) rand()*rand()%x+1
using namespace std;
int main()
{
	freopen("data.in","w",stdout);
	srand(time(0));
	printf("%d %d",random(1000000),random(1000000));
}

T2暴力

#include<cstdio>
#include<algorithm>
using namespace std;
int n,x[1010],sum[1010],ans;
int main()
{
	freopen("data.in","r",stdin);
	freopen("data.ans","w",stdout);
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&x[i]);
		sum[i]=sum[i-1]+x[i]*2-1;
	}
	for(int i=1;i<=n;i++){
		for(int j=i;j<=n;j++){
			if(!(sum[j]-sum[i-1]))
			  ans=max(ans,j-i+1);
		}
	}
	printf("%d",ans);
}

T2随机数据

#include<cstdio>
#include<cstdlib>
#include<ctime>
#define random(x) rand()*rand()%x+1
using namespace std;
int main()
{
	freopen("data.in","w",stdout);
	srand(time(0));
	printf("100000\n");
	for(int i=1;i<=100000;i++)
	  printf("%d ",rand()%2);
}

尾声

X J Q XJQ 竟然用 O ( n 2 ) O(n^2) 切掉了 T 2 T2

猜你喜欢

转载自blog.csdn.net/Mr_wuyongcong/article/details/86624454
今日推荐