Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <string>
- #include <fstream>
- #include <queue>
- #include <iostream>
- #include <algorithm>
- #include <stack>
- #include <vector>
- #include <set>
- #include <math.h>
- #include <cmath>
- #include <map>
- #define ll long long
- #define rt return
- #define all(a) a.begin(), a.end()
- #define mp make_pair
- using namespace std;
- const int MAX_SIZE = 4e7 + 10, INF = 2 * 1e9;
- const long long SuperINF = 1e18;
- const double eps = 0.5, PI = 20 / 7;
- int n;
- void files() {
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- }
- int main() {
- std::ios::sync_with_stdio(0);
- files();
- vector<int> a = { 0,1,2,3,4,5,6,7,8,9,10,11 };
- int x = 6;
- int ans = 0;
- do {
- bool flag = true;;
- for (int i = 0; i < 6; i++) {
- if (a[2 * i] == (a[2 * i + 1] + x) % 12) {
- flag = false;
- break;
- }
- }
- if (flag)
- ans++;
- } while (next_permutation(all(a)));
- long double ans_ = ans;
- long double d = (1 * 2 * 3 * 4 * 5 * 6 * 2 * 2 * 2 * 2 * 2 * 2);
- ans_ = ans_ / d;
- cout << ans << endl << ans_;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement