版权声明:原创,未经作者允许禁止转载 https://blog.csdn.net/Mr_wuyongcong/article/details/86553634
前言
因为 有一堆(两道)题都做过,于是就来做A组了。
成绩
是有算别人的
正题
贿赂【数学期望 】
博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/86553257
生成输入数据【最小生成树 并查集】
博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/86553318
小Z的烦恼【高精度,数学】
博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/86553496
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);
}
}