# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
758112 | 2023-06-14T07:39:22 Z | KN200711 | Mobitel (COCI14_mobitel) | C++14 | 1 ms | 212 KB |
# include <bits/stdc++.h> # define ll long long using namespace std; int pos[10]; int val(char a) { int x = a - 'a'; x /= 3; x += 2; return x; } int ch(char a) { int x = a - 'a'; // cout<<x<<endl; x %= 3; x++; return x; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); for(int i=1;i<=9;i++) { int a; cin>>a; pos[a] = i; } string S; cin>>S; for(int i=0;i<S.length();i++) { if(i > 0 && val(S[i - 1]) == val(S[i])) { cout<<"#"; } for(int d=0;d<ch(S[i]);d++) cout<<pos[val(S[i])]; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |