Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define ll long long
- map<ll,char>mp;
- map<ll,char>::iterator it;
- map<ll,char>::iterator it2;
- void fun()
- {
- ll first=1,second=2,tmp=0;
- mp[first]=' ';
- mp[second]=' ';
- for(int i=3; i<=55; i++)
- {
- tmp=first+second;
- mp[tmp]=' ';
- first=second;
- second=tmp;
- }
- // for(it=mp.begin();it!=mp.end();it++){
- // cout<<it->first<<endl;
- // }
- }
- int main()
- {
- ll t,n,ar[1000];
- char ch[10000];
- fun();
- cin>>t;
- while(t--)
- {
- ll tm=0,mx=-9999999;
- cin>>n;
- for(int i=0; i<n; i++)
- {
- cin>>ar[i];
- if(ar[i]>mx){
- mx=ar[i];
- }
- }
- getchar();
- gets(ch);
- int j=0;
- for(int i=0;i<strlen(ch);i++){
- if(ch[i]>='A'&&ch[i]<='Z'){
- mp[ar[j++]]=ch[i];
- }
- }
- for(it2=mp.begin();it2!=mp.end();it2++){
- cout<<it2->second;
- if(it2->first==mx){
- break;
- }
- }
- cout<<endl;
- for(it2=mp.begin();it2!=mp.end();it2++){
- it2->second=' ';
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement