#include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(NULL);
int n; cin >> n;
string gene;
cin >> gene >> gene >> gene;
int q; cin >> q;
string t; cin >> t;
if(t == gene)
cout << "Yes\n";
else
cout << "No\n";
while(q--){
int l, r;
char c;
cin >> l >> r >> c;
string s = gene;
for(int i = 1; i <= n; i++){
if(l <= i && i <= r){
s[i - 1] = c;
}
else{
s[i - 1] = t[i - 1];
}
}
if(s == gene)
cout << "Yes\n";
else
cout << "No\n";
t = s;
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
89 ms |
2172 KB |
Output is correct |
2 |
Correct |
96 ms |
2412 KB |
Output is correct |
3 |
Correct |
95 ms |
2380 KB |
Output is correct |
4 |
Correct |
93 ms |
2360 KB |
Output is correct |
5 |
Correct |
106 ms |
2400 KB |
Output is correct |
6 |
Correct |
100 ms |
2292 KB |
Output is correct |
7 |
Correct |
93 ms |
2400 KB |
Output is correct |
8 |
Correct |
98 ms |
2440 KB |
Output is correct |
9 |
Correct |
99 ms |
2484 KB |
Output is correct |
10 |
Correct |
113 ms |
2396 KB |
Output is correct |
11 |
Correct |
105 ms |
2348 KB |
Output is correct |
12 |
Correct |
101 ms |
2312 KB |
Output is correct |
13 |
Correct |
107 ms |
2380 KB |
Output is correct |
14 |
Correct |
105 ms |
2476 KB |
Output is correct |
15 |
Correct |
99 ms |
2380 KB |
Output is correct |
16 |
Correct |
117 ms |
2372 KB |
Output is correct |
17 |
Correct |
113 ms |
2376 KB |
Output is correct |
18 |
Correct |
105 ms |
2292 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
89 ms |
2172 KB |
Output is correct |
2 |
Correct |
96 ms |
2412 KB |
Output is correct |
3 |
Correct |
95 ms |
2380 KB |
Output is correct |
4 |
Correct |
93 ms |
2360 KB |
Output is correct |
5 |
Correct |
106 ms |
2400 KB |
Output is correct |
6 |
Correct |
100 ms |
2292 KB |
Output is correct |
7 |
Correct |
93 ms |
2400 KB |
Output is correct |
8 |
Correct |
98 ms |
2440 KB |
Output is correct |
9 |
Correct |
99 ms |
2484 KB |
Output is correct |
10 |
Correct |
113 ms |
2396 KB |
Output is correct |
11 |
Correct |
105 ms |
2348 KB |
Output is correct |
12 |
Correct |
101 ms |
2312 KB |
Output is correct |
13 |
Correct |
107 ms |
2380 KB |
Output is correct |
14 |
Correct |
105 ms |
2476 KB |
Output is correct |
15 |
Correct |
99 ms |
2380 KB |
Output is correct |
16 |
Correct |
117 ms |
2372 KB |
Output is correct |
17 |
Correct |
113 ms |
2376 KB |
Output is correct |
18 |
Correct |
105 ms |
2292 KB |
Output is correct |
19 |
Execution timed out |
7014 ms |
2176 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
89 ms |
2172 KB |
Output is correct |
2 |
Correct |
96 ms |
2412 KB |
Output is correct |
3 |
Correct |
95 ms |
2380 KB |
Output is correct |
4 |
Correct |
93 ms |
2360 KB |
Output is correct |
5 |
Correct |
106 ms |
2400 KB |
Output is correct |
6 |
Correct |
100 ms |
2292 KB |
Output is correct |
7 |
Correct |
93 ms |
2400 KB |
Output is correct |
8 |
Correct |
98 ms |
2440 KB |
Output is correct |
9 |
Correct |
99 ms |
2484 KB |
Output is correct |
10 |
Correct |
113 ms |
2396 KB |
Output is correct |
11 |
Correct |
105 ms |
2348 KB |
Output is correct |
12 |
Correct |
101 ms |
2312 KB |
Output is correct |
13 |
Correct |
107 ms |
2380 KB |
Output is correct |
14 |
Correct |
105 ms |
2476 KB |
Output is correct |
15 |
Correct |
99 ms |
2380 KB |
Output is correct |
16 |
Correct |
117 ms |
2372 KB |
Output is correct |
17 |
Correct |
113 ms |
2376 KB |
Output is correct |
18 |
Correct |
105 ms |
2292 KB |
Output is correct |
19 |
Correct |
99 ms |
2304 KB |
Output is correct |
20 |
Correct |
106 ms |
2264 KB |
Output is correct |
21 |
Incorrect |
106 ms |
2356 KB |
Output isn't correct |
22 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
89 ms |
2172 KB |
Output is correct |
2 |
Correct |
96 ms |
2412 KB |
Output is correct |
3 |
Correct |
95 ms |
2380 KB |
Output is correct |
4 |
Correct |
93 ms |
2360 KB |
Output is correct |
5 |
Correct |
106 ms |
2400 KB |
Output is correct |
6 |
Correct |
100 ms |
2292 KB |
Output is correct |
7 |
Correct |
93 ms |
2400 KB |
Output is correct |
8 |
Correct |
98 ms |
2440 KB |
Output is correct |
9 |
Correct |
99 ms |
2484 KB |
Output is correct |
10 |
Correct |
113 ms |
2396 KB |
Output is correct |
11 |
Correct |
105 ms |
2348 KB |
Output is correct |
12 |
Correct |
101 ms |
2312 KB |
Output is correct |
13 |
Correct |
107 ms |
2380 KB |
Output is correct |
14 |
Correct |
105 ms |
2476 KB |
Output is correct |
15 |
Correct |
99 ms |
2380 KB |
Output is correct |
16 |
Correct |
117 ms |
2372 KB |
Output is correct |
17 |
Correct |
113 ms |
2376 KB |
Output is correct |
18 |
Correct |
105 ms |
2292 KB |
Output is correct |
19 |
Execution timed out |
7014 ms |
2176 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |