# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
937583 | sleepntsheep | Mobitel (COCI14_mobitel) | C11 | 1 ms | 604 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
int map[10];
char a[]="$$adgjmptw$$$\0",s[104];
int key(char c){
for(int j=9;;--j)if(a[j]<=c)return j;
}
int main(){
for(int j,i=1;i<=9;++i)scanf("%d",&j),map[j]=i;
scanf("%s",s+1);
for(int ls=-1,i=1;s[i];++i){
int k=key(s[i]);
if(ls==k)putchar('#');
for(int j=s[i]-a[k]+1;j--;)putchar('0'+map[k]);
ls=k;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |