Submission #383144

#TimeUsernameProblemLanguageResultExecution timeMemory
383144IwanttobreakfreeKartomat (COCI17_kartomat)C++17
72 / 80
1 ms364 KiB
#include <iostream> #include <vector> #include <string> using namespace std; int main(){ int n; string st; vector<bool> l(26); 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(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'; }
#Verdict Execution timeMemoryGrader output
Fetching results...