Advertisement
anjarul

Leonardo Da Vinci

Jan 24th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. map<ll,char>mp;
  5. map<ll,char>::iterator it;
  6. map<ll,char>::iterator it2;
  7.  
  8. void fun()
  9. {
  10.  
  11.  
  12. ll first=1,second=2,tmp=0;
  13. mp[first]=' ';
  14. mp[second]=' ';
  15. for(int i=3; i<=55; i++)
  16. {
  17. tmp=first+second;
  18. mp[tmp]=' ';
  19. first=second;
  20. second=tmp;
  21. }
  22. // for(it=mp.begin();it!=mp.end();it++){
  23. // cout<<it->first<<endl;
  24. // }
  25.  
  26. }
  27. int main()
  28. {
  29.  
  30. ll t,n,ar[1000];
  31. char ch[10000];
  32. fun();
  33.  
  34. cin>>t;
  35. while(t--)
  36. {
  37. ll tm=0,mx=-9999999;
  38. cin>>n;
  39. for(int i=0; i<n; i++)
  40. {
  41. cin>>ar[i];
  42. if(ar[i]>mx){
  43. mx=ar[i];
  44. }
  45. }
  46. getchar();
  47. gets(ch);
  48. int j=0;
  49. for(int i=0;i<strlen(ch);i++){
  50. if(ch[i]>='A'&&ch[i]<='Z'){
  51. mp[ar[j++]]=ch[i];
  52. }
  53. }
  54. for(it2=mp.begin();it2!=mp.end();it2++){
  55. cout<<it2->second;
  56. if(it2->first==mx){
  57. break;
  58. }
  59.  
  60. }
  61. cout<<endl;
  62. for(it2=mp.begin();it2!=mp.end();it2++){
  63. it2->second=' ';
  64. }
  65.  
  66. }
  67. return 0;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement