# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
92928 | 2019-01-06T00:44:57 Z | AntonioDaki | Mobitel (COCI14_mobitel) | C++14 | 2 ms | 376 KB |
#include<bits/stdc++.h> using namespace std; 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] == (s[i]-91)/3){ if(j == p) cout << "#"; p = j; if((s[i]-94)%3 == 0) cout << j; else if((s[i]-94)%3 == 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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |