| 4 | int n,a[200005],b[10]; |
| 5 | |
| 6 | int main() |
| 7 | { |
| 8 | |
| 9 | cin>>n; |
| 10 | for(int i=1;i<=n;i++) scanf("%1d",&a[i]); |
| 11 | for(int i=1;i<=9;i++) scanf("%d",&b[i]); |
| 12 | for(int i=1;i<=n;i++) |
| 13 | { |
| 14 | if(a[i]<b[a[i]]) |
| 15 | { |
| 16 | for(int j=i;a[j]<=b[a[j]]&&j<=n;j++) a[j]=b[a[j]]; |
| 17 | break; |
| 18 | } |
| 19 | } |
| 20 | for(int i=1;i<=n;i++) cout<<a[i]; |
| 21 | |
| 22 | return 0; |
| 23 | } |
nothing calls this directly
no outgoing calls
no test coverage detected