# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
92927 | AntonioDaki | Mobitel (COCI14_mobitel) | C++14 | 2 ms | 504 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 br (s[i]-94)%3
#define t (s[i]-91)/3
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int k[12], p = 0;
string s;
k[0] = 0;
for(int i = 1; i <= 9; ++i) cin >> k[i];
cin >> s;
for(int i = 0; i < s.size(); ++i){
if(s[i] < 112){
for(int j = 1; j <= 9; ++j)
if(k[j] == t){
if(j == p) cout << "#";
p = j;
if(br == 0) cout << j;
else if(br == 1) cout << j << j;
else cout << j << j << j;
}
}
else if(s[i] < 116){
for(int j = 1; j <= 9; ++j)
if(k[j] == 7){
if(j == p) cout << "#";
p = j;
if(s[i] == 112) cout << j;
else if(s[i] == 113) cout << j << j;
else if(s[i] == 114) cout << j << j << j;
else cout << j << j << j << j;
}
}
else if(s[i] < 119){
for(int j = 1; j <= 9; ++j)
if(k[j] == 8){
if(j == p) cout << "#";
p = j;
if(s[i] == 116) cout << j;
else if(s[i] == 117) cout << j << j;
else cout << j << j << j;
}
}
else{
for(int j = 1; j <= 9; ++j)
if(k[j] == 7){
if(j == p) cout << "#";
p = j;
if(s[i] == 119) cout << j;
else if(s[i] == 120) cout << j << j;
else if(s[i] == 121) cout << j << j << j;
else cout << j << j << j << j;
}
}
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |