104372024-04-02 13:55:02111Túlcsorduláscpp17Time limit exceeded 40/1001.082s5012 KiB
#include <bits/stdc++.h>
using namespace std;

#define int long long

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int N;
	cin>>N;
	string A,B;
	cin>>A>>B;
	int Q;
	cin>>Q;
	while(Q--){
		int x,y,l;
		cin>>x>>y>>l;
		int ok=1;
		for(int z=0;z<l;z++){
			if(A[x+z]==B[y+z]){
				ok=A[x+z]=='0';
				break;
			}
		}
		cout<<ok<<' ';
	}
	cout<<'\n';
	return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1828 KiB
2Accepted3ms2016 KiB
subtask240/40
3Accepted3ms2248 KiB
4Accepted3ms2460 KiB
5Accepted4ms2552 KiB
6Accepted2ms2540 KiB
7Accepted3ms2668 KiB
8Accepted4ms3036 KiB
9Accepted4ms2908 KiB
subtask30/30
10Accepted3ms2956 KiB
11Accepted14ms3340 KiB
12Accepted587ms3716 KiB
13Accepted39ms4328 KiB
14Time limit exceeded1.044s3196 KiB
15Accepted97ms4492 KiB
16Accepted96ms4372 KiB
17Time limit exceeded1.082s3280 KiB
subtask40/30
18Accepted7ms3500 KiB
19Accepted17ms4412 KiB
20Accepted43ms3696 KiB
21Accepted59ms4208 KiB
22Time limit exceeded1.075s3468 KiB
23Time limit exceeded1.057s3628 KiB
24Accepted97ms5012 KiB
25Time limit exceeded1.034s3708 KiB
26Time limit exceeded1.07s3736 KiB
27Accepted97ms4988 KiB
28Time limit exceeded1.054s3856 KiB