Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <bits/stdc++.h>
- using namespace std;
- #define pb push_back
- #define forn(i, n) for (int i = 0; i < n; i++)
- #define ll long long
- #define endl "\n"
- const int N =1e5+1;
- void solve()
- {
- int n;
- cin>>n;
- char c[3][n];
- for(int i=0;i<3;i++)
- for(int j=0;j<n;j++)
- cin>>c[i][j];
- unordered_map<string,char> ma;
- ma[".*.****.*"]='A';
- ma["*********"]='E';
- ma["***.*.***"]='I';
- ma["****.****"]='O';
- ma["*.**.****"]='U';
- string ans;
- int inc=1;
- for(int i=0;i<n;i+=inc)
- {
- if(i+2>=n || c[0][i]=='#')
- {
- inc=1;
- ans+="#";
- }
- else
- {
- string temp;
- temp+=c[0][i];
- temp+=c[0][i+1];
- temp+=c[0][i+2];
- temp+=c[1][i];
- temp+=c[1][i+1];
- temp+=c[1][i+2];
- temp+=c[2][i];
- temp+=c[2][i+1];
- temp+=c[2][i+2];
- if(ma.count(temp)){
- ans+=ma[temp];
- inc=3;
- }
- else{
- ans+="#";
- inc=1;
- }
- }
- }
- cout<<ans<<endl;
- }
- int main()
- {
- ios_base::sync_with_stdio(false);
- cin.tie(NULL);
- cout.tie(NULL);
- solve();
- }
Advertisement
Add Comment
Please, Sign In to add comment