Submission #92928

#TimeUsernameProblemLanguageResultExecution timeMemory
92928AntonioDakiMobitel (COCI14_mobitel)C++14
0 / 50
2 ms376 KiB
#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 (stderr)

mobitel.cpp: In function 'int main()':
mobitel.cpp:15:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i = 0; i < s.size(); ++i){
                    ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...