Submission #937583

#TimeUsernameProblemLanguageResultExecution timeMemory
937583sleepntsheepMobitel (COCI14_mobitel)C11
50 / 50
1 ms604 KiB
#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)

mobitel.c: In function 'main':
mobitel.c:10:28: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |     for(int j,i=1;i<=9;++i)scanf("%d",&j),map[j]=i;
      |                            ^~~~~~~~~~~~~~
mobitel.c:11:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     scanf("%s",s+1);
      |     ^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...