# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
87852 | jvalsortav | Marko (COCI15_marko) | C++14 | 87 ms | 3056 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 |
---|---|---|---|---|
Fetching results... |