Problem:


Score : 100 points

Problem Statement

On the Planet AtCoder, there are four types of bases: A, C, G and T. A bonds with T, and C bonds with G.

You are given a letter b as input, which is A, C, G or T. Write a program that prints the letter representing the base that bonds with the base b.

Constraints

b is one of the letters A, C, G and T.

Input

Input is given from Standard Input in the following format:

b

Output

Print the letter representing the base that bonds with the base b.

Sample Input 1

A

Sample Output 1

T

Sample Input 2

G

Sample Output 2

C



Sample input:
A


Sample output:
T

Submission status: Runtime Error

Solution code:
# AGCT -> 0123
# 条件
# # 文字 0-3のみ
# # 文字 0-2を含まない
# # 隣同士swapしても0-2を含まない
# 012, 102, 021, 0?12, 01?2が含まずに条件を満たす文字列 Sの数を求める

# S + 0
# S + 1 -> 021の可能性
# S + 2 -> 0?12, 01?2の可能性
# S + 3
# Sの手前3文字を見れば良い -> DP
# # DP: 動的計画法, 計算をまとめるだけのテクニック
# # 文字数, 最後から3文字目, 2文字目, 1文字目の情報をもつDP

# ACが来たらカウントする

import numpy as np

N = int(input())

mod = 10 ** 9 + 7
# メモ化: [{}, {}, {}, {}]
memo = np.zeros((N + 1, 4, 4, 4))
memo[0][3][3][3] = 1

# 文字列の文字数
for c in range(N):
    # 最後から1文字目の文字
    for i in range(4):
        # 最後から2文字目の文字
        for j in range(4):
            # 最後から3文字目の文字
            for k in range(4):
                # 新しく追加する文字
                for a in range(4):
                    # ダメな5つの条件をカットする
                    # 012, 102, 021, 0?12, 01?2
                    if a == 1 and i == 2 and j == 0:
                        continue
                    if a == 2 and i == 1 and j == 0:
                        continue
                    if a == 2 and i == 0 and j == 1:
                        continue
                    if a == 2 and j == 1 and k == 0:
                        continue
                    if a == 2 and i == 1 and k == 0:
                        continue
                    # ダメな条件を抜けたら，aを足した文字列を作れる
                    memo[c + 1][a][i][j] += memo[c][i][j][k]
                    memo[c + 1][a][i][j] %= mod

# 長さNの全部の答えをまとめる処理
ans = 0
# 最後から1文字目の文字
for i in range(4):
    # 最後から2文字目の文字
    for j in range(4):
        # 最後から3文字目の文字
        for k in range(4):
            ans += memo[N][i][j][k]
            ans %= mod
print(int(ans))

Submission status: Runtime Error

Solution code:
b=input()
if b=='A':
    print('T')
elif b=='T'
    print('A')
elif b=='C'
    print('G')
else:
    print('C')

Submission status: Runtime Error

Solution code:
a=atr(input())

if a=="A":
    print("T")
if a=="T":
    print("A")
if a=="G":
    print("C")
if a=="C":
    print("G")

Submission status: Runtime Error

Solution code:
from functools import lru_cache
MOD = 1000000007

def valid(s):
    f = 0
    if len(s) == 4:
        f = 1
        if (s[0] == 'A' and s[2:] == 'GC') or (s[0:2] == 'AG' and s[3] == 'C'):
            return 0
    return s[f:] != 'AGC' and s[f:] != 'ACG' and s[f:] != 'GAC'
    

@lru_cache(maxsize=None)
def dfs(n, s):
    if not valid(s):
        return 0

    if n == N:
        return 1

    f = len(s) == 4
    a = dfs(n+1, s[f:] + 'A')
    b = dfs(n+1, s[f:] + 'C')
    c = dfs(n+1, s[f:] + 'G')
    d = dfs(n+1, s[f:] + 'T')
    return (a + b + c + d) % MOD
    

N = int(input())
ans = dfs(0, '')
print(ans)

Submission status: Runtime Error

Solution code:
input("ATCG"["TAGC".find(input())])

Submission status: Runtime Error

Solution code:
#abc122a

b=raw_input()
if b=='A':
 print 'T'
elif b=='C':
 print 'G'
elif b=='G':
 print 'C'
elif:
 print 'A'

Submission status: Runtime Error

Solution code:
b=input()
if b =="A"
  print("T")
elif b =="T"
  print("A")
elif b =="G"
  print("C")
elif b =="C"
  print("G")

Submission status: Runtime Error

Solution code:
X = input()

if (X == “A”):
    print(“T”)
elif (X ==“T”):
    print(“A”)
elif (X == “G”):
    print(“C”)
else:
    print(“G”)

Submission status: Runtime Error

Solution code:
N,Q=map(int,input().split())
S=input()
t=[0]*N
for i in range(N-1):
    t[i+1]=t[i]+(1 if S[i:i+2]=='AC' else 0)
for i in range(Q):
    l,r=map(int,input().split())
    print(t[r-1]-t[l-1])

Submission status: Runtime Error

Solution code:
N = int(input())
memo = [{} for _ in range(N + 1)]

def ok(last4):
  for i in range(4):
    s = list(last4)
    if i >= 1:
      s[i - 1]. s[i] = s[i], s[i - 1]
    if "".join(s).count("AGC") >= 1:
      return False
    return True

def dfs(last3, n):
  if last3 in memo[n]:
    return memo[n][last3]
  if n == N:
    return 1
  ret = 0
  for c in "AGCT":
    if ok(last3 + c):
      ret += dfs(last3[1:] + c, n + 1) % (10 ** 9 + 7)
  memo[n][last3] = ret
  return ret

print(dfs("TTT", 0))

Submission status: Runtime Error

Solution code:
b = input()
	c = {'A':'T','T':'A','G':'C','C':'G'}
  	print(c[b])

Submission status: Runtime Error

Solution code:
b = input()
	c = {'A':'T','T':'A','G':'C','C':'G'}
  	print(b[c])

Submission status: Runtime Error

Solution code:
 b = input()
 c = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}
 print(c[b])

Submission status: Runtime Error

Solution code:
b = input()
	c = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}
	print(c[b])

Submission status: Runtime Error

Solution code:
b = input()
  c = {'A':'T','T':'A','G':'C','C':'G'}
print(c[b])

Submission status: Runtime Error

Solution code:

N, Q = map(int, input().split())
S = list(input())

AClist = [0]
counter = 0

i=0
while i+1 < N:
    if S[i:i+2] == "AC":
        counter+=1

    AClist.append(counter)
    i+=1


while Q > 0:
    l, r = input().split()
    r = int(r) 
    l = int(l)

    print(AClist[r-1]-AClist[l-1])

    Q -= 1

Submission status: Runtime Error

Solution code:
print(s[3-'AGCT'.index(input())])

Submission status: Runtime Error

Solution code:
N, Q = [int(x) for x in input().split(" ")]
S = input()
LR = [[int(x) for x in input().split(" ")] for _ in range(Q)]

print('\n'.join([str(S[l-1:r].count('AC')) for l, r in LR]))

Submission status: Runtime Error

Solution code:
in = input()

if in == "T":
  return "A"
if in == "A":
  return "T"
if in == "C":
  return "G"
if in == "G":
  return "C"

Submission status: Runtime Error

Solution code:
if b =='A':
    print('T')
elif b =='T':
  print('A')
elif b =='G':
  print('C')
else:
  print('G')

Submission status: Runtime Error

Solution code:
inverse = ['A': 'T', 'T': 'A', 'G': 'C', 'C': 'G']
print(inverse[input()])

Submission status: Runtime Error

Solution code:
n = int(input())
mod = 10**9+7
a = [1]*16
no = [0,0]
for _ in range(n-2):
  b = [0]*16
  b[0] = a[0] + a[4] + a[8] + a[12]
  b[1] = a[0] + a[4] + a[12]
  b[2] = a[0] + a[4] + a[8] + a[12]
  b[3] = a[0] + a[4] + a[8] + a[12]
  b[4] = a[1] + a[5] + a[9] + a[13]
  b[5] = a[1] + a[5] + a[9] + a[13]
  b[6] = a[5] + a[9] + a[13]
  b[7] = a[1] + a[5] + a[9] + a[13]
  b[8] = a[2] + a[6] + a[9] + a[14]
  b[9] = a[6] + a[9] + a[14] - no[0] - no[1]
  b[10] = a[2] + a[6] + a[9] + a[14]
  b[11] = a[2] + a[6] + a[9] + a[14]
  b[12] = a[3] + a[7] + a[10] + a[15]
  b[13] = a[3] + a[7] + a[10] + a[15] - no[1]
  b[14] = a[3] + a[7] + a[10] + a[15]
  b[15] = a[3] + a[7] + a[10] + a[15]
  no[0] = a[2]
  no[1] = a[3]
  a = b
  for i in range(16):
    a[i] %= mod
print(sum(a))

Submission status: Runtime Error

Solution code:
if  b=='A':
    print('T')
elif b =='T':
   print('A')
elif b=='G':
   print('C')
else:
   print('G')

Submission status: Runtime Error

Solution code:
N, Q = map(int, input().split())
2 S = input()
3 t = [0] * (N + 1)
4 for i in range(N):
5 t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
6 for i in range(Q):
7 l, r = map(int, input().split())
8 print(t[r-1] - t[l-1])

Submission status: Runtime Error

Solution code:
x = input()
y = x.split()
y = [int (i) for i in y]
haha = input()

result   = 0
num    = y[1]
count = 0
length = y[0]
arr    = [0] * (length + 1)
arr[0] = 0

for i in range(length-1):
    if haha[i] == "A" and haha[i+1] == "C":
        arr[i+1] = count

        count +=1
    else:
        arr[i+1] = arr[i]

for i in range(num):
    hoho = input()
    xd = hoho.split()
    xd = [int (i) for i in xd]
    lqq = xd[0]
    rqq = xd[1]
    result = arr[rqq-1] - arr[lqq-1]

    print(result)

    result = 0

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
# template


N, Q = mi()
S = li()
Alist = []
l = [0] * Q
r = [0] * Q
for i in range(Q):
    l[i], r[i] = mi()
for i in range(N - 1):
    if S[i] == 'A' and S[i + 1] == 'C':
        Alist.append(i)
AClist = [0]*(N+1)
for i in range(N - 1):
    if i in Alist:
        AClist[i + 2] = AClist[i+1] + 1
    else:
        AClist[i+2] = AClist[i+1]

# print(AClist)

for i in range(Q):
    if AClist[l[i] - 1] != AClist[l[i]]:
        print(AClist[r[i]] - AClist[l[i]])
    else:
        print(AClist[r[i]] - AClist[l[i]-1])

Submission status: Runtime Error

Solution code:
N, Q = map(int, input().split())
S = input()
output = []
for i in range(Q):
	l, r = map(int, input().split())
	Slr = S[l - 1:r]
	output.append(Slr.count('AC'))
for i in output:
	print(i)

Submission status: Runtime Error

Solution code:
N, Q = map(int, input().split())
S = input()
output = []
for i in range(Q):
	l, r = map(int, input().split())
	Slr = S[l - 1:r]
	output.append(Slr[l - 1:r].count('AC'))
for i in output:
	print(i)

Submission status: Runtime Error

Solution code:
N = int(input())

print(3 * (4 **(N-3) ) * (N-2))

Submission status: Runtime Error

Solution code:
N,Q=map(int,input().split())
S=input()
l,r=[],[]
for i in range(Q):
    l0,r0=map(int,input().split())
    l.append(l0)
    r.append(r0)
c={}
for i in range(Q):
    for i in range(l[i]-1,r[i]-1):
        if (S[i]=='A') and (S[i+1]=='C'):
            c[i]=1
    print(int(c.count(1)))

Submission status: Runtime Error

Solution code:
import math

def nCm(n,m):
    return math.factorial(n) / (math.factorial(m)*(math.facorial(n-m)))

n = int(input())
kinds = 4**n
a = 7 + 10**9
answer = 0
q = 0
r = 0

p = 3 * nCm(n-2, 1)
if n > 6:
    q = 3 * nCm(n-4, 2)
if n > 9:    
    r = nCm(n-6, 3)

answer = (kinds - p + q -r) % a

print(int(answer))

Submission status: Runtime Error

Solution code:
n, q = input().split()
Q = int(q)
s = input()
S = list(s)

array = []
count = 0
ff = False
for i in range(len(S)):
    if len(S) < i+1:
        break
    if S[i] == 'A':
        flag = True
    elif flag == True and S[i] == 'C':
        count += 1
        array.append(-1)
        array.append(count)
        ff = True
    elif flag == True:
        array.append(0)
        array.append(0)
        flag = False
    else:
        array.append(0)

array_q = []
for q in range(Q):
    l, r = input().split()
    array_q.append([int(l), int(r)])

for arr in array_q:
    try:
        if ff != True:
            print(0)
            continue

        if len(array[arr[0]-1:arr[1]-1]) < 2:
            print(0)
            continue

        for a in array[arr[0]-1:]:
            if a == -1:
                flag = True
            elif flag == True:
                minv = a
                break

        for b in reversed(array[:arr[1]]):
            if b != 0 and b != -1:
                maxv = b
                break

        if minv == maxv and maxv != 0:
            print(1)
            
        elif maxv == 0:
            print(0)

        else:
            print(maxv - minv + 1)
            maxv = 0
            minv = 0
    except:
        print(0)

Submission status: Runtime Error

Solution code:
import re
N, Q = map(int, input().split())
S = input()
l = []
r = []
for i in range(Q):
    li, ri = map(int, input().split())
    l += [li]
    r += [ri]

for ind in range(Q):
    substr = S[max(0, l[ind]-1) : min(r[ind], N)]
    #print(substr.count("AC"))
    print(len(re.findall("AC", S)))

Submission status: Runtime Error

Solution code:
N,Q=map(int,input().split())
S=input()
ls=[];rs=[]
for i in range(Q):
    l,r=map(int,input().split())
    n=0;a=False
    for k in S[(l-1):(r)]:
        if k!="A" and a==False:
            pass
        elif k=="A":
            a=True
        elif a:
            if k=="C":
                n+=1
            else:
                a=False
    print(n)

Submission status: Runtime Error

Solution code:
N,Q=map(int,input().split())
S=input()
ls=[];rs=[]
for i in range(Q):
    l,r=map(int,input().split())
    n=0;a=False
    for k in S[(l-1):(r)]:
        if k!="A" and a==False:
            pass
        elif k=="A":
            a=True
        elif a:
            if k=="C":
                n+=1
            else:
                a=False
    print(n)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
NQ = input().split(" ")
S = str(input())
N = int(NQ[0])
Q = int(NQ[1])
result_list = []
l = 0
r = 0
lr = ""
for i in range(0, Q):
  lr = input().split(" ")
  l = int(lr[0])
  r = int(lr[1])
  subStr_S = str(S[l-1:r]).replace("G", "").replace("T", "")
  result_list.append(subStr_S.count("AC"))

[print(result) for result in result_list]

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define is(a, b) a == b
#define len(v) ll(v.size())

class UnionFind {
public:
	vector<int> par;//親の番号
    vector<int> rank;//木の深さ
 
	UnionFind(int n){//全ての要素に対して自身が根となるように初期化, 木の深さは0になる
		rep(i,n){
            par.push_back(i);
            rank.push_back(0);
        }
	}
 
	int find(int x) {//木の根を求める
		if(par[x]==x){
            return x;
        }else{
            return par[x]=find(par[x]);
        }
	}
 
	void unite(int x,int y){//xとyの属する集合を併合
        x=find(x);
        y=find(y);
        if(x==y) return;
        if(rank[x]<rank[y]){//木の深さが小さい方を大きい方へ繋げる
            par[x]=y;
        }else{
            par[y]=x;
            if(rank[x]==rank[y]) rank[x]++;
        }
    }

    bool same(int x,int y){//xとyが同じ集合に属するか否か
        return find(x)==find(y);
    }
};
//x以下の要素への最小index, ソートしてから使ってね
template <class T> 
int former(const vector<T> &v, T x){
  return upper_bound(v.begin(), v.end(), x) - v.begin() - 1;
}
//x以上の要素への最小index
template <class T> 
int latter(const vector<T> &v, T x){
  return lower_bound(v.begin(), v.end(), x) - v.begin();
}
//vector書き出し
template <class T>
void cout_vec(const vector<T> &vec1){
  rep(i,len(vec1)){
    cout<<vec1[i]<<' ';
  }
  cout<<'\n';
}
//nCk
template <class T>
T comb(T n,T k){
    T ans=1;
    FOR(i,n-k+1,n+1){
        ans*=i;
    }
    FOR(i,1,k+1){
        ans/=i;
    }
    return ans;
}
//a,bの最大公約数
template <class T>
T gcd(T a,T b) {
	if (b == 0) return a;
	else return gcd(b, a % b);
}
//素因数分解
template <class T>
map<T,T> prime_factor(T x){
    map<T,T> ans;
    for(T i=2;i*i<=x;i++){
        while(x%i==0){
            x/=i;
            ans[i]++;
        }
    }
    if (x!=1){
        ans[x]=1;
    }
    return ans;
}
//約数列挙
template <class T>
vector<T> divisor(T x){
    vector<T> res;
    for(T i=1;i*i<=x;i++){
        if(x%i==0){
            res.push_back(i);
            if(i!=x/i){
                res.push_back(x/i);
            }
        }
    }
    return res;
}
//素数判定
template <class T>
bool is_prime(T x){
    for(T i=2;i*i<=x;i++){
        if(x%i==0){
            return false;
        }
    }
    return x!=1;
}

const ll inf=1e9+7;

ll mult(ll n,ll m){//n^m%infを求める
    if(m==1){
        return n%inf;
    }else if(m%2==0){//オーバーフロー防止のためにn^(m/2)*n^(m/2)を考える
        ll t=mult(n,m/2);
        return (t*t)%inf;
    }else{//奇数の時はn^(m-1)*nを考える
        ll t=mult(n,m-1);
        return (t*n)%inf;
    }
}

typedef pair<int,int> P;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin>>s;
    string ans(s);
    rep(i,len(s)){
        if(s[i]=='A'){
            ans[i]='T';
        }else if(s[i]=='T'){
            ans[i]='A';
        }else if(s[i]=='C'){
            ans[i]='G';
        }else{
            ans[i]='C';
        }
    }
    for(auto itr:ans){
        cout<<itr<<endl;
    }
}

Submission status: Runtime Error

Solution code:
import re

N, S = map(int, input().split(' '))
pattern = "AC+"
T = input()
for _ in range(S):
    fir,fin = map(int, input().split(' '))
    result = re.findall(pattern, T[fir -1:fin])
    print(len(result))

Submission status: Runtime Error

Solution code:
# coding: utf-8
length,question = map(int, input().split())
string = input()
e = [[int(i) for i in input().split()] for i in range(question)]
c = 0
tmp = []

for i in e:
    s = ''
    for j in range(i[0],i[1]+1):
        s+=string[j-1]
    
    for n in range(len(s)):
        if s[n:n+2] == "AC":
            c+=1

    print(c)
    c = 0

Submission status: Runtime Error

Solution code:
X = input()

if (X == A):
    print(“T”)
elif (X ==T):
    print(“A”)
elif (X == G):
    print(“C”)
else:
    print(“G”)

Submission status: Runtime Error

Solution code:
b = input().strip()
if b == 'A':
  pirnt('T')
if b == 'T':
  print('A')
if b == 'G':
  print('C')
if b == 'C':
  print('G')

Submission status: Runtime Error

Solution code:
n, q = map(int, input().split())
s = list(input())

for i in range(q):
    count = 0
    l, r = map(int, input().split())
    # ss = s[l:r]
    for j in range(l-1,r):
        if s[j] == 'A':
            if j+1 < r:
                if s[j+1] == 'C':
                    count += 1
                j += 1
    print(count)

Submission status: Runtime Error

Solution code:
import re

N, S = map(int, input().split(' '))
pattern = "AC+"
T = input()
for _ in range(S):
    first,final = map(int, input().split(' '))
    print(first, final)
    result = re.findall(pattern, T[first -1:final])
    print(result)
    print(len(result))

Submission status: Runtime Error

Solution code:
a = input()
if a = A :
	print('T')
elif a = T :
	print('A')
elif a = C :
	print('G')
else:
	print('C')

Submission status: Runtime Error

Solution code:

int main(){
if b == A:
    print('T')
if b == T:
    print('A')
if b == G:
    print('C')
if b == C:
    print('G')

}

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
N,Q = map(int,input().split())
S = input()
p = set()
for n,i in enumerate(S[:-1]):
    if i == "A" and S[n+1]=="C":
        p.add(n)
#print(p)
for i in range(Q):
    a,b = map(int,input().split())
    #tmp = {}
    # tmp = {i for i in range(a-1,b-1)}
    # print(tmp)
    # print(len(tmp&p))
    count=0
    for j in p:
        #print("j",j)
        if a <= j+1 and j+1 < b:
            count+=1
        elif j > b:
            break
    print(count)

Submission status: Runtime Error

Solution code:
# coding: utf-8
line = input()
list = ["A","T","G","C"]
if line == list[0]:
    print(list[1])
elif line == list[1]:
    print(list[0])
elif line == list[2]:
    print(list[3])
else:
    print(list[4])

Submission status: Runtime Error

Solution code:
b = input().strip()

if b == 'A':
  return 'T'
elif b == 'T':
  return 'A'
elif b == 'C':
  return 'G'
else:
  return 'C'

Submission status: Runtime Error

Solution code:
N, Q = map(int,input().split())
S = input()
LRlist = []
for i in range(Q):
    LRlist.append(list(map(int,input().split())))
indexlist = []
for i in range(len(S)-1):
    if S[i] == 'A':
        if S[i+1] == 'C':
            indexlist.append(i)
for LR in LRlist:
    L = LR[0]
    R = LR[1]
    answer = 0
    for i in indexlist:
        if L - 1 <= i:
            if i <= R - 2:
                answer += 1
        elif R - 2 < i:
            break
    print(answer)

Submission status: Runtime Error

Solution code:
N,Q=map(int,input().split())
S=input()
word_list=list(S)
for i in range(Q):
  count=0
  flag =0
  l,r=map(int,input().split())
  box=word_list[l-1:r]
  for i in box:
    if i == 'A':
      flag =1
    elif i!= 'C':
      flag=0
    if flag == 0 and i=='C':
      flag = 0
    if flag == 1 and i =='C':
      count += 1
      flag = 0
  print(count)

Submission status: Runtime Error

Solution code:
N, Q= input().split(" ")
S = input()
index_list_all = []
for i in range(int(Q)):
    lQ, rQ = input().split(" ")
    index_list_all.append([int(lQ), int(rQ)])

for index_list in index_list_all:
    print(len(S[index_list[0] - 1: index_list[1]].split("AC")) - 1)

Submission status: Runtime Error

Solution code:
S = input()
L=len(S)
longest=0
for i in range(L):
  for j in range(i+1):
    DUP=S[j:i]
    DUP=DUP.replace("A","#")
    DUP=DUP.replace("T","#")
    DUP=DUP.replace("G","#")
    DUP=DUP.replace("C","#")
    count=0
    for a in range(len(DUP)):
      if DUP[a]=="#":
        count+=1
      else:
        break
    else:
      longest=max(longest,count)
print(longest)
S = input()
L=len(S)
longest=0
for i in range(L):
  for j in range(i+1):
    DUP=S[j:i+1]
    DUP=DUP.replace("A","#")
    DUP=DUP.replace("T","#")
    DUP=DUP.replace("G","#")
    DUP=DUP.replace("C","#")
    count=0
    for a in range(len(DUP)):
      if DUP[a]=="#":
        count+=1
      else:
        break
    else:
      longest=max(longest,count)
print(longest)

Submission status: Runtime Error

Solution code:
N,Q = map(int,input().split())
S = input()
l =[map(int,input().split()) for i in range(Q)]

for i,x in l:
    s1 = S[i-1:x]
    print(s1.count('AC'))

Submission status: Runtime Error

Solution code:
first_line = input()
N, Q = first_line.split(' ')
N = int(N) #length of the input sentence
Q = int(Q) #num of the questions

S = input() #input sentence

numbers_of_AC = []

question_atributes = []
for _ in range(Q):
    start, end = (input().split(' '))
    start = int(start)
    end = int(end)
    
    for c in S:
		if c == 'A':
			count+=1
		else:
			numbers_of_AC.append(count)
    		count = 0
	numbers_of_AC.append(count)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

import sys

def parse_input(lines_as_string = None):

    lines = []
    if lines_as_string is None:
        lines.append(input())
        tokens = lines[0].split(" ")
        n = int(tokens[0])
        q = int(tokens[1])
        lines.append(input())
        for i in range(q):
            lines.append(input())
    else:
        lines = [e for e in lines_as_string.split("\n")][1:-1]
        print("lines=%s" % lines)
        tokens = lines[0].split(" ")
        n = int(tokens[0])
        q = int(tokens[1])

    s = lines[1]

    l = []
    r = []
    for i in range(q):
        tokens = lines[i+2].split(" ")
        l.append(int(tokens[0]))
        r.append(int(tokens[1]))

    return (n, q, s, l, r)

def solve(n, q, s, l, r):

#    result = []
    for i in range(q):
        b = l[i] - 1
        e = r[i] - 1
        count = 0
        ss = s[b:e+1]
        len_ss = len(ss)
        j = 0
        while j < len_ss:
#            print("ss=%s" % ss)
            if ss[j] == "A" and j + 1 < len_ss and ss[j+1] == "C":
                count = count + 1
                j = j + 2
            else:
                j = j + 1
        print(count)
#        result.append(count)
    
#    return result

def main():
    solve(*parse_input())
#    print("%d" % solve(*parse_input()))

if __name__ == '__main__':

    main()

Submission status: Runtime Error

Solution code:
import re
N, Q = input().split()
N = int(N)
Q = int(Q)
S=str(input())

for i in range(Q):
  l, r = input().split()
  l = int(l)
  r = int(r)
  print(S.count("AC", l-1, r))

Submission status: Runtime Error

Solution code:
n, q = map(int, input().split())
s = input()
lr = [list(map(int, input().split())) for _ in range(q)]

cntli = []
for i in range(q):
    si = s[lr[i][0]-1:lr[i][1]]
    cnt = 0
    for j in range(len(si)-1):
        if si[j] == "A":
            if si[j+1] == "C":
                cnt += 1
    else:
        cntli.append(cnt)

for p in cntli:
    print(p)

Submission status: Runtime Error

Solution code:
N, M = list(map(int, input().split()))
S = input()
a = []
for i in range(M):
    a.append(list(map(int, input().split())))
for i in range(M):
  print(S[a[i][0]-1:a[i][1]].count('AC'))

Submission status: Runtime Error

Solution code:
import re
N, Q = map(int,input().split())
S = input()

for i in range(Q):
  l, r = map(int,input().split())
  Si = S[l-1:r]
  
  m = re.match('AC',Si)
  print(len(m.group())

Submission status: Runtime Error

Solution code:
# coding: utf-8

x = input()

if x == 'A':
	print('T')
elif x == 'T'
	print('A')
elif x == 'G'
	print('C')
elif x == 'C'
	print('G')

Submission status: Runtime Error

Solution code:
if b == A:
    print('T')
    if b == T:
    print('A')
    if b == G:
    print('C')
    if b == C:
    print('G')

Submission status: Runtime Error

Solution code:
b = input()
if b=='A': print("T")
elif b=='C': print("G")
else print(b)

Submission status: Runtime Error

Solution code:
S = input()

if S == 'A':
    print('T')
elif S == 'C':
    print('G')
elif S == 'G':
    print('C')
elif S == 'T'::
    print('A')

Submission status: Runtime Error

Solution code:
n, q = map(int, input().split())
s = list(input())

for i in range(q):
    count = 0
    l, r = map(int, input().split())
    for j in range(l-1,r):
        if s[j] == 'A':
            if j+1 < r:
                if s[j+1] == 'C':
                    count += 1
                j += 1
    print(count)

Submission status: Runtime Error

Solution code:
N,Q = map(int,input().split())
S = input()
c_l=[]
for i in range(Q):
    a,b = map(int,input().split())
    if b==N:
        l=S[a-1:]
    else:
        l=S[a-1:b]
    c = l.count("AC")
    c_l.append(c)
for i in c_l:
    print(i)

Submission status: Runtime Error

Solution code:
base = {'A':'A', 'C':'T', 'G':'C', 'T':'G'}

b = int(input())
print(base[b])

Submission status: Runtime Error

Solution code:
N, Q = input().split()
S = input()
for i in range(int(Q)):
    l, r = (int(x) for x in input().split())
    sub_S = S[l-1:r]
    count = 0
    print('hoge')

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
#文字列の入力
s = input()
# 出力
#box1 = ["A", "T"]
#box2 = ["G", "C"]
if s =="A":
  print("T")
elif s=="T":
  print("A")
elif S == "C":
  print("G")
elif S== "G":
  print("C")

Submission status: Runtime Error

Solution code:
N,Q = map(int,input().split())
S = input()
count_l=[]
for i in range(Q):
    a,b = map(int,input().split())
    flag=False
    counting=0
    if b==N:
        l=S[a-1:]
    else:
        l=S[a-1:b]
    #print(l)
    counting = l.count("AC")
    """for ii in l:
        #print(ii)
        if ii=="A":
            flag=True
        elif ii=="C" and flag==True:
            counting+=1
            flag=False"""
    count_l.append(counting)
for i in count_l:
    print(i)

Submission status: Runtime Error

Solution code:
m = {'A':'T', 'T':'A', 'G':'C', 'C':'G'}
print(m[input())

Submission status: Runtime Error

Solution code:
N, Q = map(int, input().split())
S = input()

AC_list = []
cnt = 0
for i in range(N):
  if i != 0 and S[i - 1] == "A" and S[i] == "C":
    cnt += 1
  AC_list.append(cnt)

for _ in range(Q):
  l, r = map(int, input().split())
  print(AC_list[r - 1] - AC_list[l - 1])

Submission status: Runtime Error

Solution code:
b = input()
if b == A:
    print(T)
elif b == C:
    print(G)
elif b == G:
    print(C)
else:
    print(A)

Submission status: Runtime Error

Solution code:
str = input()
if str == "A":
  print(T)
elif str == "T":
  print(A)
elif str == "C":
  print(G)
elif str == "G":
  print(C)

Submission status: Runtime Error

Solution code:
str = input()
if str = "A":
  print("T")
elif str = "T":
  print("A")
elif str = "C":
  print("G")
elif str = "G":
  print("C")

Submission status: Runtime Error

Solution code:
b = input('')
if b = 'A':
    print('T')
elif b = 'C':
    print('G')
elif b = 'G':
    print('C')
else:
    print('A')

Submission status: Runtime Error

Solution code:
str = input()
if str = "A":
  print(T)
elif str = "T":
  print(A)
elif str = "C":
  print(G)
elif str = "G":
  print(C)

Submission status: Runtime Error

Solution code:
seq = input()
seq_list = []
for char in seq :
    if char == "A":
        char2 = "T"
    elif char == "T":
        char2 = "A"
    elif char == "G":
        char2 = "C"
    elif char == "C":
        char2 = "G"
    seq_list.append(char2)
return("".join(seq_list))

Submission status: Runtime Error

Solution code:
dic = {}
dic['A'] = 'T'
dic['T'] = 'A'
dic['C'] = 'G'
dic['G'] = 'C'

def a(b):
	return dic[b]

a=input()
print(a(a))

Submission status: Runtime Error

Solution code:
b = input()
if b = A:
    print(T)
elif b = C:
    print(G)
elif b = G:
    print(C)
else:
    print(A)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

import sys

def parse_input(lines_as_string = None):


    lines = []
    if lines_as_string is None:
        lines.append(input())
    else:
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    tokens = lines[0].split(" ")
    s = tokens[0]

    return (s,)


def solve(s):
    
    acgt = set(["A", "C", "G", "T"])

    count = 0
    count_set = set()
    for i, c in enumerate(s):
        if c in acgt:
            count = count + 1
        else:
            count_set.add(count)
            count = 0

    return max(count_set)

def main():
    # 出力

    print("%s" % solve(*parse_input()))

if __name__ == '__main__':

    main()

Submission status: Runtime Error

Solution code:
dic = {}
dic['A'] = 'T'
dic['T'] = 'A'
dic['C'] = 'G'
dic['G'] = 'C'

def a(b):
	return dic[b]

a=input()
print(a(a))

Submission status: Runtime Error

Solution code:
b = int(input())

if b == 'A':
  print('T')
elif b == 'T':
  print('A')
elif b == 'G':
  print('C')
else:
  print('G')

Submission status: Runtime Error

Solution code:
b= input()

if b=='A':
  b='T'
elif b=='T':
  b='A'
elif b=='G':
  b='C':
elif b=='C':
  b='G'
print(b)

Submission status: Runtime Error

Solution code:
dic = {}
dic['A'] = T
dic['T'] = A
dic['C'] = G
dic['G'] = C

def a(b):
	return dic[b]

a=input()
print(a(a))

Submission status: Runtime Error

Solution code:
N,Q = map(int,input().split())
S = input()
for i in range(Q):
    l,r = (int(_) for _ in input().split())
    s = S[l-1:r]
    print(s.count('AC'))

Submission status: Runtime Error

Solution code:
b = input()
if b == 'A':
    print('C')
elif b == 'C':
    print('A')
elif b == 'G':
    print('T')
else b == 'T':
    print('G')

Submission status: Runtime Error

Solution code:
dic = {}
dic['A'] = T
dic['T'] = A
dic['C'] = G
dic['G'] = C

def a(b):
	return dic[b]

a=input('请输入字母：')
print(a(a))

Submission status: Runtime Error

Solution code:
x=input()
if x=="A" :
    print("T")
elif x=="C" :
    print("G")
elif x=="G" :
    print("C")
else:
    print(A)

Submission status: Runtime Error

Solution code:
b=int(input())

e_dict={
  'A':'T',
  'T':'A',
  'G':'C',
  'C':'G'
}

print(e_dict[b])

Submission status: Runtime Error

Solution code:
b=input()
if b=='A':
    print('T')
elif b=='T':
    prtnt('A')
elif b=='C':
    print('G')
elif b=='G'
    print('C')

Submission status: Runtime Error

Solution code:
# coding: utf-8

str = input()

if str =='A' :
    str = 'T'
    break
elif str == 'T' :
    str = 'A'
    break
elif str == 'C':
    str = 'G'
elif str == 'G':
    str = 'C'

print(str)

Submission status: Runtime Error

Solution code:
A = input()
if A 　== "A":
  print("T")
elif A == "T"
  print("A")
elif A == "C"
  print("G")
elif A == "G"
  print("C")

Submission status: Runtime Error

Solution code:
a = input()
if a == 'A': print('T')
elif a == 'T':print('A')
else a == 'C': print('G')
else:print('C')

Submission status: Runtime Error

Solution code:
s = input()
if s == 'A':
    print 'T'
elif s=='T':
    print 'A'
elif s=='G':
    print 'C'
elif s=='C':
    print 'G'

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
  b = input()
  if b = 'A':
    print ('T')
  elif b = 'T':
	print ('A')
  elif b = 'G':
	print ('C')
  else:
    print ('G')

Submission status: Runtime Error

Solution code:
b=input()
 
if b="A":
    print("T")
elif b="T":
    print("A")
elif b="G":
    print("C")
elif b="C":
    print("G")