Submission #87980

#TimeUsernameProblemLanguageResultExecution timeMemory
87980jvalsortavMarko (COCI15_marko)C++14
50 / 50
85 ms2788 KiB
#include <cstdio> #include <cstdlib> #include <cmath> #include <iostream> #include <cctype> #include <ctime> #include <set> #include <algorithm> #include <vector> #include <queue> #include <stack> #include <utility> #include <string> #include <map> #include <string.h> using namespace std; int n, l, b; vector <string> v; string s, t, m; bool inf; int main() { cin >> n; for (int i = 0; i < n; i++){ cin >> s; v.push_back(s); } cin >> t; l = t.size(); for (vector <string> :: iterator it = v.begin(); it != v.end(); it++){ inf = true; s = *it; /*cout << "hmmmmmmmmmm " << *it << endl;*/ for (int j = 0; j < l; j++){ if (s.substr(j, 1) >= "a" and s.substr(j, 1) <= "c"){ m = "2"; } if (s.substr(j, 1) >= "d" and s.substr(j, 1) <= "f"){ m = "3"; } if (s.substr(j, 1) >= "g" and s.substr(j, 1) <= "i"){ m = "4"; } if (s.substr(j, 1) >= "j" and s.substr(j, 1) <= "l"){ m = "5"; } if (s.substr(j, 1) >= "m" and s.substr(j, 1) <= "o"){ m = "6"; } if (s.substr(j, 1) >= "p" and s.substr(j, 1) <= "s"){ m = "7"; } if (s.substr(j, 1) >= "t" and s.substr(j, 1) <= "v"){ m = "8"; } if (s.substr(j, 1) >= "w" and s.substr(j, 1) <= "z"){ m = "9"; } /*cout << s.substr(j, 1) << " "<< m << endl;*/ if (m != t.substr(j, 1)){ inf = false; break; } } if (inf) b++; } cout << b; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...