Submission #75448208


Source Code Expand

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

// --- Type Definitions ---
using ll = long long;
using db = long double; 
using str = string;

// --- PBDS Ordered Multiset ---
using ordered_set = tree<pair<ll, int>, null_type, less<pair<ll, int>>, rb_tree_tag, tree_order_statistics_node_update>;

// --- Vectors & Pairs ---
using pi = pair<int,int>;
using pl = pair<ll,ll>;
using vi = vector<int>;
using vl = vector<ll>;

// --- Shortcuts ---
#define mp make_pair
#define f first
#define s second
#define pb push_back
#define eb emplace_back 
#define all(x) begin(x), end(x)
#define sor(x) sort(all(x))
#define rsz resize
#define sz(x) int((x).size())

// --- Loops ---
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define each(a,x) for (auto& a: x)

// --- Input/Output Optimization ---
void setIO(string name = "") {
    cin.tie(0)->sync_with_stdio(0);
    if (sz(name)) {
        freopen((name + ".in").c_str(), "r", stdin); 
        freopen((name + ".out").c_str(), "w", stdout);
    }
    cout << fixed << setprecision(15);
}

// --- Constant ---
const ll MOD = 1e9+7;
const int INF = 1e9;  

int main() {
    setIO(); 

    int C[3][7] = {0};

    F0R(i, 3) {
        F0R(j, 6) {
            int x; cin >> x;
            if (x >= 4 && x <= 6) {
                C[i][x]++;
            }
        }
    }

    vi p = {4, 5, 6};
    ll ways = 0;
    do {
        ways += C[0][p[0]] * C[1][p[1]] * C[2][p[2]];
    } while (next_permutation(all(p)));

    cout << (db)ways / 216.0 << "\n";

    return 0;
}

Submission Info

Submission Time
Task B - 456
User wrapper
Language C++23 (GCC 15.2.0)
Score 200
Code Size 1806 Byte
Status AC
Exec Time 1 ms
Memory 3852 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 14
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
random_01.txt AC 1 ms 3816 KiB
random_02.txt AC 1 ms 3852 KiB
random_03.txt AC 1 ms 3784 KiB
random_04.txt AC 1 ms 3784 KiB
random_05.txt AC 1 ms 3772 KiB
random_06.txt AC 1 ms 3812 KiB
random_07.txt AC 1 ms 3784 KiB
random_08.txt AC 1 ms 3712 KiB
random_09.txt AC 1 ms 3724 KiB
random_10.txt AC 1 ms 3772 KiB
random_11.txt AC 1 ms 3804 KiB
random_12.txt AC 1 ms 3812 KiB
sample_01.txt AC 1 ms 3756 KiB
sample_02.txt AC 1 ms 3852 KiB