# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
85890 | memetkagan44 | Mobitel (COCI14_mobitel) | C++11 | 3 ms | 640 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<bits/stdc++.h>
using namespace std;
int a,gst[15];
char ar[105];
map<char,pair<int,int> > val;
int main(){
for(int i=1;i<=9;i++){
scanf("%d",&a);
gst[a]=i;
}
scanf("%s",ar+1);
char c='a';
for(int i=2; c<='r' ;i++)
for(int j=1;j<=3;j++,c++)
val[c]=make_pair(gst[i],j);
val[c++]=make_pair(gst[7],4);
for(int i=8; c<='y';i++)
for(int j=1;j<=3;j++,c++)
val[c]=make_pair(gst[i],j);
val[c]=make_pair(gst[9],4);
for(int i=1,k=-1;i<=strlen(ar+1);i++){
if(k==val[ar[i]].first)
printf("#");
k=val[ar[i]].first;
for(int j=1;j<=val[ar[i]].second;j++)
printf("%d",k);
}
printf("\n");
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |