# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
147400 | mariadinca | Mobitel (COCI14_mobitel) | C++14 | 2 ms | 376 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 <iostream>
using namespace std;
int n, c[200], i, j, x, comp[11];
char s[120], ant, car;
int sol[200];
int main(){
c['a'] = c['b'] = c['c'] = 2;
sol['a'] = 1, sol['b'] = 2, sol['c'] = 3;
c['d'] = c['e'] = c['f'] = 3;
sol['d'] = 1, sol['e'] = 2, sol['f'] = 3;
c['g'] = c['h'] = c['i'] = 4;
sol['g'] = 1, sol['h'] = 2, sol['i'] = 3;
c['j'] = c['k'] = c['l'] = 5;
sol['j'] = 1, sol['k'] = 2, sol['l'] = 3;
c['m'] = c['n'] = c['o'] = 6;
sol['m'] = 1, sol['n'] = 2, sol['o'] = 3;
c['p'] = c['q'] = c['r'] = c['s'] = 7;
sol['p'] = 1, sol['q'] = 2, sol['r'] = 3, sol['s'] = 4;
c['t'] = c['u'] = c['v'] = 8;
sol['t'] = 1, sol['u'] = 2, sol['v'] = 3;
c['w'] = c['x'] = c['y'] = c['z'] = 9;
sol['w'] = 1, sol['x'] = 2, sol['y'] = 3, sol['z'] = 4;
for(i=1;i<=9;i++){
cin>>x;
comp[x] = i;
}
cin>>s;
car = s[0];
for(j=1;j<=sol[car];j++)
cout<<comp[c[car]];
ant = car;
for(i=1;s[i]!=0;i++){
car = s[i];
if(c[car] == c[ant])
cout<<"#";
for(j=1;j<=sol[car];j++)
cout<<comp[c[car]];
ant = car;
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |