//-------------dilanyan------------\\
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<stack>
#include<stdio.h>
using namespace std;
//------------------KarginDefines--------------------\\
#define ll long long
#define pb push_back
#define all(u) (u).begin(), (u).end()
#define pqueue priority_queue
#define upper upper_bound
#define lower lower_bound
#define sz(s) s.size()
#define mkp make_pair
#define Kargin ios_base::sync_with_stdio(false);cin.tie(NULL);
#define Usaco freopen(".in", "r", stdin); freopen(".out", "w", stdout);
//-------------------KarginConstants------------------\\
const int mod = 1000000007;
const int infmax = INT32_MAX, infmin = INT32_MIN;
const ll Infmax = INT64_MAX, Infmin = INT64_MIN;
//-------------------KarginCode------------------------\\
const int N = 300005;
char ch[3] = { 'J','O','I' };
void KarginSolve() {
int n;
cin >> n;
string s1, s2, s3;
cin >> s1 >> s2 >> s3;
string s = s1;
int q;cin >> q;
string t;
cin >> t;
string nt;
for (int i = 0;i < n;i++) {
if (s[i] == t[i]) {
nt[i] = s[i];
}
else {
for (char c : ch) {
if (s[i] != c) {
nt[i] = c;
break;
}
}
}
}
while (q--) {
string k;
cin >> k;
if (k == s) {
cout << "Yes\n";
}
else {
cout << "No\n";
}
}
}
int main() {
//Usaco
Kargin;
int test = 1;
//cin >> test;
while (test--) {
KarginSolve();
cout << endl;
}
return 0;
}
Compilation message
Main.cpp:1:1: warning: multi-line comment [-Wcomment]
1 | //-------------dilanyan------------\\
| ^
Main.cpp:9:1: warning: multi-line comment [-Wcomment]
9 | //------------------KarginDefines--------------------\\
| ^
Main.cpp:22:1: warning: multi-line comment [-Wcomment]
22 | //-------------------KarginConstants------------------\\
| ^
Main.cpp:28:1: warning: multi-line comment [-Wcomment]
28 | //-------------------KarginCode------------------------\\
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
15 ms |
980 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
15 ms |
980 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
15 ms |
980 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
15 ms |
980 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |