1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| #include <bits/stdc++.h> #define ull unsigned long long using namespace std; ull sd; string name[21]={"","海因","乔伊","西斯","特丽莎","链锯小姐","阿扎尔","莉安","凤凰", "普瑞斯特","钢铁之心","卡伦","西尔弗斯坦","卉子","海拉","赛琳娜","纳尔汗", "约翰","伊利亚","蕾琳","桃梨"}; int type[21]={0,1,2,2,1,3,1,3,3, 2,3,1,1,2,1,2,3, 1,1,2,3}; void print (int x,int y) { cout << x << " " << name[x] << endl; cout << y << " " << name[y] << endl; } int main () { FILE *fp; fp=fopen("seed.txt","r"); fscanf(fp,"%llu",&sd); fclose(fp); mt19937_64 myrand(sd); cout << sd << endl; int x=myrand()%20+1; if (x==14||x==15) {print(14,15);} else { while (1) { int y=myrand()%20+1; if (y==14||y==15) {continue;} if (type[x]==3&&type[y]==3) {continue;} print(min(x,y),max(x,y)); break; } } fp=fopen("seed.txt","w"); fprintf(fp,"%llu\n",myrand()); fclose(fp); return 0; }
|