# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
60941 | 0xrgb | Mobitel (COCI14_mobitel) | C++11 | 2 ms | 756 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>
int D[10];
char msg[128];
constexpr int T[][2] = {
{2, 1}, {2, 2}, {2, 3},
{3, 1}, {3, 2}, {3, 3},
{4, 1}, {4, 2}, {4, 3},
{5, 1}, {5, 2}, {5, 3},
{6, 1}, {6, 2}, {6, 3},
{7, 1}, {7, 2}, {7, 3}, {7, 4},
{8, 1}, {8, 2}, {8, 3},
{9, 1}, {9, 2}, {9, 3}, {9, 4},
};
int main() {
for (int i = 1; i <= 9; ++i) {
int x;
scanf("%d", &x);
D[x] = i;
}
scanf("%s", msg);
for (int i = 0; msg[i]; ++i) {
const int ma = msg[i] - 'a';
if (i >= 1 && T[ma][0] == T[msg[i - 1] - 'a'][0]) putchar('#');
for (int i = 0, j = T[ma][1], k = D[T[ma][0]]; i < j; ++i) putchar('0' + k);
}
puts("");
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |