Submission #1516884
Source Code Expand
#include <bits/stdc++.h>
#define fio ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
using namespace std;
const int N = 1e5+5;
int q;
char S[N],T[N];
int s[N]={},t[N]={};
int main() {
scanf("%s%s%d",S,T,&q);
int ls = strlen(S), lt = strlen(T);
for(int i = 1; i <= ls; ++i) s[i] = s[i-1] + ((S[i-1]=='A')?1:2);
for(int i = 1; i <= lt; ++i) t[i] = t[i-1] + ((T[i-1]=='A')?1:2);
while(q--) {
int a,b,c,d;
scanf("%d%d%d%d",&a,&b,&c,&d);
if((s[b]-s[a-1]-t[d]+t[c-1]) % 3) printf("NO\n");
else printf("YES\n");
}
}
Submission Info
Submission Time
2017-08-17 07:38:57+0900
Task
E - TrBBnsformBBtion
User
cephian
Language
C++14 (GCC 5.4.1)
Score
600
Code Size
544 Byte
Status
AC
Exec Time
39 ms
Memory
1536 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:11:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%s%s%d",S,T,&q);
^
./Main.cpp:17:32: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d%d%d",&a,&b,&c,&d);
^
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
600 / 600
Status
Set Name
Test Cases
Sample
0_000.txt, 0_001.txt
All
0_000.txt, 0_001.txt, bound_0.txt, bound_1.txt, bound_2.txt, bound_3.txt, min.txt, rnd_10000_10.txt, rnd_10000_10000.txt, rnd_10000_2.txt, rnd_10_10.txt, rnd_10_10000.txt, rnd_10_2.txt, rnd_2_10.txt, rnd_2_10000.txt, rnd_2_2.txt
Case Name
Status
Exec Time
Memory
0_000.txt
AC
1 ms
256 KB
0_001.txt
AC
1 ms
256 KB
bound_0.txt
AC
32 ms
1536 KB
bound_1.txt
AC
35 ms
1536 KB
bound_2.txt
AC
35 ms
1536 KB
bound_3.txt
AC
37 ms
1536 KB
min.txt
AC
1 ms
256 KB
rnd_10000_10.txt
AC
37 ms
1536 KB
rnd_10000_10000.txt
AC
37 ms
1536 KB
rnd_10000_2.txt
AC
39 ms
1536 KB
rnd_10_10.txt
AC
37 ms
1536 KB
rnd_10_10000.txt
AC
37 ms
1536 KB
rnd_10_2.txt
AC
37 ms
1536 KB
rnd_2_10.txt
AC
37 ms
1536 KB
rnd_2_10000.txt
AC
37 ms
1536 KB
rnd_2_2.txt
AC
37 ms
1536 KB