upd2:⽐某个⾼明的随机⽅式更⾼明的随机⽅式
#include #define Fast_IO ios::sync_with_stdio(false); #define DEBUG fprintf(stderr,\"Running on Line %d in Function %s\\n\mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());#define fir first #define sec second#define mod 998244353#define ll long long#define inf 0x3f3f3f3f #define INF 0x3f3f3f3f3f3f3f3finline int read(){ char ch=getchar(); int nega=1; while(!isdigit(ch)) {if(ch=='-') nega=-1; ch=getchar();} int ans=0; while(isdigit(ch)) {ans=ans*10+ch-48;ch=getchar();} if(nega==-1) return -ans; return ans;} typedef pair void print(vector bool isvowel(char ch){return ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u';}bool isnormal(char ch){ if(ch=='j') return rnd()%20<=3; if(ch=='x') return rnd()%20<=5; if(ch=='z') return rnd()%20<=6; if(ch=='q') return rnd()%20<=6; if(ch=='k') return rnd()%20<=8; return 1;} bool chk(char x,char y){ if(x==y) return 0; if(!isvowel(x)&&!isvowel(y)) return 1; return 0;} signed main(){ for(int _=1;_<=1000;_++) { int lim=rnd()%4+6; for(int i=1;i<=lim;i++) { char ch=(i!=1&&rnd()%5<=2)?get1():get2(); while(((chk(ch,s[i-1])||!isnormal(ch))&&(rnd()%20<=15))||ch==s[i-1]) ch=(i!=1&&rnd()%5<=1)?get1():get2(); s[i]=ch; printf(\"%c\ } cout<<\"\\n\"; } return 0;} upd:⽐原来的随机⽅式更⾼明的随机⽅式 #include #define Fast_IO ios::sync_with_stdio(false); #define DEBUG fprintf(stderr,\"Running on Line %d in Function %s\\n\mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());#define fir first #define sec second#define mod 998244353#define ll long long#define inf 0x3f3f3f3f #define INF 0x3f3f3f3f3f3f3f3finline int read(){ char ch=getchar(); int nega=1; while(!isdigit(ch)) {if(ch=='-') nega=-1; ch=getchar();} int ans=0; while(isdigit(ch)) {ans=ans*10+ch-48;ch=getchar();} if(nega==-1) return -ans; return ans;} typedef pair void print(vector bool isvowel(char ch){return ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u';}bool isnormal(char ch){ if(ch=='j') return rnd()%20<=3; if(ch=='x') return rnd()%20<=5; if(ch=='z') return rnd()%20<=6; if(ch=='q') return rnd()%20<=6; if(ch=='k') return rnd()%20<=8; return 1;} bool chk(char x,char y){ if(x==y) return 0; if(isvowel(x)&&isvowel(y)) return 0; return 1;} signed main(){ for(int _=1;_<=1000;_++) { int lim=rnd()%4+6; for(int i=1;i<=lim;i++) { char ch=(i!=1&&rnd()%5<=2)?get1():get2(); while(!chk(ch,s[i-1])&&isnormal(ch)) ch=(i!=1&&rnd()%5<=1)?get1():get2(); s[i]=ch; printf(\"%c\ } cout<<\"\\n\"; } return 0;} 因篇幅问题不能全部显示,请点此查看更多更全内容