Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std ;
- #define sz(s) int(s.size())
- typedef long long ll ;
- void ABDEL3AL () {
- ios_base::sync_with_stdio(false); cin.tie(nullptr) , cout.tie(nullptr) ;
- #ifndef ONLINE_JUDGE
- freopen("input.txt" , "r" , stdin) , freopen("output.txt" , "w" , stdout) ;
- #endif
- }
- int main() {
- ABDEL3AL() ;
- string s , t ;
- getline(cin >> ws, s) ;
- getline(cin >> ws, t) ;
- int freq_f[127] = {0} ;
- int freq_s[127] = {0} ;
- for (int i = 0; i < sz(s); i++)
- if (s[i] != ' ')
- freq_f[s[i]]++ ;
- for (int i = 0; i < sz(t); i++)
- if (t[i] != ' ')
- freq_s[s[i]]++ ;
- bool found = true ;
- for (int i = 0; i < 127; i++)
- if (freq_s[i] && freq_f[i])
- if (freq_f[i] >= freq_s[i]);
- else found = false ;
- cout << (found ? "YES" : "NO") ;
- return 0;
- }
Add Comment
Please, Sign In to add comment