Advertisement
Fahim_7861

given profile motif find the string value or probaility 4

Dec 19th, 2020
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. typedef unsigned long long ull;
  5. typedef pair<ll,ll>pll;
  6. typedef pair<ll,pair<ll,ll>>plll;
  7. #define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL));
  8. #define vll(v) v.begin(),v.end()
  9. #define all(x) x.rbegin(),x.rend()
  10. #define min3(a, b, c) min(a, min(b, c))
  11. #define max3(a, b, c) max(a, max(b, c))
  12. #define F first
  13. #define S second
  14. #define in freopen("input.txt", "r", stdin)
  15. #define out freopen("output.txt", "w", stdout)
  16. #define minheap int,vector<int>,greater<int>
  17. #define pb push_back
  18. #define eb emplace_back
  19. #define ischar(x) (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z'))
  20. #define isvowel(ch) ((ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')||(ch=='A'|| ch=='E' || ch=='I'|| ch=='O'|| ch=='U'))
  21. #define bug cout<<"BUG"<<endl;
  22. const int Max = 2e5 + 10;
  23. const int Mod = 1e9 + 7;
  24. const double PI =3.141592653589793238463;
  25. bool compare(const string &a, const string &b)
  26. {
  27. for(ll i=0; i<a.size(); i++)
  28. {
  29. if(a[i]!=b[i] && (a[i]=='$' || b[i]=='$'))
  30. {
  31.  
  32. if(a[i]=='$')return 1;
  33.  
  34. else if(b[i]=='$')return 0;
  35. }
  36.  
  37. else if(a[i]<b[i])return 1;
  38.  
  39. else if(a[i]>b[i])return 0;
  40. }
  41.  
  42. return 1;
  43. }
  44. ll lcm(ll a,ll b)
  45. {
  46. if(a==0 || b==0)return 0;
  47.  
  48. return a/__gcd(a,b)*b;
  49. }
  50.  
  51. void input(ll ara[],ll n)
  52. {
  53. for(ll i=0; i<n; i++)cin>>ara[i];
  54. }
  55. void print(ll ara[],ll n)
  56. {
  57. for(ll i=0; i<n; i++)
  58. cout<<ara[i]<<" ";
  59. cout<<endl;
  60. }
  61.  
  62.  
  63.  
  64. void printCycleRotation(vector<string>cyclicRotation)
  65. {
  66.  
  67. for(auto x : cyclicRotation)
  68. cout<<x<<endl;
  69. }
  70.  
  71.  
  72. double ara[5][100];
  73.  
  74. ll number(char ch)
  75. {
  76. if(ch=='A')return 1;
  77.  
  78. else if(ch=='C')return 2;
  79.  
  80. else if(ch=='T')return 3;
  81.  
  82. else return 4;
  83. }
  84.  
  85. int main()
  86. {
  87.  
  88. fastread();
  89.  
  90. ll i,j,n,m,p,sum=0,k,t,c,d,cnt=0,q,l,r;
  91.  
  92. bool flag=false;
  93.  
  94.  
  95. double a,b,temp;
  96.  
  97. cin>>n;
  98.  
  99.  
  100. for(i=1; i<=4; i++)
  101. {
  102. for(j=0; j<n; j++)
  103. {
  104. cin>>a>>b;
  105.  
  106. double temp=a/b;
  107.  
  108. ara[i][j]=temp;
  109. }
  110. }
  111.  
  112. for(i=1; i<=4; i++)
  113. {
  114. for(j=0; j<n; j++)
  115. cout<<ara[i][j]<<" ";
  116.  
  117. cout<<endl;
  118. }
  119.  
  120. cin>>t;
  121.  
  122.  
  123. double ans=1;
  124.  
  125. string str;
  126. while(t--)
  127. {
  128. cin>>str;
  129.  
  130. ans=1;
  131.  
  132.  
  133. for(i=0; i<str.size(); i++)
  134. {
  135. ans*=ara[number(str[i])][i];
  136. }
  137.  
  138. cout<<ans<<endl;
  139.  
  140. }
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151. }
  152.  
  153.  
  154. //GCAGGGTGCA
  155.  
  156. /*
  157.  
  158. 6
  159. 1 2
  160. 7 8
  161. 3 8
  162. 0 1
  163. 1 8
  164. 0 1
  165. 1 8
  166. 0 1
  167. 1 2
  168. 5 8
  169. 3 8
  170. 0 1
  171. 1 8
  172. 1 8
  173. 0 1
  174. 0 1
  175. 1 4
  176. 7 8
  177. 1 4
  178. 0 1
  179. 1 8
  180. 3 8
  181. 1 4
  182. 1 8
  183.  
  184. */
  185.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement