Submission #1371011
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
int n, m, q;
char S[100100], T[100100];
int srr[100100], trr[100100];
int main() {
int i;
scanf("%s",S+1);
scanf("%s",T+1);
n = strlen(S+1); m = strlen(T+1);
for (i=1;i<=n;i++) srr[i] = srr[i-1]+((S[i]=='A')?1:2);
for (i=1;i<=m;i++) trr[i] = trr[i-1]+((T[i]=='A')?1:2);
scanf("%d",&q);
for (i=0;i<q;i++) {
int a, b, c, d;
scanf("%d%d%d%d",&a,&b,&c,&d);
if ((srr[b]-srr[a-1])%3==(trr[d]-trr[c-1])%3) printf("YES\n");
else printf("NO\n");
}
return 0;
}
Submission Info
Submission Time
2017-06-23 09:30:11+0900
Task
E - TrBBnsformBBtion
User
tlwpdus
Language
C++14 (GCC 5.4.1)
Score
600
Code Size
600 Byte
Status
AC
Exec Time
37 ms
Memory
1536 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:12:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%s",S+1);
^
./Main.cpp:13:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%s",T+1);
^
./Main.cpp:17:19: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&q);
^
./Main.cpp:20:38: 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
37 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