-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeforces_AmusingJoke.cpp
More file actions
46 lines (29 loc) · 860 Bytes
/
Codeforces_AmusingJoke.cpp
File metadata and controls
46 lines (29 loc) · 860 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
#include <bits/stdc++.h>
using namespace std;
int main() {
string firstName, scndName, messedName;
cin >> firstName >> scndName >> messedName;
string jointName = firstName + scndName;
int counting = 0;
if(jointName.length() < messedName.length() || jointName.length() > messedName.length()) {
cout << "NO" << endl;
}
else {
for(int i = 0; i < jointName.length(); i++) {
for(int x = 0; x < messedName.length(); x++) {
if(jointName[i] == messedName[x]) {
messedName[x] = ' ';
counting++;
break;
}
}
}
if(counting == messedName.length()) {
cout << "YES" << endl;
}
else {
cout << "NO" << endl;
}
}
return 0;
}