#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define co cout<<
// stuff
void solve(){
ll a[10]={};
for(int i=1;i<=9;i++){
ll x;
cin>>x;
a[x]=i;
}
string s;
cin>>s;
ll last=-20;
for(auto i:s){
ll x=i-'a';
if(i>='s') x--;
if(i>='z') x--;
// co x<<' ';
if(x/3+2==last/3+2) co '#';
for(int i=0;i<x%3+1;i++) co a[x/3+2];
if(i=='z'||i=='s') co a[x/3+2];
last=x;
// co '\n';
}
}
int main(){
ios_base::sync_with_stdio(0);cin.tie(0);
int _=1;
// cin>>_;
while(_--) solve();
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |