# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
998709 | AliHasanli | Mobitel (COCI14_mobitel) | C++17 | 0 ms | 348 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<bits/stdc++.h>
using namespace std;
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++)
cin>>cur,key[cur] = i;
cin>>str;
int last = -1;
for(int i = 0; str[i]; i++){
cur = str[i] - 'a';
if(last == whatkey[cur]) cout<<'#';
for(int i = 0; i < num[cur]; i++) cout<<key[whatkey[cur]];
last = whatkey[cur];
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |