50 teams scored 1750 points on this task, for a maximum score of 55, an average score of 35 and a median score of 40.
In the cutting-edge research lab at Helix Institute of Molecular Biology, scientists are analyzing strands of DNA to understand how nucleotides pair under spatial constraints. You are part of a bioinformatics team tasked with analyzing a DNA sequence represented as a string of length N, composed of the nucleotides: (1) Adenine (A) (2) Thymine (T) (3) Cytosine (C) (4) Guanine (G) As per Watson-Crick base pairing rules, A pairs with T, and C pairs with G. You are given a string of length N, made up of characters A, T, C and G. We define the distance between the characters at positions i and j as being | i-j |. You are also given Q queries of the form l r, where you have to count the number of AT/CG pairs, such that they are at a distance between l and r in the string.