Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main(){
- int n;
- cin >> n;
- int arr[n], arr2[n];
- for(int i=0; i<n; i++){
- cin >> arr[i];
- }
- for(int j=0; j<n; j++){
- cin >> arr2[j];
- }bool flag=1;
- for(int i=0; i<n; i++){ // 4 2 3 7
- for(int j=0; j<n; j++){ // 2 3 4 9
- if (arr[i]!=arr2[j]){
- flag=0;
- }
- else {
- flag=1;
- break;
- }
- }
- if(flag==0) break;
- }
- if(flag) cout << "yes";
- else cout << "no";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment