/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 3ms 500.0 KiB
#2 Wrong Answer 19ms 532.0 KiB
#3 Accepted 16ms 532.0 KiB
#4 Accepted 4ms 532.0 KiB
#5 Accepted 36ms 536.0 KiB
#6 Accepted 29ms 532.0 KiB
#7 Accepted 30ms 344.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++;
       }
     
   }
   int res=0;
   if(count==10 || (count==9 && A[0]==0) )
   {
      res++;
   }
  if(cnt==10 || (cnt==9 && B[0]==0) )
   {
       res++;
   }
   if(res==2)
   {
       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:46:58
Judged At
2025-01-02 15:46:58
Judged By
Score
80
Total Time
36ms
Peak Memory
536.0 KiB