Submission #64044277


Source Code Expand

Copy
#include<bits/stdc++.h>
#define int long long
#define endl "\n"
#define pb push_back
#define ceil(n, m) (((n) + (m) - 1) / (m))
#define all(a) (a).begin(), (a).end()
#define add_mod(a, b) (((a % modn) + (b % modn)) % modn)
#define sub_mod(a, b) (((a % modn) - (b % modn) + modn) % modn)
#define mul_mod(a, b) (((a % modn) * (b % modn)) % modn)
#define modn 1000000007
using namespace std;
int power(int a, int b) {
int ans = 1;
while (b) {
if (b & 1) {
ans = (ans * 1ll * a);
}
b >>= 1;
a = (a * 1ll * a);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include<bits/stdc++.h>
#define int long long
#define endl "\n"
#define pb push_back
#define ceil(n, m) (((n) + (m) - 1) / (m))
#define all(a) (a).begin(), (a).end()
#define add_mod(a, b) (((a % modn) + (b % modn)) % modn)
#define sub_mod(a, b) (((a % modn) - (b % modn) + modn) % modn)
#define mul_mod(a, b) (((a % modn) * (b % modn)) % modn)
#define modn 1000000007
using namespace std;


int power(int a, int b) {
    int ans = 1;
    while (b) {
        if (b & 1) {
            ans = (ans * 1ll *  a);
        }
        b >>= 1;
        a = (a * 1ll * a);
    }
    return ans;
}

int binpow(int a, int b, int mod) {
    if (b == 0)
        return 1;
    if (b % 2) {
        return a * binpow(a, b - 1, mod) % mod;
    } else {
        int temp = binpow(a, b / 2, mod);
        return temp * temp % mod;
    }
}

int fact(int n) {
    int res = 1;
    for (int i = 1; i <= n; i++) {
        res = res * 1ll * i % modn;
    }
    return res;
}

int nCr(int n, int k) {
    return fact(n) * binpow(fact(k), modn - 2, modn) % modn * binpow(fact(n - k), modn - 2, modn) % modn;
}

void solve()
{
    map<int, int> mp;
    vector<int> f;
    for (int i = 0; i < 7; i++) {
        int x;
        cin >> x;
        mp[x]++;
    }
    for (auto &v : mp) f.pb(v.second);
    sort(f.begin(), f.end(), greater<int>());
    if (f.size() >= 2 && f[0] >= 3 && f[1] >= 2) cout << "Yes" << endl;
    else cout << "No" << endl;
}


int32_t main() {

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

#ifdef ONLINEJUDGE
    clock_t tStart = clock();
    freopen("inputf.in", "r", stdin); //can need to change file . this one for taking input
    freopen("outputf.out", "w", stdout); // this one for output
#endif

    //Your Code

#ifdef ONLINEJUDGE
    fprintf(stderr, "\n>> Runtime: %.10fs\n", (double) (clock() - tStart) / CLOCKS_PER_SEC); // this line gives your code runtime
#endif


    int t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
    }

    return 0;
}

Submission Info

Submission Time
Task B - Full House 3
User terra_sapien
Language C++ 20 (gcc 12.2)
Score 250
Code Size 2074 Byte
Status AC
Exec Time 1 ms
Memory 3612 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 250 / 250
Status
AC × 4
AC × 34
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt
Case Name Status Exec Time Memory
hand_01.txt AC 1 ms 3484 KB
hand_02.txt AC 1 ms 3480 KB
hand_03.txt AC 1 ms 3524 KB
hand_04.txt AC 1 ms 3408 KB
sample_01.txt AC 1 ms 3492 KB
sample_02.txt AC 1 ms 3336 KB
sample_03.txt AC 1 ms 3472 KB
sample_04.txt AC 1 ms 3332 KB
test_01.txt AC 1 ms 3416 KB
test_02.txt AC 1 ms 3424 KB
test_03.txt AC 1 ms 3404 KB
test_04.txt AC 1 ms 3476 KB
test_05.txt AC 1 ms 3444 KB
test_06.txt AC 1 ms 3420 KB
test_07.txt AC 1 ms 3424 KB
test_08.txt AC 1 ms 3448 KB
test_09.txt AC 1 ms 3476 KB
test_10.txt AC 1 ms 3492 KB
test_11.txt AC 1 ms 3476 KB
test_12.txt AC 1 ms 3332 KB
test_13.txt AC 1 ms 3492 KB
test_14.txt AC 1 ms 3540 KB
test_15.txt AC 1 ms 3392 KB
test_16.txt AC 1 ms 3464 KB
test_17.txt AC 1 ms 3404 KB
test_18.txt AC 1 ms 3428 KB
test_19.txt AC 1 ms 3612 KB
test_20.txt AC 1 ms 3476 KB
test_21.txt AC 1 ms 3480 KB
test_22.txt AC 1 ms 3480 KB
test_23.txt AC 1 ms 3608 KB
test_24.txt AC 1 ms 3464 KB
test_25.txt AC 1 ms 3476 KB
test_26.txt AC 1 ms 3464 KB


2025-04-08 (Tue)
19:57:38 +00:00