-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path584-amusing-joke.cpp
More file actions
49 lines (47 loc) · 1.17 KB
/
Copy path584-amusing-joke.cpp
File metadata and controls
49 lines (47 loc) · 1.17 KB
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
/*
* Amusing Joke [141A]
* Problem: https://codeforces.com/problemset/problem/141/A
* Verdict: ACCEPTED Solved: 2020-09-19
* Language: C++17 (GCC 7-32)
* Runtime: 62 ms Memory: 0 KB
* Tags: implementation, sortings, strings
* Author: BidoTeima
* Source: https://codeforces.com/contest/141/submission/93283896
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int freq_arr_shuffled[91] = {0};
int freq_arr_names[91] = {0};
void test_case()
{
string s1, s2;
cin>>s1>>s2;
s1+=s2;
string shuffled;
cin>>shuffled;
if((int)shuffled.length() == (int)s1.length()) {
for(int i = 0; i < (int)shuffled.length(); i++) {
++freq_arr_shuffled[shuffled[i]];
}
for(int i = 0; i < (int)s1.length(); i++) {
++freq_arr_names[s1[i]];
}
for(char i = 'A'; i <= 'Z'; i++) {
if(freq_arr_shuffled[i] != freq_arr_names[i]) {
cout << "NO";
return;
}
}
cout << "YES";
}
else cout << "NO";
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
test_case();
return 0;
}