Submission #383031

#TimeUsernameProblemLanguageResultExecution timeMemory
383031vulpesMobitel (COCI14_mobitel)C++17
50 / 50
2 ms364 KiB
#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 timeMemoryGrader output
Fetching results...