Advertisement
Guest User

D

a guest
Sep 20th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.46 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define MAX 100002
  4. #define pb push_back
  5. #define sz size()
  6. #define loop(i,n) for(ll i=0;i<n;i++)
  7. #define loop1(i,n) for(int i=1;i<=n;i++)
  8. #define loopa(i,a,n) for(int i=a;i<=n;i++)
  9. #define loopr(i,n) for(int i=n-1;i>=0;i--)
  10. #define sc(n) scanf("%d",&n)
  11. #define sc2(n,m) scanf("%d %d",&n,&m)
  12. #define sc3(a,b,c) scanf("%d %d %d",&a,&b,&c);
  13. #define ll long long
  14. #define all(v) (v.begin(),v.end())
  15. #define pii pair<int,int>
  16. #define inf 1e18
  17. #define mem(a,n) memset(a,n,sizeof a)
  18. #define ff first
  19. #define ss second
  20. #define mp make_pair
  21.  
  22.  
  23. int main()
  24. {
  25.  
  26.     string arr[MAX/10];
  27.     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}  };
  28.     for(int i=0; i<7; i++)
  29.     {
  30.         cin >>arr[i];
  31.     }
  32.  
  33.     int c1=0,c2=0,c3=0,c4=0,c5=0;
  34.     for(int i=0; i<arr[0].sz; i++)
  35.     {
  36. //        cout <<"loop "<< i<<endl;
  37.         if(arr[0][i]=='*')
  38.             c1++;
  39.         if(arr[3][i]=='*')
  40.             c2++;
  41.         if(arr[6][i]=='*')
  42.             c3++;
  43.         if(arr[4][i]=='*')
  44.             c4++;
  45.         if(arr[5][i]=='*')
  46.             c5++;
  47.  
  48.         if((i+2)%6==0)
  49.         {
  50. //            cout <<"yes1 "<< i<<endl;
  51.             char ch;
  52.             for(int j=0; j<=27; j++)
  53.             {
  54.  
  55.                 if(arr2[j][0]==c1 and arr2[j][1]==c2 and arr2[j][2]==c3)
  56.                 {
  57.                     ch=(char) (j+65);
  58.                 }
  59.                 if(ch=='C' or ch=='G' or ch=='I')
  60.                 {
  61.                     if(c4==1 and c5==2)
  62.                         ch='C';
  63.                     else if(c4==3 and c5==2)
  64.                         ch='G';
  65.                     else
  66.                         ch='I';
  67.                 }
  68.                 if(ch=='M' or ch=='N')
  69.                 {
  70.                     if(c4==2)
  71.                         ch='M';
  72.                     else
  73.                         ch='N';
  74.                 }
  75.                 if(ch=='O' or ch=='Q')
  76.                 {
  77.                     if(c4==2)
  78.                         ch='O';
  79.                     else if(c4==3)
  80.                         ch='Q';
  81.                 }
  82.  
  83.  
  84.             }
  85.             cout <<ch;
  86.             c1=0;
  87.             c2=0;
  88.             c3=0;
  89.             c4=0;c5=0;
  90.         }
  91.         else
  92.             continue;
  93.  
  94.  
  95.     }
  96.  
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement