# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
13839 | kipa00 | Mobitel (COCI14_mobitel) | C++98 | 0 ms | 1580 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 <cstdio>
#include <string>
using std::string;
string res;
string tonum[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"};
void add(string str) {
if (res.length() == 0) {
res += str;
} else if (res[res.length() - 1] == str[0]) {
res += "#" + str;
} else {
res += str;
}
}
int main() {
int arr[9];
char str[105], *ptr = str;
int n;
for (n=0; n<9; ++n) {
int temp;
scanf("%d", &temp);
arr[temp - 1] = n + 1;
}
scanf("%s", str);
for (;*ptr;++ptr) {
add(tonum[*ptr - 'a']);
}
for (n=0;n<res.length();++n) {
if ('2' <= res[n] && res[n] <= '9') {
printf("%d", arr[res[n] - '1']);
} else printf("#");
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |