# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
483985 | ktkerem | Mobitel (COCI14_mobitel) | C++17 | 1 ms | 312 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;
using ll = long long;
ll _i=0;
#define ffn(x) _i=x
#define fora(y,x) for(ll y=_i;x>y;y++)
#define pb push_back
#define pf push_front
#define debu cout << "hello\n"
#define fi first
#define sec second
const ll limit =998244353;
const ll ous=1000005;
void solve(){
vector<vector<char>> kb = {{'a','b','c'} , {'d','e','f'} , {'g','h','i'} , {'j','k','l'} , {'m','n','o'} , {'p','q','r','s'} , {'t','u','v'} , {'w','x','y','z'}};
string h;
ll ar[10] , x;
fora(i , 9){
cin >> x;
ar[x-1] = i+1;
}
cin >> h;
ll n = h.length();
ll pre = -1;
fora(i , n){
ll no ,ss , kd=0 , o=0;
for(auto j:kb){
ss = 0;
for(auto k:j){
ss++;
if(k == h[i]){
no = o;
kd=1;
break;
}
}
o++;
if(kd==1){
break;
}
}
if(pre == no){
cout << "#";
}
fora(i,ss){
cout << ar[no+1];
}
pre=no;
}
return;
}
int main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);
ll t=1;
//cin >> t;
while(t--){
solve();
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |