Submission #64044476


Source Code Expand

Copy
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define int long long
#define fn for (int i = 0; i < n; i++)
#define fm for (int i = 0; i < m; i++)
#define f(i, a, n) for (int i = a; i < n; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
#define sort(a) sort(a.begin(), a.end())
#define vi vector<int> v
#define vvi vector<vector<int>>
#define vpi vector<pair<int, int>>
#define p(ans) cout << ans << endl;
#define yes cout << 'Y' << 'E' << 'S' << endl;
#define no cout << 'N' << 'O' << endl;
#define inp(v) \
int x; \
cin >> x; \
v.push_back(x)
using namespace std;
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define int long long
#define fn for (int i = 0; i < n; i++)
#define fm for (int i = 0; i < m; i++)
#define f(i, a, n) for (int i = a; i < n; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
#define sort(a) sort(a.begin(), a.end())
#define vi vector<int> v
#define vvi vector<vector<int>>
#define vpi vector<pair<int, int>>
#define p(ans) cout << ans << endl;
#define yes cout << 'Y' << 'E' << 'S' << endl;
#define no cout << 'N' << 'O' << endl;
#define inp(v) \
    int x;     \
    cin >> x;  \
    v.push_back(x)
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds; // find_by_order, order_of_key  less-> increasing order  greater->dreasing order
//  *A.find_order_of(index)-> give element at that index
// A.order_of_key(x)->gives no of ele less than x (unique ele present) in case of inc set  A.lower_bound(ele)->gives iterator of lb
class dsu
{
public:
    vector<int> rank, parent, size;
    dsu(int n)
    {
        rank.resize(n + 1, 0);
        parent.resize(n + 1);
        size.resize(n + 1, 1);
        for (int i = 0; i <= n; i++)
            parent[i] = i;
    }
    int find(int node)
    {
        if (node == parent[node])
            return node;
        return parent[node] = find(parent[node]);
    }
    void unionbysize(int u, int v)
    {
        int p1 = find(u);
        int p2 = find(v);
        if (p1 == p2)
            return;
        if (size[p1] < size[p2])
        {
            parent[p1] = p2;
            size[p2] += size[p1];
        }
        else
        {
            parent[p2] = p1;
            size[p1] += size[p2];
        }
    }
    void unionbyrank(int u, int v)
    {
        int p1 = find(u);
        int p2 = find(v);
        if (p1 == p2)
            return;
        if (rank[p1] < rank[p2])
        {
            parent[p1] = p2;
        }
        else if (rank[p1] > rank[p2])
            parent[p2] = p1;
        else
        {
            parent[p1] = p2;
            rank[p2]++;
        }
    }
};
bool p_check(int n)
{
    for (int i = 2; i * i <= n; i++)
    {
        if (n % i == 0)
        {
            return false;
        }
    }
    return true;
}
int modExp(int base, int exp, int mod)
{
    int result = 1;
    base = base % mod;
    while (exp > 0)
    {
        if (exp % 2 == 1)
        {
            result = (result * base) % mod;
        }
        base = (base * base) % mod;
        exp /= 2;
    }
    return result;
}
int modInverse(int Q, int mod) { return modExp(Q, mod - 2, mod); }
int power(int a, int b)
{
    if (b == 0)
        return 1;
    else if (b == 1)
        return a;
    int ans = power(a, b / 2);
    if (b % 2 == 0)
        return ans * ans;
    else
        return ans * ans * a;
}
int gcd(int a, int b)
{
    if (a % b == 0)
        return b;
    return gcd(b, a % b);
}
int lcm(int a, int b)
{
    int ans = (a * b) / (gcd(a, b));
    return ans;
}
int quary(string &s)
{
    cout << '?' << s << endl;
    cout.flush();
    int t;
    cin >> t;
    return t;
}
int32_t main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    // cin >> t;
    t = 1;
    while (t--)
    {
        int n = 7;
        vi;
        map<int, int> mp;
        fn
        {
            inp(v);
            mp[x]++;
        }

        vector<int> b;
        for (auto it : mp)
        {
            b.push_back(it.second);
        }
        sort(b);
        if (b.size() >= 2)
        {
            int c = b.back();
            int d = b[b.size() - 2];
            if (c >= 3 && d >= 2)
            {
                cout << "Yes" << endl;
            }
            else
            {
                cout << "No" << endl;
            }
        }
        else
        {
            cout << "No" << endl;
        }
    }
}

Submission Info

Submission Time
Task B - Full House 3
User rishabh_638413
Language C++ 20 (gcc 12.2)
Score 250
Code Size 4117 Byte
Status AC
Exec Time 1 ms
Memory 3556 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 3404 KB
hand_02.txt AC 1 ms 3344 KB
hand_03.txt AC 1 ms 3436 KB
hand_04.txt AC 1 ms 3540 KB
sample_01.txt AC 1 ms 3468 KB
sample_02.txt AC 1 ms 3484 KB
sample_03.txt AC 1 ms 3344 KB
sample_04.txt AC 1 ms 3432 KB
test_01.txt AC 1 ms 3428 KB
test_02.txt AC 1 ms 3428 KB
test_03.txt AC 1 ms 3548 KB
test_04.txt AC 1 ms 3428 KB
test_05.txt AC 1 ms 3476 KB
test_06.txt AC 1 ms 3468 KB
test_07.txt AC 1 ms 3404 KB
test_08.txt AC 1 ms 3480 KB
test_09.txt AC 1 ms 3492 KB
test_10.txt AC 1 ms 3484 KB
test_11.txt AC 1 ms 3480 KB
test_12.txt AC 1 ms 3424 KB
test_13.txt AC 1 ms 3468 KB
test_14.txt AC 1 ms 3476 KB
test_15.txt AC 1 ms 3548 KB
test_16.txt AC 1 ms 3480 KB
test_17.txt AC 1 ms 3484 KB
test_18.txt AC 1 ms 3476 KB
test_19.txt AC 1 ms 3400 KB
test_20.txt AC 1 ms 3488 KB
test_21.txt AC 1 ms 3556 KB
test_22.txt AC 1 ms 3552 KB
test_23.txt AC 1 ms 3452 KB
test_24.txt AC 1 ms 3488 KB
test_25.txt AC 1 ms 3544 KB
test_26.txt AC 1 ms 3476 KB


2025-04-11 (Fri)
17:09:18 +00:00