Submission #578253

# Submission time Handle Problem Language Result Execution time Memory
578253 2022-06-16T09:24:33 Z Trisanu_Das Mobitel (COCI14_mobitel) C++17
0 / 50
2 ms 468 KB
#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
1 Runtime error 2 ms 468 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -