lina_os

Untitled

Nov 9th, 2024
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main(){
  7.  
  8. int n;
  9. cin >> n;
  10. int arr[n], arr2[n];
  11. for(int i=0; i<n; i++){
  12. cin >> arr[i];
  13. }
  14. for(int j=0; j<n; j++){
  15. cin >> arr2[j];
  16. }bool flag=1;
  17. for(int i=0; i<n; i++){ // 4 2 3 7
  18. for(int j=0; j<n; j++){ // 2 3 4 9
  19. if (arr[i]!=arr2[j]){
  20. flag=0;
  21. }
  22. else {
  23. flag=1;
  24. break;
  25. }
  26. }
  27. if(flag==0) break;
  28. }
  29.  
  30. if(flag) cout << "yes";
  31. else cout << "no";
  32.  
  33. return 0;
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment