版本比较
题解:CF123A Prime Permutation
正文
增加 2 行删除 2 行
28 行未改动2930313233333435363738394041414243444511 行未改动28 行未改动 if (k%i==0) return false; return true;}int main (){ { cin>>s; rep (i,0,s.size ()-1) st[s[i]]++; for (auto i:st) if (maxn<i.second) maxn=i.second,p=i.first; rep (i,2,s.size ()) if (!prime (i)) b[i]=1,sp++; else if (i<=s.size ()/2) b[i]=1,sp++; else if (i<=s.size ()/2) b[i]=1,sp++; if (maxn<sp) cout<<"NO\n",exit (0); cout<<"YES\n",st[p]-=sp; rep (i,1,s.size ()) if (b[i]) a[i]=p;11 行未改动