problem_id stringlengths 6 6 | user_id stringlengths 10 10 | time_limit float64 1k 8k | memory_limit float64 262k 1.05M | problem_description stringlengths 48 1.55k | codes stringlengths 35 98.9k | status stringlengths 28 1.7k | submission_ids stringlengths 28 1.41k | memories stringlengths 13 808 | cpu_times stringlengths 11 610 | code_sizes stringlengths 7 505 |
|---|---|---|---|---|---|---|---|---|---|---|
p03086 | u918373199 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['S = list(input())\nF = ["A", "C", "G", "T"]\ncount = 0\nmax = 0\nf = 0\nfor i in S:\n for j in F:\n if j == i:\n count += 1\n if max < count:\n\n max = count\n else:\n count = 0\n f = max\n max = 0\nprint(max if max > f else f)', 'S = list(input())\nF = ["A", "C"... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s637086426', 's867040802', 's121083884'] | [3060.0, 3060.0, 3064.0] | [17.0, 17.0, 18.0] | [266, 260, 296] |
p03086 | u923105140 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['s = input()\n\nL = [0]\ncnt = 0\n\nfor x in s:\n if x == "A" or x == "C" or x == "G" or x == "T":\n cnt += 1\n else:\n L.append(cnt)\n \nmax(L)', 's = input()\n\nL = []\ncnt = 0\n\nfor x in s:\n if x == "A" or x == "C" or x == "G" or x == "T":\n cnt += 1\n else:\n L.appe... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s047909285', 's857878557', 's585994800'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [159, 158, 193] |
p03086 | u923341003 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ["S=input()\nslist=[]\nfor i in range(len(S)):\n for j in range(i+1, len(S)+1):\n slist.append(S[i:j])\nma=0\nfor s in slist:\n flag = True\n for w in s:\n if w not in ['A','C','G','T']:\n flag = False\n if flag:\n print(s)\n ma = max(ma, len(s))\nprint(ma)", "S=input(... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s529855850', 's782543183', 's295804297'] | [3064.0, 3060.0, 3060.0] | [20.0, 17.0, 17.0] | [292, 291, 275] |
p03086 | u927764913 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['def checkACGT(s):\n for i in range(len(s)):\n if s[i] == "A" or s[i] == "G" or s[i] == "C" or s[i] == "T":\n continue\n else:\n return False\n return True\n\ns=input()\nn = len(s)\ncheck = []\ncheck.append(s)\nwhile True:\n if checkACGT(check[0]):\n print(len(check[... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s422516106', 's565868200', 's467165867'] | [3700.0, 3060.0, 3064.0] | [28.0, 17.0, 18.0] | [524, 315, 563] |
p03086 | u930574673 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ["s = input()\nset = {'A', 'T', 'G', 'C'}\nl, ans = 0, 0\nfor i in len(s):\n if s[i] in set:\n l += 1\n else:\n ans = max(l, ans)\n l = 0\nprint(ans)", "s = input()\nset = {'A', 'T', 'G', 'C'}\nl, ans = 0, 0\nfor i in range(len(s)):\n if s[i] in set:\n l += 1\n else:\n ans = max(l, ans)\n l = 0\na... | ['Runtime Error', 'Accepted'] | ['s028950293', 's515963465'] | [3060.0, 3060.0] | [17.0, 17.0] | [149, 174] |
p03086 | u939026953 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['s = input()\nn = len(s)\nl = list("ACGT")\nA = 0\nfor i in range(n):\n for j in range(i+1,n+1):\n x = s[i,j]\n if all(k in l for k in x):\n A = max(A,len(x))\nprint(A)', 's = input()\nn = len(s)\nl = list("ACGT")\nA = 0\nfor i in range(n):\n for j in range(i+1,n+1):\n x = s[i:j]\n if all(k in l for... | ['Runtime Error', 'Accepted'] | ['s753709043', 's016976047'] | [2940.0, 2940.0] | [17.0, 18.0] | [170, 170] |
p03086 | u940279019 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ["S = input()\ngene = ['A','T','C','G']\n\nlength = len(S)\nans = 0\ntmp = 0\n\nfor i in range(length):\n if s[i] in gene:\n tmp += 1\n else:\n tmp = 0\n if tmp >= ans:\n ans = tmp\nprint(ans)\n ", "S = input()\ngene = ['A','T','C','G']\n\nlength = len(S)\nans = 0\ntmp = 0\n\nfor i in range(length):\n ... | ['Runtime Error', 'Accepted'] | ['s753532626', 's143583169'] | [2940.0, 3060.0] | [17.0, 17.0] | [195, 188] |
p03086 | u943117333 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['cnt = 0\nrslt = 0\n\n\nfor a in "HATAGAYA":\n flg = 0\n for b in "ATGC":\n if a == b:\n cnt = cnt + 1\n flg = 1\n break\n \n print(a + " :" + str(cnt))\n \n if rslt <= cnt:\n rslt = cnt\n \n if flg == 0:\n cnt = 0\n\n\nprint(rsl... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s423001208', 's563836696', 's879769559', 's069301277'] | [2940.0, 3064.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 17.0] | [319, 372, 222, 340] |
p03086 | u945419374 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['s=input()\nans=0\nfor x in range(1,len(s)+1):\n\tfor left in range(s-x+1):\n\t\tz=s[left:left+x]\n\t\tflag=True\n\t\tfor i in range(x):\n\t\t\tif z[i]!="A" and z[i]!="G" and z[i]!="C" and z[i]!="T":\n\t\t\t\tflag=False\n\t\t\t\tbreak\n\t\tif flag==True:\n\t\t\tans+=1\n\t\t\tbreak\nprint(ans)', 's=input()\nans=0\nfor ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s103141389', 's147123007', 's317451874', 's337045040'] | [3064.0, 3060.0, 3060.0, 3064.0] | [17.0, 17.0, 17.0, 17.0] | [253, 247, 292, 258] |
p03086 | u945460548 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['S = input()\n\ntext = ""\nans = 0\nfor idx, moji in enumerate(S):\n \n if moji == "A" or moji == "C" or moji == "G" or moji == "T":\n text += moji\n for j in range(idx+1,len(S)):\n if S[j] == "A" or S[j] == "C" or S[j] == "G" or S[j] == "T":\n text += S[j]\n el... | ['Wrong Answer', 'Accepted'] | ['s787087772', 's132321608'] | [3064.0, 3064.0] | [17.0, 17.0] | [518, 609] |
p03086 | u945761460 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ["s=str(input())\nans=0\ncnt=0\nfor i in range(len(s)):\n if s[i]=='A' or 'G' or 'C' or 'T':\n cnt++\n else:\n ans=max(ans, cnt)\n cnt=0\nprint(ans)", 's=str(input())\nans=0\ncnt=0\n\nfor i in range(len(s)):\n \n if s[i]=="A" or s[i]== "G" or s[i]== "C" or s[i]== "T":\n cnt=cnt+1\n ans=max(ans, cnt)\... | ['Runtime Error', 'Accepted'] | ['s093308279', 's047449002'] | [8924.0, 9048.0] | [24.0, 29.0] | [148, 187] |
p03086 | u948212056 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ["if __name__ == '__main__':\n l = input().split()\n counter = 0\n max = 0\n for s in l:\n if s == 'A' or s == 'G' or s == 'C' or s == 'T':\n counter += 1\n if max <= counter:\n max = counter\n else:\n counter = 0\n print(max)", "if __name__ == '__main__':\n str = input()\n l = list(s... | ['Wrong Answer', 'Accepted'] | ['s791203383', 's409162054'] | [2940.0, 3060.0] | [17.0, 17.0] | [246, 256] |
p03086 | u953379577 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['s = input()\n\nx = ["A","c","G","T"]\n\nans = 0\ncnt = 0\n\nfor i in s:\n if i not in x:\n cnt += 1\n else:\n ans = max(ans,cnt)\n cnt = 0\n \nprint(ans)', 's = input()\n\nx = ["A","c","G","T"]\n\nans = 0\ncnt = 0\n\nfor i in s:\n if i not in x:\n cnt += 1\n else:\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s717034961', 's945892993', 's736291530'] | [9084.0, 9092.0, 8868.0] | [28.0, 24.0, 29.0] | [173, 153, 252] |
p03086 | u955125992 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ["S = list(input())\nN = len(S)\nfor i in range(N):\n if S[i] is not 'A' or 'T' or 'G' or 'C':\n S.remove(S[i])\nprint(len(S))", "S = list(input())\nN = len(S)\nH = list('ATGC')\nm = 0\nans = 0\nfor i in range(N):\n if S[i] in H:\n m += 1\n if ans < m:\n ans = m\n else:\n ... | ['Runtime Error', 'Accepted'] | ['s038654100', 's076777296'] | [2940.0, 3060.0] | [17.0, 18.0] | [129, 186] |
p03086 | u957872856 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['a = input()\nsum = 0\nlist = ["A","C","G","T"]\nfor i in range(len(a)):\n for j in list:\n if j in a[i]:\n sum += 1\n else:\n sum = 0\n \nprint(sum)', 'S = input()\nm = 0\ncount = 0\nfor s in S:\n if "A" in s:\n count += 1\n elif "C" in s:\n count += 1\n elif "G" in s:\n count += 1\n... | ['Wrong Answer', 'Accepted'] | ['s281489929', 's702670468'] | [3060.0, 2940.0] | [18.0, 17.0] | [160, 217] |
p03086 | u959651981 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['s = input()\n\nl = 0\na = 0\n\nfor c in s:\n if c in "a↨c↨g↨t↨":\n l += 1\n a = max(a,l)\n else:\n l = 0\n \nprint(a)', "S = input()\n\nl = 0\na = 0\nfor ch in S:\n if ch in 'ACGT':\n l += 1\n a = max(a, l)\n else:\n l = 0\nprint(a)\n"] | ['Wrong Answer', 'Accepted'] | ['s438923201', 's124035054'] | [2940.0, 2940.0] | [17.0, 17.0] | [147, 129] |
p03086 | u961916328 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['b = input()\nlen = len(b)\nACGT = 0\nMAX = 0\nflag = 0\nfor i in range(len):\n if b[i]=="A" or b[i]=="C" or b[i]=="G" or b[i]=="T":\n ACGT += 1\n else:\n MAX = ACGT\n ACGT = 0\n flag = 1\nif flag ==0:\n MAX=ACGT\nprint(MAX)', 'b = input()\nlen = len(b)\nACGT = 0\nMAX = 0\nfor i in range(b):\n if b[i]=... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s630664064', 's634253968', 's764814868', 's057607136'] | [3064.0, 3060.0, 2940.0, 3064.0] | [17.0, 19.0, 17.0, 18.0] | [224, 176, 160, 236] |
p03086 | u963944915 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ["S=input()\nL=['A','C','G','T']\nno=0\nx=0\nfor i in S:\n if i in L:\n x+=1\n else:\n x=0\n ans=(x,no)\nprint(ans)", "S=input()\nL=['A','C','G','T']\nno=0\nx=0\nfor i in S:\n if i in L:\n x+=1\n else:\n x=0\n ans=max(x,no)\nprint(ans)\n", "S=input()\nL=['A','C','G','T']\nans=0\nx=0\nfor i in S:\n if... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s263941360', 's980977066', 's295247867'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [112, 116, 118] |
p03086 | u966648240 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['S=str(input())\nS2=[]\nans=0\nfor i in range(len(S)):\n for j in range(len(S)+1):\n S2=S[i:j]\n print(S2)\n que=len(S2)\n S2=S2.replace("A","")\n S2=S2.replace("G","")\n S2=S2.replace("C","")\n S2=S2.replace("T","")\n if S2=="":\n if que>ans:\n ans=que\n S2=[] \nprint(ans)', 'S... | ['Wrong Answer', 'Accepted'] | ['s559437881', 's484123541'] | [9140.0, 9036.0] | [29.0, 25.0] | [297, 283] |
p03086 | u969077316 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['S = input()\n\nsubStringList = []\nlength = len(S)\n\nfor i in range(length) :\n for j in range(1,length+1):\n if (i+j <= length) :\n subStringList.append(S[i:i+j])\n else:\n break\n\n\nfor s in subStringList[:]:\n for letter in s:\n if (not(letter in "ATGC")):\n ... | ['Runtime Error', 'Accepted'] | ['s692572272', 's205937895'] | [3060.0, 3060.0] | [17.0, 17.0] | [382, 419] |
p03086 | u969190727 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['s=input()\nans=0\ncur=0\nACGT=set("A","C","G","T")\nfor ss in s:\n if ss in ACGT:\n cur+=1\n else:\n ans=max(cur,ans)\n cur=0\nprint(max(ans,cur))\n\n', 'S=input()\nACGT=["A","C","G","T"]\nm=0\nfor i in range(len(S)):\n n=0\n while S[i] in ACGT:\n n+=1\n m=max(m,n)\nprint(m)', 's=input()\nans=0\ncur=... | ['Runtime Error', 'Time Limit Exceeded', 'Accepted'] | ['s012163745', 's159326216', 's433236667'] | [2940.0, 2940.0, 2940.0] | [17.0, 2104.0, 17.0] | [149, 119, 146] |
p03086 | u970449052 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ["S = input()\ncnt = 0\nmax = 0\nfor str in S:\n if str in {'A', 'C', 'G', 'T'}:\n cnt += 1\n else:\n if max < cnt:\n max = cnt\n cnt = 0\nif max < cnt:\n max = cnt\nprint(cnt)", "S = input()\n\ncnt = 0\nmax = 0\nfor str in S:\n if str in {'A', 'C', 'G', 'T'}:\n cnt += 1\n else:\n if cnt < max:... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s317808946', 's610470526', 's941741311', 's970673654', 's230125602'] | [3060.0, 2940.0, 3060.0, 2940.0, 2940.0] | [18.0, 19.0, 17.0, 18.0, 18.0] | [179, 155, 153, 209, 188] |
p03086 | u972892985 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['s = input()\nans = 0\nfor S in s:\n if S == "A":\n ans += 1\n elif S == "G":\n ans += 1\n elif S == "T":\n ans += 1\n elif S == "C":\n ans += 1\n else:\n ans = 0\n \nprint(ans)\ns = input()\nans = 0\nfor S in s:\n if S == "A":\n ans += 1\n elif S == "G":\n ans += 1\n elif S == "T":\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s356765871', 's747266786', 's574225080'] | [3064.0, 3188.0, 2940.0] | [17.0, 17.0, 17.0] | [372, 185, 201] |
p03086 | u974792613 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['pat = ["A", "C", "G", "T"]\n\ns = input()\n\nleft = right=0\nans = 0\n\nwhile left<len(s):\n right = left\n while s[right] in pat:\n right+=1\n \n ans = min(ans, right - left)\n \n left = right+1\n \nprint(ans)', 'pattern = ["A", "T", "G", "C"]\n\ns = input()\n\nmax_count = 0\ncount = 0\nfor c in s:\n if... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s613054402', 's740219922', 's466811250'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [204, 242, 238] |
p03086 | u974935538 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['s = str(input())\nACGT = {"A", "C", "G", "T"}\n\nans = 0\nfor i in range(len(s)):\n for j in range(i, len(s) + 1):\n k = s[i: j]\n for l in k:\n if l not in ACGT:\n break\n else:\n ans = max(ans, len(t))\nprint(ans)\n', 's = str(input())\nACGT = {"A", "C", ... | ['Runtime Error', 'Accepted'] | ['s998939515', 's123275155'] | [2940.0, 3060.0] | [18.0, 17.0] | [265, 265] |
p03086 | u975884051 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ["S = str(input())\nlistS = list(S)\n\ncount = 0\nmax = 0\n\nfor i in range(len(listS)):\n if listS[i] == 'A' or listS[i] == 'T' or listS[i] == 'G' or listS[i] == 'C':\n count += 1\n else:\n max = count\n count = 0\n\nprint(max) ", "S = str(input())\nlistS = list(S)\n\ncount = 0\nmax = 0\... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s133658684', 's516060519', 's851093275', 's530288625'] | [2940.0, 2940.0, 3060.0, 3060.0] | [17.0, 17.0, 17.0, 17.0] | [245, 265, 292, 268] |
p03086 | u977855674 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['s = input()\ndef check(a):\n ALLOWED = "ACGT"\n for c in a:\n if not c in ALLOWED:\n return False\n return True\n\nans = 0\nfor i in range(len(s)):\n for j in range(1, len(s) - i + 1):\n tmp = s[i: i + j]\n print(tmp)\n if check(tmp):\n ans = max(ans, len(... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s525562672', 's866104672', 's237089097'] | [3060.0, 3060.0, 3060.0] | [17.0, 17.0, 17.0] | [321, 325, 302] |
p03086 | u978141830 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ["s = input()\ntgt = ['A', 'C', 'G', 'T']\n\nlst = []\ncnt = 0\n\nfor x in s:\n if x in tgt:\n cnt = cnt +1\n else:\n lst.append(cnt)\n cnt = 0\n\nprint(max(lst)\n", "s = input()\ntgt = ['A', 'C', 'G', 'T']\n\nlst = []\ncnt = 0\n\nfor x in s:\n if x in tgt:\n cnt = cnt +1\n else:\n lst.append(cnt)\n ... | ['Runtime Error', 'Accepted'] | ['s797196878', 's990831094'] | [2940.0, 2940.0] | [17.0, 17.0] | [158, 180] |
p03086 | u979060189 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ["S = str(input())\ncounter = 0\nmax = 0\n\nfor i in S:\n if i == 'A' or i == 'T' or i == 'C' or i == 'G':\n counter += 1\n if counter >= max:\n max = counter\n else:\n counter = 0\n\nprint(counter)", "S = str(input())\ncounter = 0\nmax = 0\n\nfor i in S:\n if i == 'A' or i == '... | ['Wrong Answer', 'Accepted'] | ['s234457415', 's130631906'] | [3060.0, 2940.0] | [17.0, 17.0] | [222, 218] |
p03086 | u979362546 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['s = input()\nn = len(s)\na = [B,D,E,F,H,I,J,K,L,M,N,O,P,Q,R,S,U,V,W,X,Y,Z]\ncnt = []\nfor i in range(n):\n for j in range(i,n+1):\n \tfr = s[i;j]\n \tvalue = 1\n \tfor k in a:\n \t\tif k in fr:\n \t\t\tvalue = 0\n \tif value:\n \t\tcnt.append(len(fr))\nprint(max(cnt))', 's = input()\nn = len(s... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s688825412', 's770177094', 's794211019', 's117626879'] | [2940.0, 2940.0, 2940.0, 3060.0] | [17.0, 17.0, 17.0, 18.0] | [268, 254, 275, 257] |
p03086 | u984276646 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['S = input()\nF = "ATGC"\ncnt = 0\nn = len(S)\nfor i in range(n-1):\n for j in range(i+1, n):\n flg = True\n for k in range(i, j):\n flg *= (S[i] in F)\n if flg:\n cnt = max(cnt, j - i)\nprint(cnt)', 'S = input()\nF = "ATGC"\ncnt = 0\nn = len(S)\nfor i in range(n):\n for j in range(i+1, n+1):\n ... | ['Wrong Answer', 'Accepted'] | ['s339523931', 's500050027'] | [9060.0, 9032.0] | [29.0, 26.0] | [205, 206] |
p03086 | u987170100 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ["S = input()\nret = 0\nfor x in range(len(S)):\n for y in range(x + 1, len(S) + 1):\n s = S[x:y]\n print(s)\n if all([x in 'ACGT' for x in s]):\n ret = max(ret, len(s))\nprint(ret)", 'S = input()\nret = 0\nfor i in range(len(S)):\n for j in range(i, len(S)):\n f = True\n ... | ['Wrong Answer', 'Accepted'] | ['s029600981', 's158373087'] | [3060.0, 9020.0] | [17.0, 24.0] | [206, 267] |
p03086 | u987326700 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['s = input()\nchrlis = []\nfor i in range(len(s)):\n if s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T":\n start = i\n for j in range(i,len(s)):\n if s[j]=="A" or s[j]=="C" or s[j]=="G" or s[j]=="T":\n end = j\n else:\n break\n else:\n continue\n chrlis.append(s[start:end+1])\n\nan... | ['Wrong Answer', 'Accepted'] | ['s308173699', 's365166547'] | [3064.0, 3064.0] | [17.0, 17.0] | [407, 400] |
p03086 | u989157442 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ["print(max([sum(1 for _ in s[1]) if [0] == 'A' else 0 for s in __import__('itertools').groupby(input().replace('T', 'A').replace('G', 'A').replace('C', 'A'))]))", "print(max([sum(1 for _ in s[1]) if s[0] == 'A' else 0 for s in __import__('itertools').groupby(input().replace('T', 'A').replace('G', 'A').replace('C', 'A'... | ['Wrong Answer', 'Accepted'] | ['s354527186', 's308113343'] | [3060.0, 3060.0] | [18.0, 18.0] | [159, 160] |
p03086 | u993435350 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['S = input()\n\npartial = ""\n\nconditions = ["A","T","G","C"]\n\nconlist = []\n\ncon = 0\n\nfor i in range(0,len(S)):\n\tif S[i] in conditions:\n\t\tfor j in range(0,i+1):\n\t\t\tprint(S[j])\n\t\t\tif S[j] in conditions:\n\t\t\t\tcon +=1\n\t\t\tif (S[j] not in conditions) or j == i:\n\t\t\t\tconlist.append(con)\n\t\t... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s107599653', 's863665978', 's584381623'] | [3064.0, 3064.0, 2940.0] | [17.0, 17.0, 17.0] | [351, 296, 185] |
p03086 | u995102075 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['import re\n\nS = input()\npattern = "[ATGC]*"\n\nmatched_list = sorted(re.findall(pattern, S),\n key=lambda s: len(s),\n reverse=True)\nprint(matched_list)\nprint(len(matched_list[0]))\n', 'import re\n\nS = input()\npattern = "[ATGC]*"\n\nmatched_list = sorted(re.findall(patt... | ['Wrong Answer', 'Accepted'] | ['s041017976', 's274829455'] | [3188.0, 3188.0] | [21.0, 19.0] | [218, 141] |
p03086 | u996665352 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['S = input()\nT = "ACGT"\nans = 0\nfor s in S:\n if s in T:\n cnt += 1\n else:\n if cnt > ans:\n ans = cnt\n cnt = 0\nprint(ans)', 'S = input()\nT = "ACGT"\nans = 0\ncnt = 0\nfor s in S:\n if s in T:\n cnt += 1\n else:\n if cnt > ans:\n ans = cnt\n ... | ['Runtime Error', 'Accepted'] | ['s220869136', 's210345180'] | [2940.0, 3060.0] | [17.0, 17.0] | [155, 189] |
p03086 | u999503965 | 2,000 | 1,048,576 | You are given a string S consisting of uppercase English letters. Find the length of the longest _ACGT string_ that is a substring (see Notes) of S. Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`. | ['l=input()\n\nif "A" or "G" or "C" or "T" not in l:\n print(0)\n exit()\n\nans=0\nnum=0\nfor i in l:\n print(i)\n if i=="A" or i=="G" or i=="C" or i=="T":\n num+=1\n else:\n ans=max(num,ans)\n num=0\n \nprint(ans)\n ', 'l=input()\n\nif "A" or "G" or "C" or "T" not in l:\n print(0)\n exit()\n\nans... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s105369036', 's176449918', 's618361682'] | [8964.0, 8932.0, 9032.0] | [32.0, 30.0, 32.0] | [218, 208, 167] |
p03087 | u007550226 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["N,Q = map(int,input().split())\ns = input()\nal = [0] * N\nal[0] = 0\nfor i in range(1,N):\n if s[i-1:i+1] == 'AC':al[i] = al[i-1]+1\n else:al[i]=al[i-1]\nfor _ in range(Q):\n l,r = map(int,input().split())\n print(l,r,':',al[r-1]-al[l-1])", "N,Q = map(int,input().split())\ns = input()\nal = [0] * N\nal[0... | ['Wrong Answer', 'Accepted'] | ['s437491662', 's621116291'] | [7420.0, 6140.0] | [1001.0, 859.0] | [242, 234] |
p03087 | u007991836 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["n,q = map(int,input().split())\n8 3\ns = input()\nACACTACG\nlr = list(list(map(int,input().split())) for i in range(q))\n3 7\n2 3\n1 8\n\nx = [0]*(n-1)\nfor i in range(n):\n if s[i] == 'A' and s[i+1] == 'C':\n x[i] = 1\n\nfor i in range(q):\n print(sum(x[(lr[i][0]-1):(lr[i][1]-1)]))\n", "n,q = map(int,in... | ['Runtime Error', 'Accepted'] | ['s752781689', 's840914398'] | [2940.0, 30656.0] | [17.0, 494.0] | [282, 344] |
p03087 | u010069411 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['#N,Q=8,3\n#S="ACACTACG"\n#L = [3,2,1]\n#R = [7,3,8]\n\nN,Q=map(int, input().split(" "))\nS=input()\nL=[]\nR=[]\nfor _ in range(Q):\n l,r=map(int,input.split(" "))\n L.append(l)\n R.append(r)\n\n\nsh=[0]\nn=0\nfor i in range(1,N):\n if S[i-1] == "A" and S[i] == "C":\n n+=1\n sh.append(n)\nfor (l,... | ['Runtime Error', 'Accepted'] | ['s901536667', 's724564483'] | [3188.0, 14212.0] | [17.0, 416.0] | [341, 371] |
p03087 | u013408661 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['n,q=map(int,input().split())\ns=input()\nSum=[0]\nsum=0\nfor i in range(1,n+1):\n sum=s[:i].count("AC")\n Sum.append(sum)\nfor i in range(q):\n l.r=map(int,input().split())\n print(Sum[r]-Sum[l])', 'n,q=map(int,input().split())\ns=input()\nSum=[0]\nsum=0\nstack="Q"\nfor i in range(n):\n if stack=="A" and s[i]=="... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s151612388', 's366726785', 's213832330'] | [5236.0, 6124.0, 6124.0] | [2104.0, 862.0, 847.0] | [190, 230, 227] |
p03087 | u014333473 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["n,q=map(int,input().split())\ns=input()\nt=[0]*(n+1)\nfor i in range(n):\n t[i+1] = t[i] + (1 if s[i:i+2]=='AC' else 0)\nprint(t)\nfor _ in range(q):\n l,r=map(int,input().split())\n print(t[r-1]-t[l-1])", "n,q=map(int,input().split())\ns=input()\nt=[0]*(n+1)\nfor i in range(n):\n t[i+1] = t[i] + (1 if s[i:i+2]==... | ['Wrong Answer', 'Accepted'] | ['s622068718', 's790036565'] | [14316.0, 13076.0] | [480.0, 479.0] | [198, 189] |
p03087 | u021019433 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["p = 'ACGT'\ns = input()\nl = len(s)\nr = 0\ni = -1\nwhile i < l:\n j = next((i for i in range(i + 1, l) if s[i] in p), l)\n i = next((i for i in range(j + 1, l) if s[i] not in p), l)\n r = max(r, i - j)\nprint(r)\n", "R = lambda: map(int, input().split())\nn, q = R()\ns = input()\na = [0] * n\nc = 0\nfor i in range(1... | ['Wrong Answer', 'Accepted'] | ['s695830969', 's122578489'] | [3060.0, 6164.0] | [17.0, 872.0] | [204, 214] |
p03087 | u022979415 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['def main():\n N, Q = map(int, input().split(" "))\n S = input()\n result = [0] * (N + 1)\n for i in range(1, Q + 1):\n if S[i-1:i+1] == "AC":\n result[i] = result[i - 1] + 1\n else:\n result[i] = result[i - 1]\n for _ in range(Q):\n l, r = map(int, input().spl... | ['Runtime Error', 'Accepted'] | ['s802155781', 's359294093'] | [6268.0, 6140.0] | [829.0, 816.0] | [397, 401] |
p03087 | u023229441 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['n,m=map(int,input().split())\ns=input()\nfor i in m:\n a,b=map(int,input().split())\n lan=s[a-1:b]\n print(lan.count("AC"))', 'n,m=map(int,iput().split())\ns=input()\nACsuu=[0 for i in range(n)]\nfor i in range(1,n):\n Acsuu[i]=ACsuu[i-1]+(1 if s[i-1:i+1]=="AC" else 0)\nfor i in range(m):\n a,b=map(int,input().s... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s001337833', 's489718406', 's545563074'] | [3188.0, 3060.0, 7772.0] | [17.0, 17.0, 858.0] | [121, 220, 222] |
p03087 | u023958502 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["N,Q = map(int,input().split())\nS = input()\nplace = []\nfor s in range(N - 1):\n\tif S[s] == 'A':\n\t\tif S[s + 1] == 'C':\n\t\t\tplace.append(s)\nPlaceCount = len(place)\nfor q in range(Q):\n num = 0\n\tl,r = map(int,input().split())\n\tl -= 1\n\tr -= 2\n\tfor i in range(PlaceCount):\n\t\tif l <= place[i] <= r:\... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s423332861', 's873713290', 's519224550'] | [2940.0, 5108.0, 8572.0] | [18.0, 2104.0, 889.0] | [315, 165, 377] |
p03087 | u024496314 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['n, q = [int(x) for x in input().split()]\n\ns = input()\n\narr = [0 for _ in range(len(s)+1)]\n\nfor i in range(len(s)-1):\n\tif s[i] == \'A\' and s[i+1] == \'C\':\n\t\tarr[i+2] += 1\n\nfor i in range(1, len(arr)):\n\tarr[i] = arr[i-1] + arr[i]\n\nfor i in range(1, len(arr)):\n\tprint(arr[i], end=" ")\nfor _ in range... | ['Wrong Answer', 'Accepted'] | ['s478171837', 's308343000'] | [8528.0, 7692.0] | [1033.0, 902.0] | [367, 314] |
p03087 | u024782094 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['n,q=map(int,input().split())\ns=input()\nlr=[list(map(int,input().split())) for _ in range(q)]\ncount=0\nl=[0]*n\nfor i in range(1,n):\n if s[i-1]=="A" and s[i]=="C":\n count+=1\n l[i]=count\nprint(l)\nfor i in range(q):\n print(l[lr[i][1]-1]-l[lr[i][0]-1])', 'n,q=map(int,input().split())\ns=input()\nlr=[list(m... | ['Wrong Answer', 'Accepted'] | ['s976280823', 's736302945'] | [31812.0, 30680.0] | [482.0, 469.0] | [252, 243] |
p03087 | u026862065 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["n, q = map(int, input().split())\ns = input()\nac = [0] * n\nc = 1\nfor i in range(n - 1):\n if s[i] == 'A' and s[i + 1] == 'C':\n ac[i] = c\n c += 1\nfor i in range(q):\n l, r = map(int, input().split())\n s, f = 0, 0\n for j in range(l - 1, r - 1):\n if ac[j] != 0:\n s = ... | ['Wrong Answer', 'Accepted'] | ['s811788240', 's666833352'] | [6004.0, 6084.0] | [2104.0, 883.0] | [459, 256] |
p03087 | u027002244 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['n,q=map(int,input().split())\ns=list(input())\n#print(s)\ni=0\na=[]\nx=0\nwhile i!=len(s):\n if n>100:\n\n if s[i]=="C" and a1==1:\n x=x+1\n a1=0\n elif s[i]=="A":\n a1=1\n else:\n a1=0\n i=i+1\n a.append(x)\n\n#print(a)\ni=0\nwhile i!=q:\n try:\n l,r=map(int,input().spl... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s017970380', 's468514468', 's952608117', 's188819877'] | [6376.0, 6376.0, 6328.0, 6372.0] | [2104.0, 2104.0, 912.0, 892.0] | [366, 368, 370, 298] |
p03087 | u029000441 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["N, Q = map(int, input().split())\nS = input()\nt=[0]*(N+1) \nfor i in range(N):\n\tt[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0) \nfor i in range(Q):\n\tl, r = map(int, input().split())\nprint(t[r-1] - t[l-1])", "N, Q = map(int, input().split())\nS = input()\nt=[0]*(N+1) \nfor i in range(N):\n\tt[i + 1] = t[i]... | ['Wrong Answer', 'Accepted'] | ['s019291472', 's132226805'] | [7108.0, 9156.0] | [310.0, 862.0] | [207, 209] |
p03087 | u029169777 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["N,Q=map(int,input().split())\n\nS=input()\n\nACDP=[0]*N\nAflag=0\nACcount=0\nfor i in range(len(S)):\n if S[i]=='A':\n Aflag=1\n else:\n Aflag=0\n if S[i]=='C' and Aflag==1:\n ACcount+=1\n ACDP[i]=ACcount\nprint(ACDP)\n\nfor _ in range(Q):\n start,end=map(int,input().split())\n print(ACDP[end-1]-ACDP[s... | ['Runtime Error', 'Accepted'] | ['s377427647', 's968592133'] | [3064.0, 6108.0] | [17.0, 866.0] | [306, 311] |
p03087 | u033524082 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["N, Q = map(int, input().split())\nS = input()\nLR = [list(map(int, input().split())) for _ in range(Q)]\ndp = [0] * (N)\nfor i in range(N-1):\n if S[i] == 'A' and S[i+1] == 'C':\n dp[i+1] = dp[i] + 1\n else:\n dp[i+1] = dp[i]\n\nfor l, r in LR:\n print(dp[r-1] - dp[l-1])\nprint(dp)\n", "N, Q = ... | ['Wrong Answer', 'Accepted'] | ['s203866660', 's038543782'] | [32800.0, 30664.0] | [470.0, 466.0] | [294, 284] |
p03087 | u036641509 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['# N,Q = map(int, input().split())\n# S = str(input())\nN,Q = 8,3\nS = "ACACTACG"\nL = [0] * len(S) \ni = 0\nwhile i < len(S)-1:\n if S[i] == "A":\n if S[i+1] == "C":\n L[i] = 1\n i += 1\n elif S[i+1] == "A":\n i += 1\n else:\n i += 2\n else:\n ... | ['Runtime Error', 'Accepted'] | ['s929175367', 's591231742'] | [3188.0, 6084.0] | [18.0, 864.0] | [416, 601] |
p03087 | u037074041 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["from sys import stdin\nimport math\nimport itertools\nimport re\n \n \ndef makeIntMatrix(lines):\n intMatrix = []\n for a in makeStringMatrix(lines):\n intMatrix.append([int(b) for b in a])\n return intMatrix\n \n \ndef makeStringMatrix(lines):\n stringMatrix = [line.split() for line in lines]\n ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s119132800', 's648395757', 's214325512'] | [58556.0, 2940.0, 58612.0] | [189.0, 17.0, 312.0] | [1310, 218, 2252] |
p03087 | u042802884 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["N,Q=map(int,input().split())\nS=input()\na=[0]\nfor i in range(1,N):\n if S[i-1]+S[i]=='AC':\n a.append(1)\n else:\n a.append(0)\nprint(a)\nb=[]\nsum=0\nb.append(sum)\nfor x in a:\n sum+=x\n b.append(sum)\nprint(b)\nfor i in range(Q):\n l,r=map(int,input().split())\n print(b[r]-b[l])",... | ['Wrong Answer', 'Accepted'] | ['s816857443', 's910778387'] | [10432.0, 8556.0] | [876.0, 891.0] | [298, 300] |
p03087 | u048176319 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['n, q = map(int, input().split())\ns = input()\n\nlc = [0]\nc = 0\nfor i in range(n-1):\n if s[i] == "A" and s[i+1] == "C":\n c += 1\n lc.append(c)\n\nprint(lc)\n\nfor i in range(q):\n l, r = map(int, input().split())\n print(lc[r-1]-lc[l-1])\n', 'n, q = map(int, input().split())\ns = input()\n\nlc ... | ['Wrong Answer', 'Accepted'] | ['s012368111', 's327615317'] | [7492.0, 6100.0] | [871.0, 874.0] | [247, 236] |
p03087 | u050876787 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['n, q = list(map(int, input().split()))\ns = input()\n\nacs = [0] * (n - 1)\n\nfor i in range(n - 1):\n if i == 0:\n if s[0 : 2] == "AC":\n acs[0] += 1\n else:\n if s[i : i + 2] == "AC":\n acs[i] = acs[i - 1] + 1\n else:\n acs[i] = acs[i - 1]\n \nprint(acs)\n\nfor i in range(q):\n x = 0... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s763356483', 's977402410', 's877508252'] | [7464.0, 7544.0, 6188.0] | [1035.0, 945.0, 907.0] | [417, 361, 264] |
p03087 | u052499405 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['n, q = [int(item) for item in input().split()]\ns = input()\nlr = [[int(item) for item in input().split()] for _ in range(q)]\n\nis_ac = [0] * n\ncount = 0\nfor i in range(n-1):\n if s[i] == "A":\n if s[i+1] == "C":\n count += 1\n is_ac[i+1] = count\nis_ac[-1] = count\nprint(is_ac)\nfor item in lr:\n ans =... | ['Wrong Answer', 'Accepted'] | ['s495634936', 's679448323'] | [25604.0, 24472.0] | [448.0, 445.0] | [353, 340] |
p03087 | u055941944 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['n, q = map(int,input().split())\ns = list(input())\nx = []\n\nans = 0\nfor i in range(n):\n\tif s[i] == "A" and s[i+1] == "C":\n\t\tans += 1\n\t\tx.append(ans)\n\telse:\n\t\tx.append(ans)\nx.append(ans)\n\nfor j in range(q):\n\tl, r = map(int,input().split())\n\tprint(x[r-1]-x[l-1])', 'n,q =map(int,input().split())\n... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s134962622', 's147682201', 's265043272', 's459501321', 's522857086', 's685015907', 's811495836', 's957790990', 's732809042'] | [6876.0, 6740.0, 3064.0, 6876.0, 6376.0, 6876.0, 6264.0, 6740.0, 6100.0] | [853.0, 900.0, 17.0, 863.0, 108.0, 868.0, 2108.0, 952.0, 860.0] | [258, 248, 309, 244, 245, 265, 214, 252, 250] |
p03087 | u057109575 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["N, Q = map(int, input().split())\nS = input()\nfor _ in range(Q):\n l, r = map(int, input().split())\n print(len(re.findall('AC', S[l - 1:r])))\n", "from itertools import accumulate\nfrom operator import add\n\nN, Q = map(int, input().split())\nS = input()\nidx_list = [1 if S[i:i + 2] == 'AC' else 0 for i in range(... | ['Runtime Error', 'Accepted'] | ['s624909998', 's077581205'] | [3188.0, 8820.0] | [17.0, 844.0] | [142, 343] |
p03087 | u058861899 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['\n\ndp =[[0 for i in range(n+2)] for j in range(n+2)]\n\nfor i in range(1):\n for j in range(i,n):\n t=0\n if s[j]=="C" and j!=i:\n if s[j-1]=="A":\n t=1\n \n dp[i][j]=dp[i][j-1]+t\n \nfor i in range(1,n):\n t=0\n if s[i]=="C" and s[i-1]=="A": \n... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s479520439', 's530928364', 's781706471', 's871783669', 's949282161', 's047772749'] | [3064.0, 3060.0, 483608.0, 503796.0, 7164.0, 7692.0] | [17.0, 17.0, 2133.0, 2134.0, 316.0, 875.0] | [462, 231, 423, 399, 333, 275] |
p03087 | u059210959 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['# encoding:utf-8\nimport copy\nimport numpy as np\nimport random\n\nn,q = map(int,input().split())\ns = list(str(input()))\nL = []\nfor i in range(q):\n l,r = map(int,input().split())\n L.append([l,r])\n\ncount_ac = np.zeros([len(s)])\nfor i in range(len(s)):\n if s[i]=="A" and i<len(s):\n if s[i+1]==... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s137492296', 's225106065', 's691497572', 's521304425'] | [32892.0, 33412.0, 34824.0, 17856.0] | [2109.0, 607.0, 625.0, 1062.0] | [446, 552, 566, 867] |
p03087 | u060793972 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['n,q=map(int,input().split())\ns = input()\na = [0,0]\nfor i in range(1,n):\n a.append(a[i]+(s[i-1]=="A" and s[i]==\'C\'))\nprint(a)\nfor i in range(q):\n l,r=map(int,input().split())\n print(a[r]-a[l-1]-(s[l-2]==\'A\' and s[l-1]==\'C\'))\n', 'n,q=map(int,input().split())\ns = input()\na = [0,0]\nfor i in ran... | ['Wrong Answer', 'Accepted'] | ['s971996319', 's507901255'] | [9104.0, 7684.0] | [934.0, 888.0] | [233, 224] |
p03087 | u063550903 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['input_num=(input().split())\ninput_str=input()\nanslen=[]\nfor i in range(input_num[1]):\n divpoint=(input().split())\n k=input_str[divpoint[0]:divpoint[1]+1]\n anslen.append(k.count("AC"))\nfor i in range(input_num[1]):\n print(anslen[i])', 'input_num=list(input())\ninput_str=list(input())\nanslen=[]\nfor i in r... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s030312741', 's440845958', 's657141965', 's737653792'] | [3188.0, 3956.0, 3188.0, 9284.0] | [17.0, 19.0, 17.0, 864.0] | [235, 241, 251, 197] |
p03087 | u063962277 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["n,q = map(int, input().split())\ns =input()\nA = [[int(j) for j in input().split()] for i in range(q)]\nls = [0] * (n+1)\nfor i in range(n-1):\n if s[i] == 'A' and s[i+1] == 'C':\n ls[i+1]= ls[i]+1\n else:\n ls[i+1]= ls[i]\n\nfor k in range(q):\n print(ls[[k][0]-1-A[k][1]-1])", "n,q = map(int, ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s476623698', 's918030720', 's731236473'] | [24496.0, 24472.0, 24472.0] | [478.0, 439.0, 446.0] | [288, 293, 293] |
p03087 | u066692421 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['n, q = map(int,input().split())\ns = input()\ninputlist = []\nfor i in range(q):\n inputlist.append(list(map(int,input().split())))\n\naclist = []\nfor j in range(n - 1):\n if s[j] == "A" and s[j + 1] == "C":\n aclist.append(j)\n\nanslist = []\nfor k in range(q):\n ans = 0\n for e in aclist:\n if inputlist[... | ['Wrong Answer', 'Accepted'] | ['s461254686', 's492376511'] | [30736.0, 38092.0] | [2109.0, 531.0] | [447, 643] |
p03087 | u068727970 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["N, Q = map(int, input().split())\nS = list(input())\nfor _ in range(Q):\n l, r = map(int, input().split())\n line = S[l-1:r]\n count = 0\n for i in range(r-l):\n if line[i] == 'A' and line[i+1] == 'C':\n count += 1\n", "N, Q = map(int, input().split())\nS = list(input())\nholder = set()\... | ['Wrong Answer', 'Accepted'] | ['s144777218', 's413101847'] | [6284.0, 10996.0] | [2104.0, 855.0] | [237, 421] |
p03087 | u072606168 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['n,q = map(int, input().split())\ns = input()\nss = s\nt = []\nfor i in range(s.count("AC")):\n try:\n \tt.append(ss.index("AC"))\n \tss = ss[ss.index("AC")+2]\n except:\n break\nfor i in range(q):\n l,r = map(int, input().split())\n print(len([1 for i in t if l <= i and i+1 <= r]))', "N, Q = map(int, input()... | ['Wrong Answer', 'Accepted'] | ['s008486626', 's408087025'] | [3444.0, 7748.0] | [856.0, 906.0] | [277, 212] |
p03087 | u073549161 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | [' n, q = map(int, input().split())\n s = input()\n dat_q = []\n for i in range(q):\n l, r = map(int, input().split())\n dat_q.append((l, r))\n\n c = [0] * n\n for i in range(1, n):\n if s[i-1:i+1] == "AC":\n c[i] = c[i-1] + 1\n else:\n c[i] = c[i-1]\n... | ['Runtime Error', 'Accepted'] | ['s722317642', 's039567116'] | [2940.0, 19804.0] | [17.0, 455.0] | [402, 342] |
p03087 | u078944864 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["n,q = int(input().split(' '))\nstr = input()\nfor i in range(q):\n s,e = int(input().split(' '))\n tmp = s[s-1:e]\n ans = tmp.count('AC')\n print(ans)", "n,q = map(int,input().split())\nstr = input()\nq = int(q)\ndic = {}\n\nfor j in range(len(str)):\n if (j > 0):\n if (str[j-1] == 'A' and str[j] == 'C'):\n ... | ['Runtime Error', 'Accepted'] | ['s953873262', 's689632736'] | [3060.0, 16620.0] | [18.0, 927.0] | [148, 328] |
p03087 | u081688405 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['N, Q = map(int, input().split(" "))\nS = input()\nac_cnts = []\nac_cnt = 0\nfor i in range(N-1):\n if S[i:i+2] == "AC":\n ac_cnt += 1\n ac_cnts.append(ac_cnt)\nfor j in range(Q):\n l, r = map(int, input().split(" "))\n print(ac_cnts[r-2] - ac_cnts[l-1] + 1)\n', 'N, Q = map(int, input().split(" "))\... | ['Wrong Answer', 'Accepted'] | ['s410007975', 's072215498'] | [6104.0, 6100.0] | [877.0, 859.0] | [267, 264] |
p03087 | u095094246 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["n,q=map(int,input().split())\ns=list(input())\nac=[0]*n\nfor i in range(1,n):\n ac[i]=ac[i-1]\n if s[i-1]+s[i]=='AC':\n ac[i]+=1\nprint(*ac)\nfor _ in range(q):\n l,r=map(int,input().split())\n print(ac[r-1]-ac[l-1])", "n,q=map(int,input().split())\ns=list(input())\nac=[0]*n\nfor i in range(1,n):\n ac[i]=ac[i... | ['Wrong Answer', 'Accepted'] | ['s802237857', 's529272470'] | [13076.0, 12284.0] | [500.0, 491.0] | [213, 214] |
p03087 | u099643902 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["N, Q = map(int, input().split())\nS = input()\nnumlist = []\nfor i in range(N-1):\n if S[i:i+2] == 'AC':\n numlist.append(i)\n\nl = [0 for i in range(Q)]\nr = [0 for i in range(Q)]\nfor i in range(Q):\n ll, rr = map(int, input().split())\n l[i], r[i] = ll-1, rr-1\n\nfor i in range(Q):\n hajime = bi... | ['Runtime Error', 'Accepted'] | ['s534382641', 's670321125'] | [13088.0, 15500.0] | [352.0, 556.0] | [409, 423] |
p03087 | u101574948 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["n, q=map(int,input().split())\nstr=input() \nq_list=[input().split() for _ in range(q)] \npattern='AC'\n\n\ncount_ac=[0 for i in range(len(str))]\ncount=0\nfor i in range(len(count_ac)-1):\n if str[i]=='A' and str[i+1]=='C':\n count+=1\n count_ac[i]=count\n else:\n count_ac[i]=count\ncount... | ['Wrong Answer', 'Accepted'] | ['s156787095', 's905636759'] | [36796.0, 35536.0] | [396.0, 381.0] | [625, 609] |
p03087 | u102126195 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['N, Q = map(int, input().split())\nS = list(input())\n\ncountlist = [0 for i in range(N)]\nfor i in range(1, N):\n #print(S[i - 1:i + 1])\n countlist[i] = countlist[i - 1]\n if S[i - 1:i + 1] == ["A", "C"]:\n countlist[i] += 1\n\n\nfor i in range(Q):\n #print(i)\n l, r = map(int, input().split())... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s487032987', 's719885622', 's029627065'] | [6832.0, 6832.0, 6832.0] | [2104.0, 920.0, 1964.0] | [518, 498, 562] |
p03087 | u103208639 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['n,q=map(int,input().split())\ns=list(input())\nprint(s)\nt=[0]*n\nfor i in range(n-1):\n if s[i]+s[i+1]=="AC":\n t[i]=1\nfor i in range(q):\n l,r=map(int,input().split())\n print(sum(t[l-1:r-1]))', 'import numpy as np\nn,q=map(int,input().split())\ns=list(input())\nt=np.zeros(n+1,dtype=int)\nfor i in ... | ['Wrong Answer', 'Accepted'] | ['s062855251', 's720700914'] | [6620.0, 20840.0] | [2108.0, 1767.0] | [202, 243] |
p03087 | u103902792 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["n,q = map(int,input().split())\ns= input()\nans = [int(s[i:i+2]=='AC') for i in range(n)]\nfrom itertools import accumulate\nans = list(accumulate(ans))\nfor _ in range(q):\n l,r = map(int,input().split())\n print(ans[r]-ans[l])", "n,q = map(int,input().split())\ns= input()\nans = [int(s[i:i+2]=='AC') for i in rang... | ['Runtime Error', 'Accepted'] | ['s872701256', 's724872670'] | [7960.0, 8556.0] | [110.0, 879.0] | [223, 245] |
p03087 | u106181248 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['n, q = map(int,input().split())\ns = list(input())\nlr = [list(map(int,input().split())) for i in range(q)]\n\nfor i in range(n-1):\n if s[i] == "A" and s[i+1] == "C":\n s[i] = "*"\nprint(s)\nfor i in range(q):\n ans = 0\n l = lr[i][0]\n r = lr[i][1]\n a = s[l-1:r-1]\n print(s[l-1:r-1].count(... | ['Wrong Answer', 'Accepted'] | ['s337693609', 's948188105'] | [31100.0, 31344.0] | [2106.0, 457.0] | [311, 286] |
p03087 | u106797249 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['def resolve():\n (N, Q) = list(map(int, input().split(" ")))\n S = input()\n LRs = [list(map(int, input().split(" "))) for i in range(Q)]\n mem = [S[i:i+2] == "AC" for i in range(len(S)-1)]\n print(mem)\n for (l, r) in LRs:\n print(mem[l-1:r-1].count(True))\n\nif \'__main__\' == __name__:\n ... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s518913594', 's886728441', 's947301015', 's197056579'] | [31784.0, 28836.0, 31800.0, 30640.0] | [2105.0, 352.0, 448.0, 442.0] | [317, 296, 420, 405] |
p03087 | u111652094 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['\nN, Q = map(int,input().split())\nS = input()\nL = []\nans = 0\n\nfor i in range(Q):\n ans = 0\n L.append(list(map(int,input().split())))\n for j in range(L[i][0],L[i][1]-1):\n if S[j] == "A":\n if S[j+1] == "C":\n ans += 1\n print(ans)', "N,Q = map(int,input().split())\n... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s731513014', 's850552589', 's970272167', 's737090226'] | [3316.0, 5224.0, 5224.0, 5784.0] | [2104.0, 42.0, 2104.0, 1051.0] | [269, 272, 234, 328] |
p03087 | u112766430 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["N,Q = list(map(int,input().split()))\nS = input()\nfor i in range(Q):\n\tf,t = list(map(int,input().split()))\n\tf -= 1\n\tprint(S[f:t-f].count('AC'))\n", "N,Q = list(map(int,input().split()))\nS = input()\nsums = [0]\nfor i in range(len(S)):\n\tif i == 0:\n\t\tcontinue\n\tsums.append(sums[i-1])\n\tif S[i-1]+S[i] == ... | ['Wrong Answer', 'Accepted'] | ['s574968280', 's791370637'] | [3444.0, 6220.0] | [2104.0, 939.0] | [143, 256] |
p03087 | u113003638 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['n,q = map(int,input().split())\ns = input()\nb = []\nfor i in range(q):\n a = list(map(int,input().split()))\n b.append(str(s[a[0]-1:a[1]].count("AC")))\n b.append("\\n")\nprint("".join(b))', 'N,Q=map(int,input().split())\nS=input()\ncount=[0]*N\nfor i in range(1,N):\n count[i]+=count[i-1]\n if S[i-1:i... | ['Time Limit Exceeded', 'Accepted'] | ['s379422158', 's674523330'] | [7108.0, 7700.0] | [2104.0, 864.0] | [190, 217] |
p03087 | u114641312 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['N,Q = map(int,input().split())\nS = input()\n\nS = "AC"*(10**5//2)\nansLis = [0]\nline = ""\nfor i in range(N):\n line += S[i]\n ansLis.append(line.count("AC"))\n# print(ansLis)\n\nans = []\nfor _ in range(Q):\n l,r = map(int,input().split())\n num = ansLis[r] - ansLis[l]\n # if S[l-2] == "A" and S[l-1... | ['Wrong Answer', 'Accepted'] | ['s884520722', 's559458590'] | [5164.0, 11820.0] | [2104.0, 387.0] | [384, 414] |
p03087 | u114920558 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["N, Q = map(int, input().split())\nS = input()\nl = list()\ncnt = [0] * N\nfor i in range(Q):\n x = list(map(int, input().split()))\n l.append(x)\n print(l)\nfor i in range(1, N):\n if(S[i-1] == 'A' and S[i] == 'C'):\n cnt[i] = cnt[i-1] + 1\n else:\n cnt[i] = cnt[i-1]\nprint(cnt)\nfor i in range(Q):\n if(l... | ['Wrong Answer', 'Accepted'] | ['s783075835', 's924154355'] | [82804.0, 6060.0] | [2108.0, 853.0] | [391, 265] |
p03087 | u116038906 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['\nimport sys\ninput = sys.stdin.readline\nN,Q = (int(x) for x in input().split())\nS =input().strip()\nl =[]\nr =[]\nfor i in range(Q):\n l1,r1 = (int(x) for x in input().split())\n l.append(l1 -1) \n r.append(r1 -1) \n\n\nimport re\nimport numpy as np\nindex =0\nt =[0]*N\n\nfor i in range(N-1):\n t[i+1] ... | ['Wrong Answer', 'Accepted'] | ['s292695203', 's417968854'] | [26856.0, 20616.0] | [523.0, 506.0] | [530, 467] |
p03087 | u116233709 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['n,q=map(int,input().split())\ns=list(str(input()))\nl=[]\nr=[]\nans=0\nx=[]\nfor i in range(q):\n l1,r1=map(int,input().split())\n l.append(l1)\n r.append(r1)\n\nfor j in range(0,n):\n if s[j]=="A" and s[j+1]=="C":\n ans+=1\n x.append(ans)\n \nfor k in range(0,q):\n print(x[r[k]-1]-x[l[k]-1])\n \... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s296637628', 's312361913', 's530686381', 's675928969', 's978151703', 's044326300'] | [13784.0, 3956.0, 13788.0, 3064.0, 11840.0, 14924.0] | [321.0, 19.0, 324.0, 17.0, 2104.0, 422.0] | [326, 380, 322, 380, 369, 349] |
p03087 | u118211443 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['N, Q = map(int, input().split())\nS = input()\na = []\nan = [0] * (N + 1)\n\nfor i in range(Q):\n a.append(list(map(int, input().split())))\n\nfor i in range(len(S)):\n an[i+1]=an[i]\n if S[i:i + 2] == "AC":\n an[i+1] += 1\nprint(an)\n\nfor i in range(Q):\n print(an[a[i][1]-1] - an[a[i][0] - 1])\n'... | ['Wrong Answer', 'Accepted'] | ['s140771456', 's770694416'] | [31716.0, 30712.0] | [514.0, 536.0] | [301, 302] |
p03087 | u120691615 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['N,Q = map(int,input().split())\ns = input()\nt = [0]\nans = []\nfor i in range(N):\n if s[i:i+2] == "AC":\n t.append(t[i] + 1)\n else:\n t.append(t[i])\nprint(t)\nfor i in range(Q):\n l,r = map(int,input().split())\n ans.append(t[r-1]-t[l-1])\nfor i in ans:\n print(i)', 'N,Q = map(int,inp... | ['Wrong Answer', 'Accepted'] | ['s743762792', 's018484095'] | [10928.0, 6176.0] | [414.0, 865.0] | [283, 233] |
p03087 | u123745130 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['n,m=map(int,input().split()) \nq=input() \nl=[list(map(int,input().split())) for _ in range(m)] \nprint(n,m,q,l) \nans=0 \nlst_j=[0]*(n+1) \nfor i in range(n-1): \n\tcnt=0 \n\tif q[i]+q[i+1]=="AC": \n\t\tcnt=1 \n\t\tlst_j[i+1]=cnt+lst_j[i] \n\telse:lst_j[i+1]=lst_j[i] \nfor i,j in l: \n\tans=lst_j[j-1]-lst_j[i-1] \n\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s776992590', 's807798500', 's696953056'] | [32320.0, 32736.0, 30664.0] | [514.0, 2105.0, 510.0] | [307, 282, 291] |
p03087 | u124212130 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['import copy\n\nN, Q = map(int, input().split())\nS = int(input())\nfor i in range(Q):\n l ,r = map(int, input().split())\n SS = copy.copy(S)\n SS[l:r]\n ANS = 0\n for j in range(len(SS)):\n if SS[j] == "A" and SS[j+1] == "C":\n ANS += 1\n \n print(ANS)\n\n\n\n', 'import copy\n\n... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s135270722', 's246838493', 's257949147', 's406259358', 's667073472', 's348527675'] | [9344.0, 107044.0, 9428.0, 13136.0, 10008.0, 13352.0] | [29.0, 2356.0, 2206.0, 63.0, 2206.0, 484.0] | [282, 367, 277, 222, 326, 226] |
p03087 | u124498235 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['n, q = map(int, input().split())\ns = input()\nb = [0] * n\ncnt = 0\nfor i in range(n-1):\n\tif s[i:i+2] == "AC":\n\t\tcnt += 1\n\tb[i+1] = cnt\nprint (b)\nfor i in range(q):\n\tl, r = map(int, input().split())\n\ta = b[r-1] - b[l-1]\n\tprint (a)', 'n, q = map(int, input().split())\ns = input()\nb = [0] * n\ncnt = 0\... | ['Wrong Answer', 'Accepted'] | ['s194815090', 's482926309'] | [7464.0, 7980.0] | [889.0, 879.0] | [227, 217] |
p03087 | u126232616 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['N,Q = map(int, input().split())\nS = input()\n\nt = [0] * (N+1)\nfor i in range(N):\n t[i+1] = t[i] + (1 if t[i:i+2] == "AC" else 0)\nfor i in range(Q):\n l,r = map(int, input().split())\n print(t[r-1] - t[l-1])', 'N,Q = map(int, input().split())\nS = input()\n\nt = [0] * (N+1)\nfor i in range(N):\n t[i] ... | ['Wrong Answer', 'Accepted'] | ['s888874523', 's530262822'] | [4212.0, 7668.0] | [858.0, 873.0] | [212, 212] |
p03087 | u128196936 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['from bisect import bisect, bisect_left\nN, Q = map(input().split(), int)\nS = input()\nac = []\nfor i in range(N-1):\n if S[i:i+1] == "AC":\n ac.append(i)\nfor i in range(Q):\n l, r = map(input().split(), int)\n l -= 1\n r -= 1\n print(bisect_right(ac, r-1) - bisect_left(ac, l))\n ', 'from bisect import bise... | ['Runtime Error', 'Accepted'] | ['s620068046', 's230735936'] | [3060.0, 5852.0] | [17.0, 1036.0] | [279, 285] |
p03087 | u129315407 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['import bisect\n\nN, Q = map(int, input().split())\nS = input()\nQi = []\nfor i in range(Q):\n a = list(map(int, input().split()))\n Qi.append(a)\n\nindex_list = []\nidx = 0\nwhile idx < len(S):\n i2 = S.find("AC", idx)\n if i2 < 0:\n break\n index_list.append(i2)\n idx = i2 + 2\n\nfor q in Qi... | ['Wrong Answer', 'Accepted'] | ['s793900901', 's154023780'] | [31452.0, 30292.0] | [721.0, 613.0] | [508, 495] |
p03087 | u133347536 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['nq = input().split()\nn, q = int(nq[0]), int(nq[1])\ns = list(input())\nr_li = []\nl_li = []\nt_li = []\nfor i in range(q):\n rl = input().split()\n l_li.append(int(rl[0]))\n r_li.append(int(rl[1]))\ncount = 0\ni = 0\nwhile True:\n if i == n:\n break\n else:\n if s[i] == "A":\n ... | ['Runtime Error', 'Accepted'] | ['s642391555', 's039005901'] | [3064.0, 14884.0] | [17.0, 396.0] | [787, 785] |
p03087 | u133936772 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["f = lambda : map(int,input().split())\nn, q = f()\ns = input()\n\ncnt = 0\nln = [0]*n\nfor i in range(1,n):\n if s[i-1:i+1] == 'AC':\n cnt += 1\n ln[i] = cnt\nprint(ln)\nfor _ in range(q):\n l, r = f()\n print(ln[r-1]-ln[l-1])", "f = lambda:map(int,input().split())\nn,q = f()\ns = input()\nln = [0]\nfor i in r... | ['Wrong Answer', 'Accepted'] | ['s985042691', 's170074093'] | [7568.0, 7768.0] | [886.0, 892.0] | [220, 175] |
p03087 | u134789640 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ["N,Q = map(int,input().split())\nS = input()\n\nlr = [list(map(int,input().split())) for _ in range(Q)]\n\n#print(N,Q,S)\n#print(lr)\n\n#print(S[0:5])\n\nfor _ in range(Q):\n l = lr[_][0]\n r = lr[_][1]\n #print(_,S[0:r],S[0:(l-1)])\n #print(S[0:r].count('AC')-S[0:l].count('AC'))\n #print(_,S[l:r])\n ... | ['Wrong Answer', 'Accepted'] | ['s602206612', 's094298909'] | [30188.0, 30672.0] | [2105.0, 486.0] | [333, 591] |
p03087 | u135116520 | 2,000 | 1,048,576 | You are given a string S of length N consisting of `A`, `C`, `G` and `T`. Answer the following Q queries: * Query i (1 \leq i \leq Q): You will be given integers l_i and r_i (1 \leq l_i < r_i \leq N). Consider the substring of S starting at index l_i and ending at index r_i (both inclusive). In this string, how many... | ['N,Q=map(int,input().split())\nS=input()\nA=[0]*N+1\nfor i in range(N):\n t[i+1]=t[i]+(1 if S[i:i+2]=="AC" else 0)\nfor i in range(Q):\n l,r=map(int,input().split())\n print(t[r-1]-t[l-1])', "N,Q=map(int,input().split())\nS=input()\nl,r=list(map(int,input().split())) for i in range(Q)\ndef main():\n for i in range... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s072683082', 's160799639', 's249884603', 's273346805', 's313718008', 's401054104', 's416348292', 's500384232', 's648535747', 's714852540', 's835159018', 's959094199', 's271868250'] | [3956.0, 2940.0, 2940.0, 3188.0, 11832.0, 11744.0, 3956.0, 3444.0, 3188.0, 48908.0, 2940.0, 3444.0, 7748.0] | [18.0, 17.0, 17.0, 314.0, 2104.0, 2104.0, 18.0, 2104.0, 18.0, 328.0, 17.0, 2104.0, 861.0] | [183, 186, 181, 150, 227, 180, 183, 135, 154, 141, 151, 166, 185] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.