Submission #17501

# Submission time Handle Problem Language Result Execution time Memory
17501 2015-12-22T02:55:45 Z kdh9949 Mobitel (COCI14_mobitel) C++
0 / 50
0 ms 1084 KB
#include <cstdio>

int key[10];
char str[101];
int whatkey[26] = {2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9};
int num[26] = {1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 1, 2, 3, 4};

int main(){
    int cur;
    for(int i = 1; i <= 9; i++){
        scanf("%d", &cur);
        key[cur] = i;
    }
    scanf("%s", str);
    int last = -1;
    for(int i = 0; str[i]; i++){
        cur = str[i] - 'a';
        if(last == whatkey[cur]) putchar('#');
        for(int i = 0; i < num[cur]; i++) printf("%d", whatkey[cur]);
        last = whatkey[cur];
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1084 KB Output isn't correct
2 Incorrect 0 ms 1084 KB Output isn't correct
3 Incorrect 0 ms 1084 KB Output isn't correct
4 Incorrect 0 ms 1084 KB Output isn't correct
5 Incorrect 0 ms 1084 KB Output isn't correct
6 Incorrect 0 ms 1084 KB Output isn't correct
7 Incorrect 0 ms 1084 KB Output isn't correct
8 Incorrect 0 ms 1084 KB Output isn't correct
9 Incorrect 0 ms 1084 KB Output isn't correct
10 Incorrect 0 ms 1084 KB Output isn't correct