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 <bits/stdc++.h>
#define dbgv(v) {for(auto x:v)cout<<x<<' ';cout<<'\n';}
#define entire(v) v.begin(),v.end()
typedef long long ll;
using namespace std;
void OJize(){
cin.tie(NULL); ios_base::sync_with_stdio(false);
#ifdef jh
freopen("input.txt", "r", stdin);
#endif
}
bool attack(string& d, string& s){
for(size_t i = 0; i<d.size(); i++) if(d[i] == 'o' && s[i] == 'x') return true;
return false;
}
int main(){OJize();
int ps; cin>>ps;
int d; cin>>d;
vector<string> duk(ps);
for(int i=0; i<d; i++) cin>>duk[i];
int c; cin>>c;
vector<string> sub(ps);
for(int i=0; i<c; i++) cin>>sub[i];
vector<bool> ans(c+1);
for(int i=0; i<d; i++){
int cnt = 0;
for(int j=0; j<c; j++) if(attack(duk[i], sub[j])) cnt++;
ans[cnt] = true;
}
for(int i=1; i<=c; i++) cout << (ans[i]? 'o':'x');
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |