# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
383031 | vulpes | Mobitel (COCI14_mobitel) | C++17 | 2 ms | 364 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 main() {
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
vector<int> a(10);
for (int i = 1; i < 10; i++) {
int x; cin >> x; a[x] = i;
}
string s; cin >> s;
int p = 0, n = s.size();
vector<char> c = {'a', 'd', 'g', 'j', 'm', 'p', 't', 'w'};
for (int i = 0; i < n; i++) {
for (int j = 7; j >= 0; j--) {
if (s[i] >= c[j]) {
if (p == j + 2) {
cout << "#";
}
for (int k = 0; k <= s[i] - c[j]; k++) {
cout << a[j + 2];
}
p = j + 2;
break;
}
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |