Submission #87852

# Submission time Handle Problem Language Result Execution time Memory
87852 2018-12-02T21:48:45 Z jvalsortav Marko (COCI15_marko) C++14
35 / 50
87 ms 3056 KB
#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 = s.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 time Memory Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 2 ms 484 KB Output is correct
3 Incorrect 3 ms 484 KB Output isn't correct
4 Correct 29 ms 1552 KB Output is correct
5 Incorrect 10 ms 1552 KB Output isn't correct
6 Correct 7 ms 1552 KB Output is correct
7 Incorrect 23 ms 1860 KB Output isn't correct
8 Correct 87 ms 2808 KB Output is correct
9 Correct 14 ms 2808 KB Output is correct
10 Correct 65 ms 3056 KB Output is correct