Submission #1371024
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll x, y, a[100005], b[100005];
char s[100005], t[100005];
int main()
{
scanf("%s%s",s+1,t+1);
x = strlen(s+1);
y = strlen(t+1);
for(ll i=1;i<=x;i++) {
a[i] = a[i-1] + (s[i] - 'A' + 1);
}
for(ll i=1;i<=y;i++) {
b[i] = b[i-1] + (t[i] - 'A' + 1);
}
ll Q;
scanf("%lld",&Q);
while(Q--) {
ll A, B, C, D;
scanf("%lld%lld%lld%lld",&A,&B,&C,&D);
puts((a[B]-a[A-1])%3 == (b[D]-b[C-1])%3 ? "YES" : "NO");
}
}
Submission Info
Submission Time |
|
Task |
E - TrBBnsformBBtion |
User |
khsoo01 |
Language |
C++14 (GCC 5.4.1) |
Score |
600 |
Code Size |
512 Byte |
Status |
AC |
Exec Time |
37 ms |
Memory |
2304 KB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:9:23: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%s%s",s+1,t+1);
^
./Main.cpp:19:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lld",&Q);
^
./Main.cpp:22:40: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lld%lld%lld%lld",&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 |
2304 KB |
bound_1.txt |
AC |
35 ms |
2304 KB |
bound_2.txt |
AC |
35 ms |
2304 KB |
bound_3.txt |
AC |
37 ms |
2304 KB |
min.txt |
AC |
1 ms |
256 KB |
rnd_10000_10.txt |
AC |
37 ms |
2304 KB |
rnd_10000_10000.txt |
AC |
37 ms |
2304 KB |
rnd_10000_2.txt |
AC |
37 ms |
2304 KB |
rnd_10_10.txt |
AC |
37 ms |
2304 KB |
rnd_10_10000.txt |
AC |
37 ms |
2304 KB |
rnd_10_2.txt |
AC |
37 ms |
2304 KB |
rnd_2_10.txt |
AC |
37 ms |
2304 KB |
rnd_2_10000.txt |
AC |
37 ms |
2304 KB |
rnd_2_2.txt |
AC |
37 ms |
2304 KB |