-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path18766.cpp
More file actions
58 lines (54 loc) · 1021 Bytes
/
18766.cpp
File metadata and controls
58 lines (54 loc) · 1021 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// 18766. 카드 바꿔치기
// 2021.02.06
// 정렬
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
int n;
cin >> n;
string s;
bool flag;
vector<string> v;
vector<string> v2;
for (int i = 0; i < n; i++)
{
flag = true;
int k;
cin >> k;
v.clear();
v2.clear();
for (int j = 0; j < k; j++)
{
cin >> s;
v.push_back(s);
}
for (int j = 0; j < k; j++)
{
cin >> s;
v2.push_back(s);
}
sort(v.begin(), v.end());
sort(v2.begin(), v2.end());
for (int j = 0; j < k; j++)
{
if (v[j] != v2[j])
{
flag = false;
break;
}
}
if (flag)
{
cout << "NOT CHEATER" << endl;
}
else
{
cout << "CHEATER" << endl;
}
}
return 0;
}