# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
292456 | 7_7_7 | Marko (COCI15_marko) | C++17 | 481 ms | 65540 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int n;
int main()
{
ios_base::sync_with_stdio(false);
cin >> n;
vector<string> a(n);
for(auto &x: a) cin >> x;
vector<char> c[10];
c[2] = {'a', 'b', 'c'};
c[3] = {'d', 'e', 'f'};
c[4] = {'g', 'h', 'i'};
c[5] = {'j', 'k', 'l'};
c[6] = {'m', 'n', 'o'};
c[7] = {'p', 'q', 'r', 's'};
c[8] = {'t', 'u', 'v'};
c[9] = {'w', 'x', 'y', 'z'};
string s;
cin >> s;
set<string> res;
for(int i = 0; i < (int)s.size(); i ++){
int x = (s[i] - '0');
if(i == 0){
for(auto y: c[x]){
string temp = "";
temp += y;
res.insert(temp);
}
continue;
}
set<string> t;
for(auto str: res){
for(auto y: c[x]){
string temp = str;
temp += y;
t.insert(temp);
}
}
res = t;
}
int cnt = 0;
for(auto x: a) cnt += res.count(x);
cout << cnt << "\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |