# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
34591 | 5ak0 | Mobitel (COCI14_mobitel) | C++14 | 0 ms | 2180 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.
/*
ID: 5ak0
PROG:
LANG: C++11
*/
#include <bits/stdc++.h>
#define fr first
#define sc second
#define pb push_back
#define mpr make_pair
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9 + 7;
int x;
map <int, int> mp;
map <char, string> s;
string str;
int main(){
#ifndef SAKO
//freopen(".in", "r", stdin);
//freopen(".out", "w", stdout);
#endif // SAKO
ios_base::sync_with_stdio(0);
for (int i = 1; i <= 9; ++i){
cin >> x;
mp[x] = i;
}
s['a'] = "2";
s['b'] = "22";
s['c'] = "222";
s['d'] = "3";
s['e'] = "33";
s['f'] = "333";
s['g'] = "4";
s['h'] = "44";
s['i'] = "444";
s['j'] = "5";
s['k'] = "55";
s['l'] = "555";
s['m'] = "6";
s['n'] = "66";
s['o'] = "666";
s['p'] = "7";
s['q'] = "77";
s['r'] = "777";
s['s'] = "7777";
s['t'] = "8";
s['u'] = "88";
s['v'] = "888";
s['w'] = "9";
s['x'] = "99";
s['y'] = "999";
s['z'] = "9999";
cin >> str;
for (int i = 0; i < str.size(); ++i){
if (i > 0)
if (s[str[i - 1]][0] == s[str[i]][0])
cout << "#";
for (int j = 0; j < s[str[i]].size(); ++j)
cout << mp[s[str[i]][0] - '0'];
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |