Submission #578253

#TimeUsernameProblemLanguageResultExecution timeMemory
578253Trisanu_DasMobitel (COCI14_mobitel)C++17
0 / 50
2 ms468 KiB
#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 timeMemoryGrader output
Fetching results...