# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
383148 | Iwanttobreakfree | Kartomat (COCI17_kartomat) | C++98 | 1 ms | 364 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main(){
int n;
string st;
vector<bool> l(26,false);
cin>>n;
vector<string> str(n);
for(int i=0;i<n;i++)cin>>str[i];
cin>>st;
int k=st.length();
for(int i=0;i<n;i++){
bool pos=true;
for(int j=0;j<k;j++){
if(str[i][j]!=st[j]){
pos=false;
break;
}
if(str[i].length()>k&&pos)l[str[i][k]-'A']=true;
}
}
cout<<"***";
for(int i=0;i<5;i++){
char c=i+'A';
if(l[i])cout<<c;
else cout<<'*';
}
cout<<'\n';
for(int i=5;i<13;i++){
char c=i+'A';
if(l[i])cout<<c;
else cout<<'*';
}
cout<<'\n';
for(int i=13;i<21;i++){
char c=i+'A';
if(l[i])cout<<c;
else cout<<'*';
}
cout<<'\n';
for(int i=21;i<26;i++){
char c=i+'A';
if(l[i])cout<<c;
else cout<<'*';
}
cout<<"***";
cout<<'\n';
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |