/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 536.0 KiB
#2 Wrong Answer 19ms 396.0 KiB
#3 Wrong Answer 16ms 532.0 KiB

Code

#include <bits/stdc++.h>
#include <cmath>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
   int a,b;
   int count=0,cnt=0;
   cin>>a>>b;
  vector<int>vis;
   std::vector<int>A(10,0) ;
   vector<int>B(10,0);
   int k=0;
   for(int i=0;i<a;i++)
   {
       int c;
       cin>>c;
       if(A[c]==0)
       {
            A[c]=1;
            count++;
           vis.push_back(c);
       }
      
   }
   for(int i=0;i<b;i++)
   {
       int c;
       cin>>c;
       if(B[c]==0)
       {
             B[c]=1;
             cnt++;
             if(A[c]==0)
             {
                vis.push_back(c);
             }
       }
     
   }
   int res=0;
 if(vis.size()==10)
 {
     res++;
 }
 if(A[1]+B[1]==2 && A[2]+B[2]==2)
 {
    res++;
 }
 if(A[0]==1 && B[0]==0 && cnt>=9|| B[0]==1 && A[0]==0 && count>=9 || A[0]+B[0]==2)
 {
    res++;
 }
 if(res==3)
 {
     cout<<"YES"<<endl;
 }
 else
 {
     cout<<"NO"<<endl;
 }
 }
   
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1153 Is Date Possible?
Language
C++17 (G++ 13.2.0)
Submit At
2025-01-03 03:36:08
Judged At
2025-01-03 03:36:08
Judged By
Score
0
Total Time
19ms
Peak Memory
536.0 KiB