Submission #1517858


Source Code Expand

#include <cmath>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <functional>
#include <queue>
#include <iostream>
#include <string.h>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <cstdint>
#include <climits>
#include <unordered_set>
#include <sstream>
#include <stack>

using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef tuple<int,int,int> t3;

using namespace std;

int main(){
    string a, b;
    cin >> a >> b;
    vector<int> qa(a.length()+1);
    vector<int> qb(b.length()+1);
    qa[0] = qb[0] = 0;
    for (int i=0;i < a.length();i++) qa[i+1]=qa[i]+a[i]-'A'+1;
    for (int i=0;i < b.length();i++) qb[i+1]=qb[i]+b[i]-'A'+1;
    int n;
    cin >> n;
    while(n--)
    {
        int x,y,X,Y;
        cin >> x >> y >> X >> Y;
        if((qa[y]-qa[x-1])%3==(qb[Y]-qb[X-1])%3)
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" << endl;
        }
    }
}

Submission Info

Submission Time
Task E - TrBBnsformBBtion
User nanophoto
Language C++14 (GCC 5.4.1)
Score 600
Code Size 1043 Byte
Status AC
Exec Time 281 ms
Memory 1664 KB

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 254 ms 1664 KB
bound_1.txt AC 272 ms 1664 KB
bound_2.txt AC 270 ms 1664 KB
bound_3.txt AC 281 ms 1664 KB
min.txt AC 1 ms 256 KB
rnd_10000_10.txt AC 277 ms 1664 KB
rnd_10000_10000.txt AC 277 ms 1664 KB
rnd_10000_2.txt AC 278 ms 1664 KB
rnd_10_10.txt AC 276 ms 1664 KB
rnd_10_10000.txt AC 278 ms 1664 KB
rnd_10_2.txt AC 277 ms 1664 KB
rnd_2_10.txt AC 278 ms 1664 KB
rnd_2_10000.txt AC 276 ms 1664 KB
rnd_2_2.txt AC 275 ms 1664 KB