#include <iostream>
using namespace std;
const int MAX_Q = 200'005;
int n, q;
string str1, str2, str3, t;
int l[MAX_Q], r[MAX_Q];
char c[MAX_Q];
char cross(char a, char b) {
if(a == b) {
return a;
}
if('J' != a && 'J' != b) {
return 'J';
}
if('O' != a && 'O' != b) {
return 'O';
}
return 'I';
}
int main() {
cin >> n >> str1 >> str2 >> str3 >> q >> t;
cout << ((str1 == t) ? "Yes" : "No") << "\n";
for(int i = 0; i < q; ++i) {
cin >> l[i] >> r[i] >> c[i];
fill(t.begin() + l[i] - 1, t.begin() + r[i], c[i]);
cout << ((str1 == t) ? "Yes" : "No") << "\n";
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
292 ms |
2640 KB |
Output is correct |
2 |
Correct |
324 ms |
4128 KB |
Output is correct |
3 |
Correct |
342 ms |
3936 KB |
Output is correct |
4 |
Correct |
311 ms |
4048 KB |
Output is correct |
5 |
Correct |
316 ms |
4016 KB |
Output is correct |
6 |
Correct |
301 ms |
3864 KB |
Output is correct |
7 |
Correct |
334 ms |
4080 KB |
Output is correct |
8 |
Correct |
327 ms |
4164 KB |
Output is correct |
9 |
Correct |
357 ms |
4084 KB |
Output is correct |
10 |
Correct |
363 ms |
4152 KB |
Output is correct |
11 |
Correct |
322 ms |
4056 KB |
Output is correct |
12 |
Correct |
317 ms |
4052 KB |
Output is correct |
13 |
Correct |
319 ms |
4064 KB |
Output is correct |
14 |
Correct |
338 ms |
4148 KB |
Output is correct |
15 |
Correct |
352 ms |
4116 KB |
Output is correct |
16 |
Correct |
319 ms |
4120 KB |
Output is correct |
17 |
Correct |
372 ms |
4072 KB |
Output is correct |
18 |
Correct |
332 ms |
4076 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
292 ms |
2640 KB |
Output is correct |
2 |
Correct |
324 ms |
4128 KB |
Output is correct |
3 |
Correct |
342 ms |
3936 KB |
Output is correct |
4 |
Correct |
311 ms |
4048 KB |
Output is correct |
5 |
Correct |
316 ms |
4016 KB |
Output is correct |
6 |
Correct |
301 ms |
3864 KB |
Output is correct |
7 |
Correct |
334 ms |
4080 KB |
Output is correct |
8 |
Correct |
327 ms |
4164 KB |
Output is correct |
9 |
Correct |
357 ms |
4084 KB |
Output is correct |
10 |
Correct |
363 ms |
4152 KB |
Output is correct |
11 |
Correct |
322 ms |
4056 KB |
Output is correct |
12 |
Correct |
317 ms |
4052 KB |
Output is correct |
13 |
Correct |
319 ms |
4064 KB |
Output is correct |
14 |
Correct |
338 ms |
4148 KB |
Output is correct |
15 |
Correct |
352 ms |
4116 KB |
Output is correct |
16 |
Correct |
319 ms |
4120 KB |
Output is correct |
17 |
Correct |
372 ms |
4072 KB |
Output is correct |
18 |
Correct |
332 ms |
4076 KB |
Output is correct |
19 |
Correct |
544 ms |
7172 KB |
Output is correct |
20 |
Correct |
1224 ms |
7068 KB |
Output is correct |
21 |
Correct |
413 ms |
6828 KB |
Output is correct |
22 |
Correct |
378 ms |
6536 KB |
Output is correct |
23 |
Correct |
355 ms |
5040 KB |
Output is correct |
24 |
Correct |
347 ms |
5036 KB |
Output is correct |
25 |
Correct |
410 ms |
7180 KB |
Output is correct |
26 |
Correct |
391 ms |
7232 KB |
Output is correct |
27 |
Correct |
446 ms |
7128 KB |
Output is correct |
28 |
Correct |
423 ms |
7228 KB |
Output is correct |
29 |
Correct |
408 ms |
7016 KB |
Output is correct |
30 |
Correct |
402 ms |
4940 KB |
Output is correct |
31 |
Correct |
412 ms |
7300 KB |
Output is correct |
32 |
Correct |
391 ms |
6864 KB |
Output is correct |
33 |
Correct |
357 ms |
5000 KB |
Output is correct |
34 |
Correct |
431 ms |
7224 KB |
Output is correct |
35 |
Correct |
354 ms |
6396 KB |
Output is correct |
36 |
Correct |
362 ms |
5040 KB |
Output is correct |
37 |
Correct |
347 ms |
4932 KB |
Output is correct |
38 |
Correct |
1450 ms |
7216 KB |
Output is correct |
39 |
Correct |
941 ms |
7172 KB |
Output is correct |
40 |
Correct |
390 ms |
6576 KB |
Output is correct |
41 |
Correct |
1840 ms |
7452 KB |
Output is correct |
42 |
Correct |
2704 ms |
6580 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
292 ms |
2640 KB |
Output is correct |
2 |
Correct |
324 ms |
4128 KB |
Output is correct |
3 |
Correct |
342 ms |
3936 KB |
Output is correct |
4 |
Correct |
311 ms |
4048 KB |
Output is correct |
5 |
Correct |
316 ms |
4016 KB |
Output is correct |
6 |
Correct |
301 ms |
3864 KB |
Output is correct |
7 |
Correct |
334 ms |
4080 KB |
Output is correct |
8 |
Correct |
327 ms |
4164 KB |
Output is correct |
9 |
Correct |
357 ms |
4084 KB |
Output is correct |
10 |
Correct |
363 ms |
4152 KB |
Output is correct |
11 |
Correct |
322 ms |
4056 KB |
Output is correct |
12 |
Correct |
317 ms |
4052 KB |
Output is correct |
13 |
Correct |
319 ms |
4064 KB |
Output is correct |
14 |
Correct |
338 ms |
4148 KB |
Output is correct |
15 |
Correct |
352 ms |
4116 KB |
Output is correct |
16 |
Correct |
319 ms |
4120 KB |
Output is correct |
17 |
Correct |
372 ms |
4072 KB |
Output is correct |
18 |
Correct |
332 ms |
4076 KB |
Output is correct |
19 |
Correct |
331 ms |
3952 KB |
Output is correct |
20 |
Correct |
324 ms |
3968 KB |
Output is correct |
21 |
Incorrect |
329 ms |
4180 KB |
Output isn't correct |
22 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
292 ms |
2640 KB |
Output is correct |
2 |
Correct |
324 ms |
4128 KB |
Output is correct |
3 |
Correct |
342 ms |
3936 KB |
Output is correct |
4 |
Correct |
311 ms |
4048 KB |
Output is correct |
5 |
Correct |
316 ms |
4016 KB |
Output is correct |
6 |
Correct |
301 ms |
3864 KB |
Output is correct |
7 |
Correct |
334 ms |
4080 KB |
Output is correct |
8 |
Correct |
327 ms |
4164 KB |
Output is correct |
9 |
Correct |
357 ms |
4084 KB |
Output is correct |
10 |
Correct |
363 ms |
4152 KB |
Output is correct |
11 |
Correct |
322 ms |
4056 KB |
Output is correct |
12 |
Correct |
317 ms |
4052 KB |
Output is correct |
13 |
Correct |
319 ms |
4064 KB |
Output is correct |
14 |
Correct |
338 ms |
4148 KB |
Output is correct |
15 |
Correct |
352 ms |
4116 KB |
Output is correct |
16 |
Correct |
319 ms |
4120 KB |
Output is correct |
17 |
Correct |
372 ms |
4072 KB |
Output is correct |
18 |
Correct |
332 ms |
4076 KB |
Output is correct |
19 |
Correct |
544 ms |
7172 KB |
Output is correct |
20 |
Correct |
1224 ms |
7068 KB |
Output is correct |
21 |
Correct |
413 ms |
6828 KB |
Output is correct |
22 |
Correct |
378 ms |
6536 KB |
Output is correct |
23 |
Correct |
355 ms |
5040 KB |
Output is correct |
24 |
Correct |
347 ms |
5036 KB |
Output is correct |
25 |
Correct |
410 ms |
7180 KB |
Output is correct |
26 |
Correct |
391 ms |
7232 KB |
Output is correct |
27 |
Correct |
446 ms |
7128 KB |
Output is correct |
28 |
Correct |
423 ms |
7228 KB |
Output is correct |
29 |
Correct |
408 ms |
7016 KB |
Output is correct |
30 |
Correct |
402 ms |
4940 KB |
Output is correct |
31 |
Correct |
412 ms |
7300 KB |
Output is correct |
32 |
Correct |
391 ms |
6864 KB |
Output is correct |
33 |
Correct |
357 ms |
5000 KB |
Output is correct |
34 |
Correct |
431 ms |
7224 KB |
Output is correct |
35 |
Correct |
354 ms |
6396 KB |
Output is correct |
36 |
Correct |
362 ms |
5040 KB |
Output is correct |
37 |
Correct |
347 ms |
4932 KB |
Output is correct |
38 |
Correct |
1450 ms |
7216 KB |
Output is correct |
39 |
Correct |
941 ms |
7172 KB |
Output is correct |
40 |
Correct |
390 ms |
6576 KB |
Output is correct |
41 |
Correct |
1840 ms |
7452 KB |
Output is correct |
42 |
Correct |
2704 ms |
6580 KB |
Output is correct |
43 |
Correct |
331 ms |
3952 KB |
Output is correct |
44 |
Correct |
324 ms |
3968 KB |
Output is correct |
45 |
Incorrect |
329 ms |
4180 KB |
Output isn't correct |
46 |
Halted |
0 ms |
0 KB |
- |