-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10763.cpp
More file actions
33 lines (32 loc) · 725 Bytes
/
10763.cpp
File metadata and controls
33 lines (32 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <bits/stdc++.h>
using namespace std;
int arr[500001], ab[500001];
int compare(const void* a, const void* b) {
int* ia = (int*)a;
int* ib = (int*)b;
return (*ia - *ib);
}
int main() {
int i, j, n;
while (scanf("%d", &n)) {
if (n == 0) {
break;
}
for (i = 0; i < n; i++) {
scanf("%d %d", &arr[i], &ab[i]);
}
qsort(arr, n, sizeof(int), compare);
qsort(ab, n, sizeof(int), compare);
for (i = 0; i < n; i++) {
if (arr[i] != ab[i]) {
break;
}
}
if (i == n) {
printf("YES\n");
} else {
printf("NO\n");
}
}
return 0;
}