SHARE
TWEET

Untitled

a guest Sep 17th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. typedef long long int ll;
  6.  
  7. int alfa[26];
  8.  
  9. int main(){
  10.     memset(alfa,0,sizeof(alfa));
  11.     int n, m, k;
  12.     cin >> n >> m >> k;
  13.     for(int i = 0; i < n; i++){
  14.         string s; cin >> s;
  15.         for(int j = 0; j < s.size(); j++)
  16.             alfa[s[j]-'a']++;
  17.     }
  18.     for(int i = 0; i < m; i++){
  19.         string s; cin >> s;
  20.         for(int j = 0; j < s.size(); j++){
  21.             if(alfa[(s[j]-'a'+k)%26]) alfa[(s[j]-'a'+k)%26]--;
  22.             else{
  23.                 cout << "It is gonna be daijoubu." << endl;
  24.                 return 0;
  25.             }
  26.         }
  27.     }
  28.     cout << "Make her kokoro go doki-doki!" << endl;
  29.  
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top