Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <vector>
- #include <set>
- #include <cmath>
- #include <map>
- #include <utility>
- #include <fstream>
- #include <bitset>
- typedef long long int ll;
- #define all(x) (x).begin(),(x).end()
- #define endl "\n";
- long double pi = 3.14159265358979;
- using namespace std;
- int inf = 1e9;
- ll MOD = 1e9+ 7;
- void fastIO() {
- ios_base::sync_with_stdio(false);
- cin.tie(0);
- cout.tie(0);
- }
- int main() {
- fastIO();
- vector <int> a(6);
- a[0] = 0;
- a[1] = 1;
- a[2] = 2;
- a[3] = 3;
- a[4] = 4;
- a[5] = 5;
- while (next_permutation(all(a))) {
- string s = "";
- for (int i = 0; i < 6; i++)
- s += (char)('a' + a[i]);
- char c90;
- char c200;
- char c300;
- char c1000;
- for (int i = 1; i <= 1000; i++) {
- char c1 = s[s.size() / 2 - 1];
- char c2 = s[s.size() / 2];
- string s1;
- s1.push_back(c1);
- s1.push_back(c2);
- s1 += s;
- s = s1;
- if (i == 90)
- c90 = s[0];
- if (i == 200)
- c200 = s[0];
- if (i == 30)
- c300 = s[0];
- if (i == 1000)
- c1000 = s[0];
- }
- if (c90 == 'd' && c200 == 'a' && c300 == 'c' && c1000 == 'b') {
- for (int i = 0; i < 6; i++) cout << a[i] << " ";
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement