A. 串串串

    Type: Default File IO: string 2000ms 512MiB

串串串

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

【题目描述】

你有两个长度分别为 n,mn,m 的 01 串 S,TS,T。

有 QQ 次询问。每次询问给出 l1,r1,l2,r2l_1,r_1,l_2,r_2,其中 r1−l1+1=r2−l2+1r_1-l_1+1=r_2-l_2+1。令 a=S[l1…r1]a=S[l_1\ldots r_1]、b=T[l2…r2]b=T[l_2\ldots r_2],求满足 ai≠bia_i\ne b_i 的位置个数对 22 取模的结果。

【输入格式】

第一行两个正整数 n,mn,m,分别表示 S,TS,T 的长度。

接下来两行输入两个 01 串,分别表示 S,TS,T。

接下来一行一个整数 QQ,表示询问个数。

接下来 QQ 行,每行四个整数 l1,r1,l2,r2l_1,r_1,l_2,r_2,表示一组询问。

【输出格式】

对于每组询问,输出一个数 00 或 11 表示答案。

【样例1输入】

7 3
1011100
010
4
4 5 2 3
4 4 2 2
5 6 2 3
5 6 1 2

【样例1输出】

1
0
0
0

【样例2】

见下发文件 string2.in 和 string2.ans。

原下发包中的 string1.in 和 string1.ans 也一并保留。

【数据范围】

  • 对于 30%30\% 的数据,n,m,Q≤5000n,m,Q\le5000;
  • 对于 70%70\% 的数据,n,m,Q≤5×104n,m,Q\le5\times10^4;
  • 对于 80%80\% 的数据,n,m,Q≤105n,m,Q\le10^5;
  • 对于 100%100\% 的数据,1≤n,m,Q≤2×1051\le n,m,Q\le2\times10^5,1≤l1≤r1≤n1\le l_1\le r_1\le n,1≤l2≤r2≤m1\le l_2\le r_2\le m。

【文件输入输出】

本题使用文件输入输出:从 string.in 读取输入,向 string.out 输出答案。

【附件下载】

20260930-赛后改题

Not Claimed
Status
Done
Problem
4
Open Since
2026-10-4 12:00
Deadline
2026-10-12 23:59
Extension
24 hour(s)