# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
858335 | ily2003 | Mobitel (COCI14_mobitel) | C++14 | 1 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;
#define f first
#define s second
int x,dp[10];
string s;
map<char,pair<int,int>> check;
int main() {
check['a']={2,1};check['b']={2,2};check['c']={2,3};
check['d']={3,1};check['e']={3,2};check['f']={3,3};
check['g']={4,1};check['h']={4,2};check['i']={4,3};
check['j']={5,1};check['k']={5,2};check['l']={5,3};
check['m']={6,1};check['n']={6,2};check['o']={6,3};
check['p']={7,1};check['q']={7,2};check['r']={7,3};check['s']={7,4};
check['t']={8,1};check['u']={8,2};check['v']={8,3};
check['w']={9,1};check['x']={9,2};check['y']={9,3};check['z']={9,4};
for (int i=1;i<=9;++i) cin >> x,dp[x]=i;
cin >> s;
auto the=check[s[0]];
for (int i=1;i<=the.s;++i) cout << dp[the.f];
for (int i=1;i<s.size();++i) {
auto the1=check[s[i]];
if (the.f==the1.f) cout << "#";
for (int i=1;i<=the1.s;++i) cout << dp[the1.f];
the=the1;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |