Submission #1302292
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
char sS[100010],sT[100010];
int S[100010] = {0},T[100010] = {0};
int Q;
int main()
{
scanf("%s%s",sS,sT);
for(int i = 1; i < 100000 + 1; i++)
{
if(sS[i - 1] == 'A')
{
S[i] += 1;
S[i + 1] = S[i];
}
else
{
S[i] += 2;
S[i + 1] = S[i];
}
}
for(int i = 1; i < 100000 + 1; i++)
{
if(sT[i - 1] == 'A')
{
T[i] += 1;
T[i + 1] = T[i];
}
else
{
T[i] += 2;
T[i + 1] = T[i];
}
}
scanf("%d",&Q);
for(int i = 0; i < Q; i++)
{
int a,b,c,d;
scanf("%d%d%d%d",&a,&b,&c,&d);
if((S[b] - S[a - 1]) % 3 == (T[d] - T[c - 1]) % 3)
{
printf("YES\n");
}
else
{
printf("NO\n");
}
}
return 0;
}
Submission Info
Submission Time |
|
Task |
E - TrBBnsformBBtion |
User |
unit |
Language |
C++14 (GCC 5.4.1) |
Score |
600 |
Code Size |
993 Byte |
Status |
AC |
Exec Time |
38 ms |
Memory |
1536 KB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:10:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%s%s",sS,sT);
^
./Main.cpp:37:19: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&Q);
^
./Main.cpp:41: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 |
2 ms |
1024 KB |
0_001.txt |
AC |
2 ms |
1024 KB |
bound_0.txt |
AC |
33 ms |
1536 KB |
bound_1.txt |
AC |
36 ms |
1536 KB |
bound_2.txt |
AC |
35 ms |
1536 KB |
bound_3.txt |
AC |
38 ms |
1536 KB |
min.txt |
AC |
2 ms |
1024 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 |
38 ms |
1536 KB |
rnd_2_10.txt |
AC |
38 ms |
1536 KB |
rnd_2_10000.txt |
AC |
37 ms |
1536 KB |
rnd_2_2.txt |
AC |
38 ms |
1536 KB |