/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Wrong Answer 19ms 772.0 KiB
#3 Accepted 18ms 584.0 KiB
#4 Accepted 4ms 596.0 KiB
#5 Accepted 30ms 540.0 KiB
#6 Accepted 32ms 540.0 KiB
#7 Accepted 30ms 540.0 KiB

Code

#include <bits/stdc++.h>
#include <cmath>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
   int a,b;
   cin>>a>>b;
   int count=0;
   int cnt=0;
   std::vector<int>A(10,0) ;
   vector<int>B(10,0);
   for(int i=0;i<a;i++)
   {
       int c;
       cin>>c;
       if(A[c]==0)
       {
            A[c]=1;
            count++;
       }
      
   }
   for(int i=0;i<b;i++)
   {
       int c;
       cin>>c;
       if(B[c]==0)
       {
             B[c]=1;
             cnt++;
       }
     
   }
  if((count+cnt==20) || ((count+cnt==19) && A[0]+B[0]==1))
  {
      cout<<"YES"<<endl;
  }
  else
  {
      cout<<"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:52:41
Judged At
2025-01-02 15:52:41
Judged By
Score
80
Total Time
32ms
Peak Memory
772.0 KiB