#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
#define endl '\n'
#define ll long long
#define pb push_back
#define vi vector<int>
#define vll vector<long long>
#define sz(x) (int)x.size()
#define int long long
#define all(x) x.begin(),x.end()
#define pii pair<int,int>
#define piii pair<int,pii>
#define rep(i,a,b) for (ll i = a; i<b; i++)
#define repo(i,a,b) for (int i = a; i>=b; i--)
#define fi first
#define se second
int dy[8] = {0, 0, 1, -1, 1, -1 , 1, -1};
int dx[8] = {1, -1, 0, 0, 1, -1, -1, 1};
//int dp[100001][100001];
//int arr[100001];
const int MAXN = 2e5 + 10;
const int MOD = 1e9+7;
const int INF = 1e18;
const int LOG = 20;
const int MX = 2e5 + 5;
vector<string> genes;
void solve() {
//input
int n;
cin>>n;
for(int i =0;i<3;i++){
string s;
cin>>s;
genes.pb(s);
}
int q;
cin>>q;
string base;
cin>>base;
if(find(all(genes),base)!=genes.end()){
cout<<"Yes"<<endl;
}else{
cout<<"No"<<endl;
}
for(int i=0;i<q;i++){
int l,r;
char c;
cin>>l>>r>>c;
l--, r--;
for(int j =l;j<=r;j++){
base[j] = c;
}
if(find(all(genes),base)!=genes.end()){
cout<<"Yes"<<endl;
}else{
cout<<"No"<<endl;
}
}
}
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int k =1;
while(k--){
solve();
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
44 ms |
800 KB |
Output is correct |
2 |
Correct |
49 ms |
844 KB |
Output is correct |
3 |
Correct |
80 ms |
888 KB |
Output is correct |
4 |
Correct |
45 ms |
812 KB |
Output is correct |
5 |
Correct |
46 ms |
2292 KB |
Output is correct |
6 |
Correct |
46 ms |
2364 KB |
Output is correct |
7 |
Correct |
45 ms |
2380 KB |
Output is correct |
8 |
Correct |
52 ms |
2440 KB |
Output is correct |
9 |
Correct |
47 ms |
2332 KB |
Output is correct |
10 |
Correct |
49 ms |
2404 KB |
Output is correct |
11 |
Correct |
51 ms |
2376 KB |
Output is correct |
12 |
Correct |
48 ms |
2368 KB |
Output is correct |
13 |
Correct |
49 ms |
2388 KB |
Output is correct |
14 |
Correct |
49 ms |
2428 KB |
Output is correct |
15 |
Correct |
51 ms |
2424 KB |
Output is correct |
16 |
Correct |
49 ms |
2404 KB |
Output is correct |
17 |
Correct |
49 ms |
2420 KB |
Output is correct |
18 |
Correct |
83 ms |
2364 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
44 ms |
800 KB |
Output is correct |
2 |
Correct |
49 ms |
844 KB |
Output is correct |
3 |
Correct |
80 ms |
888 KB |
Output is correct |
4 |
Correct |
45 ms |
812 KB |
Output is correct |
5 |
Correct |
46 ms |
2292 KB |
Output is correct |
6 |
Correct |
46 ms |
2364 KB |
Output is correct |
7 |
Correct |
45 ms |
2380 KB |
Output is correct |
8 |
Correct |
52 ms |
2440 KB |
Output is correct |
9 |
Correct |
47 ms |
2332 KB |
Output is correct |
10 |
Correct |
49 ms |
2404 KB |
Output is correct |
11 |
Correct |
51 ms |
2376 KB |
Output is correct |
12 |
Correct |
48 ms |
2368 KB |
Output is correct |
13 |
Correct |
49 ms |
2388 KB |
Output is correct |
14 |
Correct |
49 ms |
2428 KB |
Output is correct |
15 |
Correct |
51 ms |
2424 KB |
Output is correct |
16 |
Correct |
49 ms |
2404 KB |
Output is correct |
17 |
Correct |
49 ms |
2420 KB |
Output is correct |
18 |
Correct |
83 ms |
2364 KB |
Output is correct |
19 |
Execution timed out |
7015 ms |
4796 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
44 ms |
800 KB |
Output is correct |
2 |
Correct |
49 ms |
844 KB |
Output is correct |
3 |
Correct |
80 ms |
888 KB |
Output is correct |
4 |
Correct |
45 ms |
812 KB |
Output is correct |
5 |
Correct |
46 ms |
2292 KB |
Output is correct |
6 |
Correct |
46 ms |
2364 KB |
Output is correct |
7 |
Correct |
45 ms |
2380 KB |
Output is correct |
8 |
Correct |
52 ms |
2440 KB |
Output is correct |
9 |
Correct |
47 ms |
2332 KB |
Output is correct |
10 |
Correct |
49 ms |
2404 KB |
Output is correct |
11 |
Correct |
51 ms |
2376 KB |
Output is correct |
12 |
Correct |
48 ms |
2368 KB |
Output is correct |
13 |
Correct |
49 ms |
2388 KB |
Output is correct |
14 |
Correct |
49 ms |
2428 KB |
Output is correct |
15 |
Correct |
51 ms |
2424 KB |
Output is correct |
16 |
Correct |
49 ms |
2404 KB |
Output is correct |
17 |
Correct |
49 ms |
2420 KB |
Output is correct |
18 |
Correct |
83 ms |
2364 KB |
Output is correct |
19 |
Correct |
45 ms |
2252 KB |
Output is correct |
20 |
Correct |
80 ms |
2300 KB |
Output is correct |
21 |
Incorrect |
48 ms |
2348 KB |
Output isn't correct |
22 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
44 ms |
800 KB |
Output is correct |
2 |
Correct |
49 ms |
844 KB |
Output is correct |
3 |
Correct |
80 ms |
888 KB |
Output is correct |
4 |
Correct |
45 ms |
812 KB |
Output is correct |
5 |
Correct |
46 ms |
2292 KB |
Output is correct |
6 |
Correct |
46 ms |
2364 KB |
Output is correct |
7 |
Correct |
45 ms |
2380 KB |
Output is correct |
8 |
Correct |
52 ms |
2440 KB |
Output is correct |
9 |
Correct |
47 ms |
2332 KB |
Output is correct |
10 |
Correct |
49 ms |
2404 KB |
Output is correct |
11 |
Correct |
51 ms |
2376 KB |
Output is correct |
12 |
Correct |
48 ms |
2368 KB |
Output is correct |
13 |
Correct |
49 ms |
2388 KB |
Output is correct |
14 |
Correct |
49 ms |
2428 KB |
Output is correct |
15 |
Correct |
51 ms |
2424 KB |
Output is correct |
16 |
Correct |
49 ms |
2404 KB |
Output is correct |
17 |
Correct |
49 ms |
2420 KB |
Output is correct |
18 |
Correct |
83 ms |
2364 KB |
Output is correct |
19 |
Execution timed out |
7015 ms |
4796 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |