Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <bitset>
- #include <algorithm>
- #include <memory.h>
- #include <utility>
- #include <vector>
- #include <time.h>
- #include <assert.h>
- #include <chrono>
- #include <random>
- #define ll long long
- using namespace std;
- const int N = (int)123;
- mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
- string s[] = {"Artur", "Islam", "Try", "Doni", "Mirbek bro", "Abil", "Omur", "Shabdan"};
- vector < int > gr[N];
- string S[N];
- void dfs(int v) {
- int res = uniform_int_distribution<int>(0, 999)(rng);
- res %= 2;
- if (gr[v].size() == 0) {
- S[v] = s[v - 8];
- return ;
- }
- dfs(gr[v][0]);
- dfs(gr[v][1]);
- if (res == 0) {
- S[v] = S[gr[v][0]];
- } else {
- S[v] = S[gr[v][1]];
- }
- }
- void jdi() {
- double now = clock() * 1.0 / CLOCKS_PER_SEC;
- int asd = 0;
- while (clock() * 1.0 / CLOCKS_PER_SEC - now <= 3) {
- asd++;
- }
- }
- main() {
- shuffle(s, s + 8, rng);
- gr[1].push_back(2);
- gr[1].push_back(3);
- gr[2].push_back(4);
- gr[2].push_back(5);
- gr[3].push_back(6);
- gr[3].push_back(7);
- gr[4].push_back(8);
- gr[4].push_back(9);
- gr[5].push_back(10);
- gr[5].push_back(11);
- gr[6].push_back(12);
- gr[6].push_back(13);
- gr[7].push_back(14);
- gr[7].push_back(15);
- dfs(1);
- srand(time(0));
- for (int i = 8; i <= 15; i += 2) {
- jdi();
- cout << S[i] << '*' << S[i + 1];
- if (i != 14) {
- cout << "||";
- }
- }
- cout << endl;
- //***********
- for (int i = 1; i <= 12; i++) {
- cout << ' ';
- }
- jdi();
- cout << S[4] << '*' << S[5];
- jdi();
- cout << "||||" << S[6] << '*' << S[7] << endl;
- jdi();
- for (int i = 1; i <= 17; i++) {
- cout << ' ';
- }
- cout << S[2] << "*" << S[3];
- cout << endl;
- jdi();
- for (int i = 1; i <= 20; i++) {
- cout << ' ';
- }
- cout << S[1];
- cout << endl << endl;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement