/ SeriousOJ /

Record Detail

Runtime Error


  
# Status Time Cost Memory Cost
#1 Runtime Error 1ms 532.0 KiB
#2 Runtime Error 2ms 792.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;

        int arr_f[4] = {0};
        for (int i = 0; i < m; i++)
        {
            int x;
            cin >> x;
            if (x < 4)
            {
                arr_f[x] = 1;
            }
        }

        int arr_s[n] = {0};
        for (int i = 0; i < n; i++)
        {
            int x;
            cin >> x;
            arr_s[x] = 1;
        }

        int suma = accumulate(arr_f, arr_f + 3, 0);
        int sumb = accumulate(arr_s, arr_s + n, 0);

        cout << (suma == 3 && 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:08:22
Judged At
2025-01-02 15:08:22
Judged By
Score
0
Total Time
2ms
Peak Memory
792.0 KiB