MCPcopy Create free account
hub / github.com/acm-clan/algorithm-stone / main

Function main

user/codeforces/1157B.Long Number.cpp:6–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4int n,a[200005],b[10];
5
6int 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected