一场讲述谁比谁更傻逼的普及组比赛,证明了
1、老张是魔鬼(为什么有这么多套普及组题??)
2、我最傻逼
第 1 题 谜题
判断1~99哪些数翻转后合法,找到最长的连续合法段的长度,为4,所以n<=4输出Yes否则输出No


1 //Achen
2 #include
3 #include
4 #include
5 #include
6 #include
7 #include
8 #include
9 #include
10 #include<set>
11 #include
第 2 题 选修课
贪心,排序后选择最大的m个,看第m大的数后面有没有和它相同的数,把这些相同的数找出来组合数算答案即可。


1 //Achen 2 #include3 #include ; 48 else { 49 For(i,0,26) C[i][0]=1; 50 For(i,1,26) For(j,1,i) C[i][j]=C[i-1][j]+C[i-1][j-1]; 51 int tpa=0,tpb=0; 52 For(i,1,26) if(cnt[m]!=0&&cnt[i]==cnt[m]) tpa++; 53 For(i,1,m) if(cnt[i]!=0&&cnt[i]==cnt[m]) tpb++; 54 ans2=C[tpa][tpb]; 55 } 56 printf("%lld %lld\n",ans1,ans2); 57 Formylove; 58 }4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include<set> 11 #include
第 3 题 质数
搜根号以内的质数根号以外的贪心,不知道见过多少遍这种操作了。把数据范围看错了爆炸了。


1 //Achen 2 #include3 #include ; 44 For(i,0,up) { 45 int tpans=0; 46 memset(ok,0,sizeof(ok)); 47 For(j,1,cnt) if(i&(1<4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include<set> 11 #include 1)) { 48 For(k,1,n/p2[j]) 49 ok[k*p2[j]]^=1; 50 } 51 For(j,1,m) if(p[j]>31) { 52 int c1=0,c2=0; 53 For(k,1,n/p[j]) { 54 if(ok[k*p[j]]) c1++; 55 else c2++; 56 } 57 if(c1<c2) { 58 For(k,1,n/p[j]) ok[k*p[j]]^=1; 59 } 60 } 61 For(i,1,n) tpans+=ok[i]; 62 ans=max(ans,tpans); 63 } 64 printf("%d\n",ans); 65 } 66 Formylove; 67 } 68 /* 69 4 70 10 2 71 2 5 72 21 4 73 2 3 5 7 74 100 1 75 5 76 100 3 77 3 19 7 78 */