欢乐纪中某A组赛【2019.1.19】

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

前言

因为 B B 有一堆(两道)题都做过,于是就来做A组了。


成绩

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
3 3 2017 m y s e l f 2017myself 210 210 100 100 100 100 10 10
22 22 2017 l r z 2017lrz 100 100 0 0 100 100 0 0
32 32 2017 x x y 2017xxy 50 50 0 0 50 50 0 0
36 36 2017 z y c 2017zyc 20 20 0 0 20 20 0 0
39 39 2017 h z b 2017hzb 0 0 0 0 0 0 0 0
39 39 2017 l w 2017lw 0 0 0 0 0 0 0 0
39 39 2017 h j q 2017hjq 0 0 0 0 0 0 0 0
39 39 2017 x j q 2017xjq 0 0 0 0 0 0 0 0

正题


T 1 : j z o j 2941 T1:jzoj2941- 贿赂【数学期望 , d f s ,dfs

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


T 2 : j z o j 2940 T2: jzoj2940- 生成输入数据【最小生成树 , , 并查集】

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


T 3 : j z o j 3771 T3:jzoj3771- 小Z的烦恼【高精度,数学】

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


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


T2 对拍

#include<cstdio>
#include<cstring>
using namespace std;
int n,m,s,t,pow[26];
bool v[1000010];
int main()
{
	scanf("%d",&t);
	pow[1]=1;
	for(int i=2;i<=25;i++)
		pow[i]=pow[i-1]*2;
	while(t--)
	{
		memset(v,0,sizeof(v));
		s=0;
		scanf("%d%d",&n,&m);
		for(int i=1;i<=n/m;i++)
	  	if(!v[i]&&i*pow[m]<=n)
	  	{
	  	  	s++;
	  	  	int j=i,k=1;
		  	while(j<=n&&k<=m){
		  	  	v[j]=true;
		  	  	j*=2;k++;
		  	}
	  	}
		printf("%d\n",s);
	}
}

尾声

Screenshot (2).png

猜你喜欢

转载自blog.csdn.net/Mr_wuyongcong/article/details/86553634