#include <bits/stdc++.h>
using namespace std;
int n;
vector<string> a;
int main()
{
ios_base::sync_with_stdio(false);
cin >> n;
for(int i = 1; i <= n; i ++){
string s;
cin >> s;
a.push_back(s);
}
string s;
cin >> s;
vector<int> cnt(26);
for(int i = 0; i < n; i ++){
if((int)s.size() < (int)a[i].size()){
if(a[i].substr(0, (int)s.size()) == s){
cnt[a[i][(int)s.size()] - 'A'] = 1;
}
}
}
char c = 'A';
for(int i = 1; i <= 4; i ++){
for(int j = 1; j <= 8; j ++){
if(i == 1 && j <= 3){
cout << '*';
}else if(i == 4 && j >= 6){
cout << '*';
}else{
if(cnt[c - 'A'] == 1) cout << c;
else cout << '*';
c ++;
}
}
cout << "\n";
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
1 ms |
384 KB |
Output is correct |
5 |
Correct |
1 ms |
384 KB |
Output is correct |
6 |
Correct |
0 ms |
384 KB |
Output is correct |
7 |
Correct |
1 ms |
384 KB |
Output is correct |
8 |
Correct |
1 ms |
384 KB |
Output is correct |
9 |
Correct |
1 ms |
384 KB |
Output is correct |
10 |
Correct |
2 ms |
384 KB |
Output is correct |