Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define MAX 100002
- #define pb push_back
- #define sz size()
- #define loop(i,n) for(ll i=0;i<n;i++)
- #define loop1(i,n) for(int i=1;i<=n;i++)
- #define loopa(i,a,n) for(int i=a;i<=n;i++)
- #define loopr(i,n) for(int i=n-1;i>=0;i--)
- #define sc(n) scanf("%d",&n)
- #define sc2(n,m) scanf("%d %d",&n,&m)
- #define sc3(a,b,c) scanf("%d %d %d",&a,&b,&c);
- #define ll long long
- #define all(v) (v.begin(),v.end())
- #define pii pair<int,int>
- #define inf 1e18
- #define mem(a,n) memset(a,n,sizeof a)
- #define ff first
- #define ss second
- #define mp make_pair
- int main()
- {
- string arr[MAX/10];
- int arr2[27][3]= {{3,5,2},{4,4,4},{3,1,3},{4,2,4},{5,4,5},{5,4,1},{3,1,3},{2,5,2},{3,1,3},{3,1,2},{2,2,2},{1,1,5},{2,3,2},{2,3,2},{3,2,3},{4,4,1},{3,2,3},{4,4,2},{4,3,4},{5,1,1},{2,2,3},{2,2,1},{2,3,2},{2,1,2},{2,1,1},{5,1,5},{0,0,0} };
- for(int i=0; i<7; i++)
- {
- cin >>arr[i];
- }
- int c1=0,c2=0,c3=0,c4=0,c5=0;
- for(int i=0; i<arr[0].sz; i++)
- {
- // cout <<"loop "<< i<<endl;
- if(arr[0][i]=='*')
- c1++;
- if(arr[3][i]=='*')
- c2++;
- if(arr[6][i]=='*')
- c3++;
- if(arr[4][i]=='*')
- c4++;
- if(arr[5][i]=='*')
- c5++;
- if((i+2)%6==0)
- {
- // cout <<"yes1 "<< i<<endl;
- char ch;
- for(int j=0; j<=27; j++)
- {
- if(arr2[j][0]==c1 and arr2[j][1]==c2 and arr2[j][2]==c3)
- {
- ch=(char) (j+65);
- }
- if(ch=='C' or ch=='G' or ch=='I')
- {
- if(c4==1 and c5==2)
- ch='C';
- else if(c4==3 and c5==2)
- ch='G';
- else
- ch='I';
- }
- if(ch=='M' or ch=='N')
- {
- if(c4==2)
- ch='M';
- else
- ch='N';
- }
- if(ch=='O' or ch=='Q')
- {
- if(c4==2)
- ch='O';
- else if(c4==3)
- ch='Q';
- }
- }
- cout <<ch;
- c1=0;
- c2=0;
- c3=0;
- c4=0;c5=0;
- }
- else
- continue;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement