# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
578253 | Trisanu_Das | Mobitel (COCI14_mobitel) | C++17 | 2 ms | 468 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;
bool isSubstring(string s1, string s2)
{
if (s2.find(s1) != string::npos)
return true;
return false;
}
int main(){
string op[26] ={"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"};
int bev[9];
for(int i = 0; i < 9 ; i++) cin >> bev[9];
string s; cin >> s;
string ans;
int n = s.size();
for(int i = 0; i < n - 1; i++){
ans += op[(int)(s[i] - 'a')];
if(isSubstring(op[(int)(s[i] - 'a')], op[(int)(s[i] - 'a') + 1])) ans += '#';
}
cout << ans << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |