Problem:


Score : 100 points

Problem Statement

Given is a three-digit integer N. Does N contain the digit 7?

If so, print Yes; otherwise, print No.

Constraints

100 \leq N \leq 999

Input

Input is given from Standard Input in the following format:

N

Output

If N contains the digit 7, print Yes; otherwise, print No.

Sample Input 1

117

Sample Output 1

Yes

117 contains 7 as its last digit.

Sample Input 2

123

Sample Output 2

No

123 does not contain the digit 7.

Sample Input 3

777

Sample Output 3

Yes



Sample input:
117


Sample output:
Yes

Submission status: Runtime Error

Solution code:
def solve(pick, idx):

    if pick == 0: return 0
    if idx >= n: return -float('inf')
    if (pick, idx) in dp: return dp[pick, idx]
    if n-idx+2 < pick*2: return -float('inf')
    total = max(A[idx] + solve(pick-1, idx+2), solve(pick, idx+1))

    dp[(pick, idx)] = total
    return total

n = int(input())
A = list(map(int, input().split()))
dp = {}
pick = n//2

print(solve(pick, 0))
"""
@lru_cache(None)
def F(index, n):
    if index >= N:
        return -INF
    if N - index + 2 < 2 * n:
        return -INF
    if n == 0:
        return 0
    elif n == 1:
        return max(A[index:])
    ret = max(A[index] + F(index+2, n-1), F(index+1, n))
    return ret
"""

Submission status: Runtime Error

Solution code:
def resolve():
	k = int(input())
	ans = 0
	for i in range(1, k+1):
		for j in range(1, k + 1):
			for k in range(1, k + 1):
				ans += reduce(math.gcd, [i, j, k])
	print(ans)

resolve()

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
cnt = s.count('R')*s.count('G')*s.count('B')
for i in range(n-2):
    for j in range(i+1,n-1):
        if s[i] != s[j]:
            if 2*j-i <= n-1:
                if s[2*j-i] not in(s[i],s[j]):
                    cnt -= 1
print(cnt)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()

Rs = []
Gs = []
Bs = []
for i, il in enumerate(S):
    if il == 'R':
        Rs.append(i)
    if il == 'G':
        Gs.append(i)
    if il == 'B':
        Bs.append(i)
num = 0
for i in Rs:
    for j in Gs:
        for k in Bs:
            if (2*i - j - k)*(2*j - k - i)*(2*k - i - j):
                num += 1
print(num)

Submission status: Runtime Error

Solution code:
N = str(input())
if N in 7:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
answer='No'
for i in str(N):
  if i=='7':
    answer='Yes'
return answer

Submission status: Runtime Error

Solution code:
answer='No'
for i in str(N):
  if i==7:
    print(answer)
return answer

Submission status: Runtime Error

Solution code:
import sys
import collections
input = sys.stdin.readline
 
N = int(input())
 
for c in str(N):
	if c == '7':
		print('Yes')
		exit(1)
print('No')

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
##################################
# University of Wisconsin-Madison
# Author: Yaqi Zhang
##################################

# standard library
import sys
from functools import lru_cache

def main():
    N = int(input())
    INF = 10**18
    nums = list(map(int, input().split()))
    @lru_cache(None)
    def dp(idx, n):
        if idx >= N:
            return -INF
        if N - idx + 2 < 2 * n:
            return -INF
        if n == 0:
            return 0
        elif n == 1:
            return max(nums[idx:])
        return max(nums[idx] + dp(idx + 2, n - 1), dp(idx + 1, n))
    print(dp(0, N // 2))



if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
def main():
    N=int(input())
    S=input()
    ans=0
    for i in range(N-2):
        for j in range(i+1,N-1):
            lis=["R","G","B"]
            if S[i]!=S[j]:
                lis=["R","G","B"]
                lis.remove(S[i])
                lis.remove(S[j])
                k=S[j+1:].count(lis[0])
                ans=ans+k
            if j+(j-i)<N and S[i]!=S[j]:
                if S[j+(j-i)]!=S[i] and S[j+(j-i)]!=S[j]:
                    ans-=1
    print(ans)

main()

Submission status: Runtime Error

Solution code:

a=int(input())
b=str(input())
sum=0
c=b
d=b
i=0
for s in b:
    for n in range(i,a):
        if c[n]!=c[i]:
            j=n-i
            if a>=n:
                for m in range(n,a):
                    if c[m]!=c[i] and c[m]!=c[n]:
                        k=m-n
                        if k!=j:
                            sum+=1



    i+=1
print(sum)

Submission status: Runtime Error

Solution code:
import re
a=int(input())
b=str(input())
sum=0
c=b
d=b
i=0
for s in b:
    for n in range(i,a):
        if c[n]!=c[i]:
            j=n-i
            if a>=n:
                for m in range(n,a):
                    if c[m]!=c[i] and c[m]!=c[n]:
                        k=m-n
                        if k!=j:
                            sum+=1



    i+=1
print(sum)

Submission status: Runtime Error

Solution code:
s = input()
if '7' in s:
  print("Yes)
else:
  print("No")

Submission status: Runtime Error

Solution code:
import math

K = input()

for i in range(1, K+1)
	for j in range(1,K+1)
  		for k in range(1,K+1)
    		ans += math.gcd(math.gcd(i,j), k)
      
print(ans)

Submission status: Runtime Error

Solution code:
str_length = int(input())
rgb_str = str(input())

flag = 0
for num_1 in range(1, str_length + 1):
	for num_2 in range(num_1, str_length + 1):
		for num_3 in range(num_2, str_length + 1):
			if rgb_str[num_1 - 1] != rgb_str[num_2 - 1] and rgb_str[num_2 - 1] != rgb_str[num_3 - 1] and rgb_str[num_1 - 1] != rgb_str[num_3 - 1]:
				if num_2 - num_1 != num_3 - num_2:
					flag += 1
				else:
					continue
			else:
				continue
print(str(flag))

Submission status: Runtime Error

Solution code:
a = int(input())
b = []
if a <= 1000000:
for i in range(a):
    if i % 15 == 0:
      pass
    elif i % 3 == 0:
      pass
    elif i % 5 == 0:
      pass
    else:
      b.append(i)
print(sum(b))

Submission status: Runtime Error

Solution code:
N = int(input())
s = input()
R_cnt = [0] * (N + 1)
B_cnt = [0] * (N + 1)
G_cnt = [0] * (N + 1)
for i in range(N):
    if s[i] == 'R':
        R_cnt[i + 1] = R_cnt[i] + 1
        B_cnt[i + 1] = B_cnt[i]
        G_cnt[i + 1] = G_cnt[i]
    elif s[i] == 'B':
        R_cnt[i + 1] = R_cnt[i]
        B_cnt[i + 1] = B_cnt[i] + 1
        G_cnt[i + 1] = G_cnt[i]
    else:
        R_cnt[i + 1] = R_cnt[i]
        B_cnt[i + 1] = B_cnt[i]
        G_cnt[i + 1] = G_cnt[i] + 1
ans = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        if s[i] == s[j]:
            continue
            
        if s[i] == 'R' and s[j] == 'B' or s[i] == 'B' and s[j] == 'R':
            ans += G_cnt[N] - G_cnt[j]
        elif s[i] == 'B' and s[j] == 'G' or s[i] == 'G' and s[j] == 'B':
            ans += R_cnt[N] - R_cnt[j]
        elif s[i] == 'R' and s[j] == 'G' or s[i] == 'G' and s[j] == 'R':
            ans += B_cnt[N] - B_cnt[j]
        if j + (j - i) < N and s[i] != s[j] != s[j + (j - i)] != s[i]:
            ans -= 1
print(ans)

Submission status: Runtime Error

Solution code:
# これは, u749194f さんの改造です。
# オリジナルではございません。
# https://atcoder.jp/contests/abc162/submissions/11825963
n = int(input())
s = input()
flag = True
if len(set(s))<=2:
    print(0)
    flag = False
if flag:
    r = [i+1 for i in range(n) if s[i]=='R']
    b = [i+1 for i in range(n) if s[i]=='B']
    g = [i+1 for i in range(n) if s[i]=='G']
    minus = 0
    def cnt_cmb(a, b, c):
        cnt = 0
        for i in a:
            for j in b:
                if (i+j)/2 in c:
                    cnt += 1
        return cnt
    minus += cnt_cmb(r, b, g)
    minus += cnt_cmb(b, g, r)
    minus += cnt_cmb(g, r, b)
    print(len(r)*len(b)*len(g)-minus)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    N=int(input())
    S=str(input())
    R=[]
    G=[]
    B=[]
    for i in range(N):
        if S[i]=='R':
            R.append(i)
        if S[i]=='G':
            G.append(i)
        if S[i]=='B':
            B.append(i)
    lr=len(R)
    lg=len(G)
    ans=lr*lg*(N-lr-lg)

    for i in R:
        for j in G:
            for k in B:
                L=sorted([i,j,k])
                if L[-1]-L[1]==L[1]-L[0]:
                    ans-=1
    print(ans)




resolve()

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(input())

a = 0

for i in range(n):
  if s[i]=='R':
    for j in range(n):
      if s[j]=='G':
        for k in range(n):
          if s[k]=='B':
            if i<j<k:
              if (j-i)!=(k-j):
                a = a + 1
            elif i<k<j:
              if (k-i)!=(j-k):
                a = a + 1
            elif j<i<k:
              if (i-j)!=(k-i):
                a = a + 1
            elif j<k<i:
              if (k-j)!=(i-k):
                a = a + 1
            elif k<i<j:
              if (i-k)!=(j-i):
                a = a + 1
            elif k<j<i:
              if (j-k)!=(i-j):
                a = a + 1
          
print(a)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
O = {'R':[], 'G':[], 'B':[]}
for i,c in enumerate(S):
    O[c].append(i)
ans = len(O['R'])*len(O['G'])*len(O['B'])
for i in O['R']:
    for j in O['G']:
        for k in O['B']:
            m = sorted([i,j,k])
            if m[2]-m[1] == m[1]-m[0]:
                ans -= 1
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
S = list(input())
import itertools as itr

A = {'R':[] ,'G':[] ,'B':[]}
sum = 0

for i in range(N):
    A[S[i]].append(i+1)



for i,j,k in itr.product(A['R'],A['B'],A['G']):
            if not i-j == k-j:
                l = [i,j,k]
                l.sort()
                if not l[1] - l[0] == l[2] - l[1]:
                    sum += 1

print(sum)

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(input())
r = []
g = []
b = []
for i,j in enumerate(s):
    if j == "R":
        r.append(i)
    elif j == "G":
        g.append(i)
    else:
        b.append(i)
ans = 0
ss = [len(r),len(g),len(b)]
if max(ss) == len(b):
    for i in r:
        for j in g:
            sa = abs(i-j)
            if sa%2==0:
                p = (i+j)//2
                if p in b:
                    ans-=1
                    ans += len(b)
            if i<j:
                if (i-sa) in b:
                    ans -= 1
                if (j+sa) in b:
                    ans -= 1
            if i>j:
                if (j-sa) in b:
                    ans -= 1
                if (i+sa) in b:
                    ans -= 1
if max(ss) == len(g):
    for i in r:
        for j in b:
            sa = abs(i-j)
            if sa%2==0:
                p = (i+j)//2
                if p in g:
                    ans-=1
                    ans += len(g)
            if i<j:
                if (i-sa) in g:
                    ans -= 1
                if (j+sa) in g:
                    ans -= 1
            if i>j:
                if (j-sa) in g:
                    ans -= 1
                if (i+sa) in g:
                    ans -= 1
if max(ss) == len(r):
    for i in b:
        for j in g:
            sa = abs(i-j)
            if sa%2==0:
                p = (i+j)//2
                if p in r:
                    ans-=1
                    ans += len(r)
            if i<j:
                if (i-sa) in r:
                    ans -= 1
                if (j+sa) in r:
                    ans -= 1
            if i>j:
                if (j-sa) in r:
                    ans -= 1
                if (i+sa) in r:
                    ans -= 1

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
lis = str(input())
a = []
b = []
for pair in itertools.combinations(lis, 3):
    a.append(list(pair))

lis_num = range(len(lis))
for i in itertools.combinations(lis_num, 3):
    b.append(list(i))

count = 0
for i in range(len(a)):
    if (a[i][0]!=a[i][1] and a[i][1]!=a[i][2] and a[i][2] != a[i][0] and b[i][0]!=b[i][1] and b[i][1] != b[i][2]):
        count += 1
print(count)

Submission status: Runtime Error

Solution code:
list_n = input()
if 7 in list_n:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
n = int(input())
s = tuple(input())

cnt = 0
w = {'R', 'G', 'B'}

for i in range(n-2):
  for j in range(i+1, n-1):
    for k in range(j+1, n):
        if {s[i], s[j], s[k]} == w and j-i != k-j:
          cnt += 1
      
print(cnt)

Submission status: Runtime Error

Solution code:
N=int(input())
S=input()
ans=0

for i in range(N-2):
    for j in range(i+1,N-1):
        if S[i]!=S[j]:
            for k in range(1,2*j-i):
                if S[j]!=S[k] and S[k]!=S[i]:
                    ans+=1
            for k in range(2*j-i+1,N):
                if S[j]!=S[k] and S[k]!=S[i]:
                    ans+=1
         
                
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
S = list(input())
S_len = len(S)
ans = 0
i = 0
for _ in range(S_len):
  if S[0] == 'R':
    ans += S[1:].count('B') * S[1:].count('G')
    for j in range(int(len(S)/2+1)):
      try:
        if S[j+1] != S[j*2+2] and S[j*2+2] !='R' and S[j+1] !='R':
          ans-=1
      except:
        pass
  if S[0] == 'B':
    ans += S[1:].count('R') * S[1:].count('G')
    for j in range(int(len(S)/2+1)):
      try:
        if S[j+1] != S[j*2+2] and S[j*2+2] !='B' and S[j+1] !='B':
          ans-=1
      except:
        pass
  if S[0] == 'G':
    ans += S[1:].count('B') * S[1:].count('R')
    for j in range(int(len(S)/2+1)):
      try:
        if S[j+1] != S[j*2+2] and S[j*2+2] !='G' and S[j+1] !='G':
          ans-=1
      except:
        pass
  S  = S[1:]
print(ans)

Submission status: Runtime Error

Solution code:
b = int(input())
if 7 in str(b):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
list_n = input().split
if 7 in list_n:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
out = 0

def rgb (tmpstr, j, i, s):
    if s[j] != s[i]:
        tmpstr = s[j + 1 :  n]
        remain = "RGB".replace(s[j],"").replace(s[i],"")
        num = tmpstr.count(remain) 
        if (j + (j - i)) < len(s):
            if  s[j + (j - i)]  == remain:
                num = num - 1
        return num
    else:
        return 0
    
    
out = sum([sum([rgb(s[j + 1 :  n], j, i, s) for j in range(i+1, n-1)]) for i in range(n-2)])
#for i in range(n-2):
#    out += sum([rgb(s[j + 1 :  n], j, i, s) for j in range(i+1, n-1)])
print(out)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
r = 0
g = 0
b = 0
for i in range(N):
    if S[i] == "R":
        r += 1
    elif S[i] == "G":
        g += 1
    else:
        b += 1
ans = r * g * b

for i in range(N - 2):
    for j in range(i + 1, N - 1):
        x = j + j - i
        if S[i] != S[j] and x <= N - 1:
            if S[i] != S[x] and S[x] != S[j]:
                ans -= 1

print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
a = [str(c) for c in s]
ans=0
r=0
g=0
b=0
er=0
for i in range(n):
    if a[i]=='R':
        r+=1
        ans=ans+g*b
    elif a[i]=='G':
        g+=1
        ans=ans+r*b
    else:
        b+=1
        ans=ans+g*r
for i in range(1,n+1//3):
    for j in range(i,n):
        k=j+i
        l=k+i
        if l<n:
            if a[l]!=a[j] and a[j]!=a[k] and a[k]!=a[l]:
                er+=1
print(ans-er)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3

import re

if int(input()) > 100 and int(input()) <= 999:
    x = str(input())
else:
    print("No")
    exit

if re.match("7", x):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
def bool3(a,b,c):
    if (a!=b) and (b!=c) and (c!=a):
        return True
    else:
        return False

def bool2(a,b,c):
    if a-b != b-c:
        return True
    else:
        return False

def main():
    n = int(input())
    s = input()
    ans = 0
    for i in range(n):
        for j in range(i):
            ans += sum([1 if bool3(s[i],s[j],s[k]) and bool2(i,j,k) else 0 for k in range(j)])
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def main():
    word_len = int(input())
    word = str(input())
    R_list = []
    G_list = []
    B_list = []
    for i in range(word_len):
        if word[i] == "R":
            R_list.append(i)
        if word[i] == "G":
            G_list.append(i)
        if word[i] == "B":
            B_list.append(i)
    counter = 0
    for r in R_list:
        for g in G_list:
            for b in B_list:
                v =  [r,g,b]
                v.sort()
                if (v[1]-v[0]) != (v[2]-v[1]):
                    counter += 1
    print(counter)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
SS = list(S)
n = 0
for i in range(N):
  for j in range(N):
    for k in range(N):
      kk = []
      kk.append(i)
      kk.append(j)
      kk.append(k)
      kk.sort()
      if SS[int(kk[0])] != SS[int(kk[1])] and SS[int(kk[1])] != SS[int(kk[2])] and SS[int(kk[2])] != SS[int(kk[0])]:
        if int(kk[1]) - int(kk[0]) != int(kk[2]) - int(kk[1]):
            n+=1
ans = int(n / 6)
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input()) 
ai = np.arange(1,(n+1))
result = 0
for i in ai:
    if i % 3 == 0 or i % 5 == 0:
      result += i
print(result)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
cnt = 0
for k in range(N):
    for j in range(k):
        for i in range(j) :
            if j - i != k - j:
                if S[k] != S[j] and S[j] != S[i] and S[k] != S[i]:
                    cnt = cnt + 1
                else:
                    cnt = cnt + 0

print(cnt)

Submission status: Runtime Error

Solution code:
k = input()
if k[0] == k[1] or k[1] ==k[2] or k[2]==k[0] in str(N):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
n=input()
print'Yes' if (n.count('7')) >= 1 else: 'No'

Submission status: Runtime Error

Solution code:
import math

n = int(input())
s = input()

r_count = s.count('R')
g_count = s.count('G')
b_count = s.count('B')

answer = r_count*g_count*b_count


n_temp = min(n, math.ceil(n/3)+6)
for k in range(1, n_temp):
    for i in range(k):
        extracted = s[i::k]
        if len(extracted) >= 3:
            for l in range(len(extracted)-2):
                temp = extracted[l:l+3]
                if temp.count('R') == 1 and temp.count('G')==1 and temp.count('B'):
                    answer -= 1

print(answer)

Submission status: Runtime Error

Solution code:
import itertools


N = int(input())
A = list(map(int, input().split(" ")))


p = itertools.combinations(list(range(N)), 2)

if N % 2 == 0:
    ans = 0
    for i in range(N):
        A_new = A[:i] + A[i+1:]
        if ans < sum(A_new[0::2]):
            ans = sum(A_new[0::2])
    print(ans)

else:
    ans = 0
    for v in p:
        a, b = min(v), max(v)
        A_new = A[:a] + A[a+1:b] + A[b+1:]
        if ans < sum(A_new[0::2]):
            ans = sum(A_new[0::2])
    print(ans)

Submission status: Runtime Error

Solution code:
import math

n = int(input())
s = input()

r_count = s.count('R')
g_count = s.count('G')
b_count = s.count('B')

answer = r_count*g_count*b_count


for k in range(1, min(n, math.ceil(n/3)+6)):
    for i in range(k):
        extracted = s[i::k]
        if len(extracted) >= 3:
            for l in range(len(extracted)-2):
                temp = extracted[l:l+3]
                if temp.count('R') == 1 and temp.count('G')==1 and temp.count('B'):
                    answer -= 1

print(answer)

Submission status: Runtime Error

Solution code:
 l = [int(x) for x in input().split()]

if l[0] == 7 or l[1] == 7 or l[2] == 7:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
N=int(input())
if N>=100 and N<=999:
  if 7 in N:
    print("Yes")
  else:
    print("No")
else: 
  print("No")

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
count = 0
for i in range(1, N+1:
    for j in range(i + 1, N+1):
        for k in range(j + 1, N+1):
            if S[i-1] != S[j-1] and S[j-1] != S[k-1] and S[i-1] != S[k-1] and j - i != k - j:
                count += 1
print(count)

Submission status: Runtime Error

Solution code:
b = int(input())
if 7 in str (b):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
a = input()
b = [int(c) for c in a]

d = len(a)
e = b + 1
i = 0
while i < e:
    e = a[i]
    if e == '7':
        print('Yes')
        break
    elif e == a:
          print('No')
        
    i += 1

Submission status: Runtime Error

Solution code:
b = int(input())
if 7 in str(b):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
N=input()
i = 3
j = 5
k = 15
total3 = 0
total5 = 0
total15 = 0
while i<=N:
  total3 += i
  i = i + 3
while j<=N:
  total5 += j
  j = j + 5
while k<=N:
  total15 += k
  k = k + 15
N_sum = (1 + N) * N / 2

ans = N_sum - i - j + k

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
count = 0
for i in range(1, len(S)+1):
    for j in range(i + 1, len(S)+1):
        for k in range(j + 1, len(S)+1):
            if S[i-1] != S[j-1] and S[j-1] != S[k-1] and S[i-1] != S[k-1] and j - i != k - j:
                count += 1
print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
s = str(input())
count = 0
for i in range(n):
    for j in range(n):
        for k in range(n):
            if i < j < k:
                a = (s[i], s[j], s[k])
                #print(a)
                a_set = set(a)
                #print(a_set)
                if len(a_set) == 3 and (j - i) != (k - j):
                    count += 1
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
count = 0


for i in range(1, N-1):
    for j in range(i+1, N):
        if S[i-1] == S[j-1]:
            pass
        else:
            for k in range(j+1, N+1):
                if (S[i-1] != S[k-1]) and (S[j-1] != S[k-1]) and ((j-i) != (k-j)):
                    count += 1

print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()

d = 0
for k in range(2,N):
    sk = S[k]
    for j in range(k):
        sj = S[j]
        if sk != sj:
            for i in range(j):
                si = S[i]
                if (si != sj) & (si != sk):
                    if j-i != k-j:
                   
                        d += 1

print(d)

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
lst=list(s)
r=[i for i,j in enumerate(lst) if j=="R"]
g=[i for i,j in enumerate(lst) if j=="G"]
b=[i for i,j in enumerate(lst) if j=="B"]
comb=len(r)*len(g)*len(b)
out=0
for i in r:
  for j in g:
    for k in b:
      if (i+j)==2*k or (j+k)==2*i or (k+i)==2*j:
        out+=1
print(comb-out)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
count = 0
for k in range(N):
    for j in range(k):
        if S[k] == S[j]:
            continue
        for i in range(j):
            if S[i] == S[j] or S[i] == S[k] or j-i == k-j:
                continue
            count+=1
print(count)

Submission status: Runtime Error

Solution code:
k = input()
if k[0] == k[1] or k[1] ==k[2] or k[2]==k[3]:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
n = input()
N = str(n)
if "7" in N:
    print(yes)
else:
    print(no)

Submission status: Runtime Error

Solution code:
a=int(input())

b=input()
c=a-1
d=0

for i in range(c):
  for j1 in range(c-i):
    j=j1+i+1

    if b[i]!=b[j]:
      for k1 in range(c-j):
        k=k1+j+1
        #print(i,j,k)

        if b[k]!=b[i] and b[k]!=b[j]:
          if j-i != k-j:
            d=d+1
print(d)

Submission status: Runtime Error

Solution code:
print(["No","Yes"][int("7" in input())]

Submission status: Runtime Error

Solution code:
a = input()
b = [int(c) for c in a]

d = len(a)
e = b + 1
i = 0
while i < e:
    e = a[i]
    if e == '7':
        print('Yes')
        break
    elif e == a:
          print('No')
        
    i += 1

Submission status: Runtime Error

Solution code:
N=int(input())
print("Yes" if N[0]==7 or N[1]==7 or N[2]==7 else "No")

Submission status: Runtime Error

Solution code:
n = input()
N = str(n)
if 7 in N:
    print(yes)
else:
    print(no)

Submission status: Runtime Error

Solution code:
n = input ()
N = str(n)
if 7 in N:
    print(yes)
else:
    print(no)

Submission status: Runtime Error

Solution code:
import math
import string
import collections
from collections import Counter
from collections import deque
import sys
sys.setrecursionlimit(2*10**5)
INF = 2**60


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]


N = int(input())
S = input()
r = []
g = []
b = []
for i in range(N):
    if S[i] == 'R':
        r.append(i+1)
    if S[i] == 'G':
        g.append(i+1)
    if S[i] == 'B':
        b.append(i+1)
c = [None]*100
for i in range(100):
    c[i] = [None]*100
cnt = 0
for i in range(len(r)):
    for j in range(len(g)):
        for k in range(len(b)):
            c[i][0] = r[i]
            c[i][1] = g[j]
            c[i][2] = b[k]

            if c[i][1]-c[i][0] != c[i][2]-c[i][1]:
                #print(c[i][0], c[i][1], c[i][2], 'Yes')
                cnt += 1

print(cnt)

Submission status: Runtime Error

Solution code:
a = input().split()

b = len(a)
c = b + 1
i = 0
while i < c:
    c = a[i]
    if c == 7:
        print('Yes')
        break
    elif c==a:
          print('No')
        
    i += 1

Submission status: Runtime Error

Solution code:
N = input()
if 7 in N:
    print(yes)
else:
    print(no)

Submission status: Runtime Error

Solution code:
a = input().split()

b = len(a)
c = b + 1
i = 0
while i < c:
    c = a[i]
    if c == 7:
        print('yes')
        break
    elif c==a:
          print('no')
        
    i += 1

Submission status: Runtime Error

Solution code:
N = input 
if 7 in N:
    print(yes)
else:
    print(no)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()

R_list = []
G_list = []
B_list = []
pair_list = []

for i in range(N):
    if S[i]=='R':
        R_list.append(i)
    elif S[i]=='G':
        G_list.append(i)
    else:
        B_list.append(i)

for i in R_list:
    for j in G_list:
        for k in B_list:
            pair_list.append([i,j,k])
        
count = 0
for pair in pair_list:
    pair.sort()
    if((pair[1]-pair[0])==(pair[2]-pair[1])):
        continue
    else:
        count += 1

#print(R_list)
#print(G_list)
#print(B_list)
#print(pair_list)
print(count)

Submission status: Runtime Error

Solution code:
b = int(input())
if 7 in str(b):
    print("Yes")
print("No")

Submission status: Runtime Error

Solution code:
n = input ()
N = int(n)
if 7 in N:
    print(yes)
else:
    print(no)

Submission status: Runtime Error

Solution code:
a = input().split()
b = len(a)
c = b + 1
i = 0
while i < c:
    c = a[i]
    if c == 7:
        print('yes')
        break
    elif c==a:
          print('no')
        
    i += 1

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()

num_rgb = {'R':0, 'G':0, 'B':0}
num_list = []
for i in range(n):
    num_rgb[s[i]] += 1
    num_list.append(num_rgb.copy())

total = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        if s[i] == s[j]:
            continue
        target = ''
        if not (s[i] == 'R' or s[j] == 'R'):
            target = 'R'
        elif not (s[i] == 'G' or s[j] == 'G'):
            target = 'G'
        elif not (s[i] == 'B' or s[j] == 'B'):
            target = 'B'
        num = num_list[n-1][target]-num_list[j][target]
        if 2*j-i < n and s[j+j-i] == target:
            num -= 1
        total += num
print(total)

Submission status: Runtime Error

Solution code:
in=input()
ok=0
for i in range(len(in)):
  if(in[i]=='7'):
    print("Yes")
    ok=1
    break
if(ok==0):
  print("No")

Submission status: Runtime Error

Solution code:
num = [int(x) for x in input().split()]

for i in range(2):
    if num[i] == 7:
        print("Yes")
        break
    elif num[i] != 7:
        pass
    elif i == 2 & num[i] != 7:
        print("No")

Submission status: Runtime Error

Solution code:
a, b, c = map(int(), input().split())
if a = 7:
    print('Yes')
elif b = 7:
    print('Yes')
elif c = 7:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
 N = input()
total = 0
for i in range(N):
	if i % 3 != 0 and i % 5 != 0:
		total += i

print(total)

Submission status: Runtime Error

Solution code:
 N = input()
total = 0
for i in range(N):
	if i % 3 != 0 and i % 5 != 0:
	total += i

print(total)

Submission status: Runtime Error

Solution code:
N=int(input())
if N>=100 and N<=999:
  for i in N:
    if i==7:
      print("Yes")
    else:
      print("No")

Submission status: Runtime Error

Solution code:
import collections
n=int(input())
s=str(input())
d=collections.defaultdict(list)
count=0
v=collections.defaultdict(int)
for i in range(n):
    d[s[i]].append(i)
for i in range(len(d["R"])):
    for j in range(i,len(d["G"])):
        if j>i:
            for k in range(j,len(d["B"])):
                if k>j:
                    if j-i!=k-j:
                        count+=1
for i in range(len(d["R"])):
    for j in range(i,len(d["B"])):
        if j>i:
            for k in range(j,len(d["G"])):
                if k>j:
                    if j-i!=k-j:
                        count+=1
for i in range(len(d["G"])):
    for j in range(i,len(d["R"])):
        if j>i:
            for k in range(j,len(d["B"])):
                if k>j:
                    if j-i!=k-j:
                        count+=1
for i in range(len(d["G"])):
    for j in range(i,len(d["B"])):
        if j>i:
            for k in range(j,len(d["R"])):
                if k>j:
                    if j-i!=k-j:
                        count+=1
for i in range(len(d["B"])):
    for j in range(i,len(d["R"])):
        if j>i:
            for k in range(j,len(d["G"])):
                if k>j:
                    if j-i!=k-j:
                        count+=1
for i in range(len(d["B"])):
    for j in range(i,len(d["G"])):
        if j>i:
            for k in range(j,len(d["R"])):
                if k>j:
                    if j-i!=k-j:
                        count+=1
                #v[(i,j,k)]+=1
print(count)
#print(v)
#print(len(v))

Submission status: Runtime Error

Solution code:
a = map(str,input().split)

b = a + 1
i = 0
while i < b:
    c = a[i]
    if c == 7:
        print('yes')
        break
    elif c==a:
          print('no')
        
    i += 1