# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
578255 | Trisanu_Das | Mobitel (COCI14_mobitel) | C++17 | 1 ms | 300 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;
string l[]={"2","22","222","3","33","333","4","44","444","5","55","555","6","66","666","7","77","777","7777","8","88","888","9","99","999","9999"};
map <int,int> mp;
string s;
int main()
{
int a;
for (int i=0;i<9;i++)
{
cin>>a;
mp[a]=i+1;
}
cin>>s;
for (int i=0;i<s.length();i++)
{if (i&&l[s[i]-'a'][0]==l[s[i-1]-'a'][0])
cout <<"#";
for (int g=0;g<l[s[i]-'a'].length();g++)
cout <<mp[l[s[i]-'a'][g]-'0'];}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |