Advertisement
sherry_ahmos

Untitled

Dec 20th, 2021
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     long long size,sizesqu;
  8.     cin>>size>>sizesqu;
  9.     long long arr[size],arrsqu[sizesqu];
  10.     for(int i=0;i<size;i++){
  11.         cin>>arr[i];
  12.     }
  13.     for(int i=0;i<sizesqu;i++){
  14.         cin>>arrsqu[i];
  15.     }
  16.     int z=0;
  17.     int couter=0;
  18.     for(int i=0;i<size;i++){
  19.         if(arr[i]==arrsqu[z]){
  20.             couter++;
  21.             z++;
  22.         }
  23.     }
  24.     if(couter==sizesqu){
  25.             cout<<"YES";
  26.     }else{
  27.          cout<<"NO";
  28.     }
  29.     return 0;
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement