Submission #1440206


Source Code Expand

#include<bits/stdc++.h>
using namespace std;

const int maxn = 100009;
char s[maxn], t[maxn];
int S[maxn], T[maxn];
int n, m, Q, a, b, c, d;

int main(){
	scanf("%s", s+1); scanf("%s", t+1);
	n = strlen(s+1); 
	for (int i=1; i<=n; i++)
		S[i] = (S[i-1] + (s[i] == 'A' ? 1 : 2)) % 3;
	m = strlen(t+1);
	for (int i=1; i<=m; i++)
		T[i] = (T[i-1] + (t[i] == 'A' ? 1 : 2)) % 3;
	scanf("%d", &Q);
	while (Q--){
		scanf("%d%d%d%d", &a, &b, &c, &d);
		puts((S[b]-S[a-1]+3)%3 == (T[d]-T[c-1]+3)%3 ? "YES" : "NO");
	}
	return 0;
}

Submission Info

Submission Time
Task E - TrBBnsformBBtion
User Cyanic
Language C++14 (GCC 5.4.1)
Score 600
Code Size 543 Byte
Status AC
Exec Time 38 ms
Memory 1536 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:10:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%s", s+1); scanf("%s", t+1);
                  ^
./Main.cpp:10:36: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%s", s+1); scanf("%s", t+1);
                                    ^
./Main.cpp:17:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &Q);
                 ^
./Main.cpp:19:36: 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
AC × 2
AC × 16
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 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 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