/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Wrong Answer 18ms 532.0 KiB
#3 Wrong Answer 19ms 560.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n,m;
        cin>>n>>m;
        
        vector<int>lst1(n);
        vector<int>lst2(m);
        
        for(int i = 0; i<n; i++)
        {
            cin>>lst1[i];
        }
        for(int i = 0; i<m; i++)
        {
            cin>>lst2[i];
        }
        
        int flag = 0, flag2 = 0;
        
        for(int i = 0; i<n; i++)
        {
            if(lst1[i] == 0)
            {
                flag++;
            }
            else if(lst1[i] == 1)
            {
                flag++;
            }
            else if(lst1[i] == 2)
            {
                flag++;
            }
            else if(lst1[i] == 3)
            {
                flag++;
            }
        }
        
        for(int i = 0; i<m; i++)
        {
            if(lst2[i] == 0)
            {
                flag2++;
            }
            else if(lst2[i] == 1)
            {
                flag2++;
            }
            else if(lst2[i] == 2)
            {
                flag2++;
            }
            else if(lst2[i] == 3)
            {
                flag2++;
            }
        }
        
        if(flag >= 4 && flag2 >= 4)
        {
            cout<<"YES"<<endl;
        }
        else 
        {
            cout<<"NO"<<endl;
        }
        
    }
}

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:03:38
Judged At
2025-01-02 15:03:38
Judged By
Score
0
Total Time
19ms
Peak Memory
560.0 KiB