/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 340.0 KiB
#2 Accepted 8ms 564.0 KiB
#3 Accepted 8ms 532.0 KiB
#4 Accepted 3ms 324.0 KiB
#5 Accepted 23ms 536.0 KiB
#6 Accepted 24ms 532.0 KiB
#7 Accepted 19ms 532.0 KiB

Code

// Author: Mushfiq R.
#include <bits/stdc++.h>
#define endl "\n"
#define fastIO() (ios_base::sync_with_stdio(false), cin.tie(NULL));
using namespace std;

int main()
{
    fastIO();
    int t = 1;
    cin >> t;
    while (t--)
    {
        int m, n;
        cin >> m >> n;

        vector<bool> arr_f(4, false);
        for (int i = 0; i < m; i++)
        {
            int x;
            cin >> x;
            if (x < 4)
            {
                arr_f[x] = true;
            }
        }

        vector<bool> arr_s(n, false);
        for (int i = 0; i < n; i++)
        {
            int x;
            cin >> x;
            arr_s[x] = true;
        }

        int suma = count(arr_f.begin(), arr_f.end(), 1);
        int sumb = count(arr_s.begin(), arr_s.end(), 1);

        cout << (suma == 4 && sumb == 10 ? "YES" : "NO") << endl;
    }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1153 Is Date Possible?
Contest
Happy New Year 2025
Language
C++17 (G++ 13.2.0)
Submit At
2025-01-02 15:17:12
Judged At
2025-01-02 15:17:12
Judged By
Score
100
Total Time
24ms
Peak Memory
564.0 KiB