fork download
  1. /*
  2.  *
  3.  * Created By : Cyril Mishra
  4.  * DateTime:11 October 2022 (Tuesday) 20:23
  5.  *
  6.  */
  7.  
  8. #include <bits/stdc++.h>
  9.  
  10. using namespace std ;
  11.  
  12. #include <cstdio>
  13. #include <cstring>
  14. #include <cmath>
  15. #include <cstring>
  16. #include <chrono>
  17. #include <complex>
  18.  
  19. #define endl "\n"
  20. #define int long long int
  21. #define vi vector<int>
  22. #define vvi vector < vi >
  23. #define pii pair<int,int>
  24. #define mii map<int,int>
  25. #define pq priority_queue<int>
  26. #define mod 1000000007
  27. #define inf 1000000000000000001;
  28. #define all(c) c.begin(),c.end()
  29. #define mp(x,y) make_pair(x,y)
  30. #define sti set<int>
  31. #define mem(a,val) memset(a,val,sizeof(a))
  32. #define eb emplace_back
  33. #define ff first
  34. #define ss second
  35. #define null nullptr
  36. #define ii(x) int x; cin >> x;
  37. #define is(x) string x; cin >> x;
  38. #define trailZero(x) builtin_ctzll(x)
  39. #define loop(x,a,n) for(int x=a;x<n;x++)
  40. #define loopi(a, n) for(int i=a;i<n;i++)
  41. #define loopj(b, m) for(int j=b;j<m;j++)
  42. #define rloop(n, a) for(int i=n;i>=a;i--)
  43. #define setOne(x) builtin_popcountll(x)
  44. #define debug(x) cout<<#x<<": "<<x<<endl
  45. #define sp(x, y) fixed<<setprecision(y)<<x
  46. #define pqs priority_queue<int,vi,greater<int>>
  47. #define debug2(x, y) cout<<#x<<": "<<x<<", "<<#y<<": "<<y<<endl
  48. #define fast ios_base::sync_with_stdio(false);cin.tie(NULL)
  49. #define _pb push_back
  50.  
  51. #define tc int t=1;while(t--)
  52.  
  53.  
  54. const int MOD = 1e9 + 7;
  55. const int EPS = 1e-9;
  56. const int N = 1e5 + 5;
  57.  
  58. void solve(){
  59. string s1,s2 ;
  60. getline(cin,s1) ;
  61. getline(cin,s2) ;
  62. int h1[27] = {0}, h2[27] = {0} ;
  63. for(auto i:s1){
  64. h1[tolower(i)-'a'+1]++ ;
  65. }
  66. for(auto i:s2){
  67. h2[tolower(i)-'a'+1]++ ;
  68. }
  69. for(int i=1;i<27;i++){
  70. if(h2[i] != h1[i]){
  71. cout<<"NO"<<endl ;
  72. return ;
  73. }
  74. }
  75. cout<<"YES"<<endl ;
  76. }
  77.  
  78. signed main(){
  79. std::ios::sync_with_stdio(false);
  80. // cin.ignore(); must be there when using getline(cin, s)
  81. #ifdef SIEVE
  82. sieve();
  83. #endif
  84. #ifdef NCR
  85. init();
  86. #endif
  87. tc {
  88. solve() ;
  89. }
  90. return 0;
  91. }
Success #stdin #stdout 0.01s 5404KB
stdin
Instead of dogging Your footsteps it disappears but you dont notice anything
Your dog is upstears
stdout
NO