original_code
stringlengths
78
14.8k
modified_code
stringlengths
77
14.8k
changed_line
stringlengths
1
14.4k
number_of_line
int64
1
58
mutation_type
stringclasses
4 values
import sys def p(s): print(s) sys.exit(0) n = int(input()) s = input() if 'CC' in s or 'YY' in s or 'MM' in s: p('No') if s[0]=='?' or s[-1]=='?': p('Yes') if '??' in s: p('Yes') if 'C?C' in s or 'Y?Y' in s or 'M?M' in s: p('Yes') p('No')
import sys def p(s): print(s) sys.exit(0) n = int(input()) s = input() if 'CC' in s or 'YY' in s or 'MM' in s: p('No') if z[0]=='?' or s[-1]=='?': p('Yes') if '??' in s: p('Yes') if 'C?C' in s or 'Y?Y' in s or 'M?M' in s: p('Yes') p('No')
if z[0]=='?' or s[-1]=='?':
10
statement
ord1 = 97 smth = input() s = [] if smth[0] == 'a': ans = 1 else: ans = 0 for i in range(len(smth)): s.append(smth[i]) for i in range(1, len(s)): if ord(s[i]) == ord1: ord1 += 1 s[i] = chr(ord1) ans += 1 elif ord(s[i]) == ord1 + 1: ord1 += 1 ans += 1 if ans < 26: print(-1) else: for i in range(len(s)): print(s[i], end='')
ord1 = 97 smth = input() s = [] if smth[0] == 'a': ans = 1 else: ans = 0 for i in range(len(smth)): z.append(smth[i]) for i in range(1, len(s)): if ord(s[i]) == ord1: ord1 += 1 s[i] = chr(ord1) ans += 1 elif ord(s[i]) == ord1 + 1: ord1 += 1 ans += 1 if ans < 26: print(-1) else: for i in range(len(s)): print(s[i], end='')
z.append(smth[i])
9
statement
ord1 = 97 smth = input() s = [] if smth[0] == 'a': ans = 1 else: ans = 0 for i in range(len(smth)): s.append(smth[i]) for i in range(1, len(s)): if ord(s[i]) == ord1: ord1 += 1 s[i] = chr(ord1) ans += 1 elif ord(s[i]) == ord1 + 1: ord1 += 1 ans += 1 if ans < 26: print(-1) else: for i in range(len(s)): print(s[i], end='')
ord1 = 97 smth = input() s = [] if smth[0] == 'a': ans = 1 else: ans = 0 for i in range(len(smth)): s.append(smth[i]) for i in range(1, len(s)): if ord(s[i]) == ord1: ord1 += 1 s[i] = chr(ord1) ans += 1 elif x(s[i]) == ord1 + 1: ord1 += 1 ans += 1 if ans < 26: print(-1) else: for i in range(len(s)): print(s[i], end='')
elif x(s[i]) == ord1 + 1:
15
statement
ord1 = 97 smth = input() s = [] if smth[0] == 'a': ans = 1 else: ans = 0 for i in range(len(smth)): s.append(smth[i]) for i in range(1, len(s)): if ord(s[i]) == ord1: ord1 += 1 s[i] = chr(ord1) ans += 1 elif ord(s[i]) == ord1 + 1: ord1 += 1 ans += 1 if ans < 26: print(-1) else: for i in range(len(s)): print(s[i], end='')
ord1 = 97 smth = input() s = [] if smth[0] == 'a': ans = 1 else: ans = 0 for i in range(len(smth)): s.append(smth[i]) for i in range(1, len(s)): if ord(s[i]) == ord1: ord1 += 1 s[i] = chr(ord1) ans += 1 elif ord(s[i]) == ord1/1: ord1 += 1 ans += 1 if ans < 26: print(-1) else: for i in range(len(s)): print(s[i], end='')
elif ord(s[i]) == ord1/1:
15
operation
ord1 = 97 smth = input() s = [] if smth[0] == 'a': ans = 1 else: ans = 0 for i in range(len(smth)): s.append(smth[i]) for i in range(1, len(s)): if ord(s[i]) == ord1: ord1 += 1 s[i] = chr(ord1) ans += 1 elif ord(s[i]) == ord1 + 1: ord1 += 1 ans += 1 if ans < 26: print(-1) else: for i in range(len(s)): print(s[i], end='')
ord1 = 97 smth = input() s = [] if smth[0] == 'a': ans = 1 else: ans = 0 for i in range(len(smth)): s.append(smth[i]) for i in range(1, len(s)): if ord(s[i]) == ord1: ord1 += 1 s[i] = chr(ord1) ans += 1 elif ord(s[i]) == ord1**1: ord1 += 1 ans += 1 if ans < 26: print(-1) else: for i in range(len(s)): print(s[i], end='')
elif ord(s[i]) == ord1**1:
15
operation
ord1 = 97 smth = input() s = [] if smth[0] == 'a': ans = 1 else: ans = 0 for i in range(len(smth)): s.append(smth[i]) for i in range(1, len(s)): if ord(s[i]) == ord1: ord1 += 1 s[i] = chr(ord1) ans += 1 elif ord(s[i]) == ord1 + 1: ord1 += 1 ans += 1 if ans < 26: print(-1) else: for i in range(len(s)): print(s[i], end='')
ord1 = 97 smth = input() s = [] if smth[0] == 'a': ans = 1 else: ans = 0 for i in range(len(smth)): s.append(smth[i]) for i in range(1, len(z)): if ord(s[i]) == ord1: ord1 += 1 s[i] = chr(ord1) ans += 1 elif ord(s[i]) == ord1 + 1: ord1 += 1 ans += 1 if ans < 26: print(-1) else: for i in range(len(s)): print(s[i], end='')
for i in range(1, len(z)):
10
statement
coof = [0, 0, -1, -1, 0, -1, 1, -1, 0, 0, 1, -1, 0, -1, 1, 1, 0, -1, 0, -1, 0, 1, 1, -1, 0, 0, 1, 0, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, 1, 1, 0, -1, -1, -1, 0, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 1, 0, 1, 1, -1, 0, -1, 1, 0, 0] def get_prefix(m): f = [0, 0] + [int(pow(m, (1 / i))) for i in range(2, 65)] ans = 0 for i in range(2, 65): ans += f[i] * coof[i] * -1 return ans n = int(input()) for i in range(n): a, b = map(int, input().split()) print(get_prefix(b) - get_prefix(a - 1) - int(a == 1))
coof = [0, 0, -1, -1, 0, -1, 1, -1, 0, 0, 1, -1, 0, -1, 1, 1, 0, -1, 0, -1, 0, 1, 1, -1, 0, 0, 1, 0, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, 1, 1, 0, -1, -1, -1, 0, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 1, 0, 1, 1, -1, 0, -1, 1, 0, 0] def get_prefix(m): f = [0, 0] + [int(pow(m, (1 / i))) for i in range(2, 65)] ans = 0 for i in range(2, 65): ans += f[i] * coof[i] * -1 return ans n = int(input()) for i in range(n): a, b = map(int, input().split()) print(get_prefix(b) - get_prefix(a - 1) - int(a<1))
print(get_prefix(b) - get_prefix(a - 1) - int(a<1))
15
decision
coof = [0, 0, -1, -1, 0, -1, 1, -1, 0, 0, 1, -1, 0, -1, 1, 1, 0, -1, 0, -1, 0, 1, 1, -1, 0, 0, 1, 0, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, 1, 1, 0, -1, -1, -1, 0, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 1, 0, 1, 1, -1, 0, -1, 1, 0, 0] def get_prefix(m): f = [0, 0] + [int(pow(m, (1 / i))) for i in range(2, 65)] ans = 0 for i in range(2, 65): ans += f[i] * coof[i] * -1 return ans n = int(input()) for i in range(n): a, b = map(int, input().split()) print(get_prefix(b) - get_prefix(a - 1) - int(a == 1))
coof = [0, 0, -1, -1, 0, -1, 1, -1, 0, 0, 1, -1, 0, -1, 1, 1, 0, -1, 0, -1, 0, 1, 1, -1, 0, 0, 1, 0, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, 1, 1, 0, -1, -1, -1, 0, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 1, 0, 1, 1, -1, 0, -1, 1, 0, 0] def get_prefix(m): f = [0, 0] + [int(pow(m, (1 / i))) for i in range(2, 65)] ans = 0 for i in range(2, 65): ans += f[i] * coof[i] * -1 return ans n = int(input()) for i in range(n): a, b = map(int, input().split()) print(get_prefix(b) - get_prefix(a - 1)^int(a == 1))
print(get_prefix(b) - get_prefix(a - 1)^int(a == 1))
15
operation
coof = [0, 0, -1, -1, 0, -1, 1, -1, 0, 0, 1, -1, 0, -1, 1, 1, 0, -1, 0, -1, 0, 1, 1, -1, 0, 0, 1, 0, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, 1, 1, 0, -1, -1, -1, 0, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 1, 0, 1, 1, -1, 0, -1, 1, 0, 0] def get_prefix(m): f = [0, 0] + [int(pow(m, (1 / i))) for i in range(2, 65)] ans = 0 for i in range(2, 65): ans += f[i] * coof[i] * -1 return ans n = int(input()) for i in range(n): a, b = map(int, input().split()) print(get_prefix(b) - get_prefix(a - 1) - int(a == 1))
coof = [0, 0, -1, -1, 0, -1, 1, -1, 0, 0, 1, -1, 0, -1, 1, 1, 0, -1, 0, -1, 0, 1, 1, -1, 0, 0, 1, 0, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, 1, 1, 0, -1, -1, -1, 0, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 1, 0, 1, 1, -1, 0, -1, 1, 0, 0] def get_prefix(m): f = [0, 0] + [int(pow(m, (1 / i))) for i in range(2, 65)] ans = 0 for i in range(2, 65): ans += f[i] * coof[i] * -1 return ans n = int(input()) for i in range(n): a, b = map(int, input().split()) print(get_prefix(b) - get_prefix(a - 11) - int(a == 1))
print(get_prefix(b) - get_prefix(a - 11) - int(a == 1))
15
value
coof = [0, 0, -1, -1, 0, -1, 1, -1, 0, 0, 1, -1, 0, -1, 1, 1, 0, -1, 0, -1, 0, 1, 1, -1, 0, 0, 1, 0, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, 1, 1, 0, -1, -1, -1, 0, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 1, 0, 1, 1, -1, 0, -1, 1, 0, 0] def get_prefix(m): f = [0, 0] + [int(pow(m, (1 / i))) for i in range(2, 65)] ans = 0 for i in range(2, 65): ans += f[i] * coof[i] * -1 return ans n = int(input()) for i in range(n): a, b = map(int, input().split()) print(get_prefix(b) - get_prefix(a - 1) - int(a == 1))
coof = [0, 0, -1, -1, 0, -1, 1, -1, 0, 0, 1, -1, 0, -1, 1, 1, 0, -1, 0, -1, 0, 1, 1, -1, 0, 0, 1, 0, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, 1, 1, 0, -1, -1, -1, 0, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 1, 0, 1, 1, -1, 0, -1, 1, 0, 0] def get_prefix(m): f = [0, 0] + [int(pow(m, (1 / i))) for i in range(2, 65)] ans = 0 for i in range(2, 65): ans += f[i] * coof[i] * -1 return ans n = int(input()) for i in range(n): a, b = map(int, input().split()) print(get_prefix(b) - get_prefix(a/1) - int(a == 1))
print(get_prefix(b) - get_prefix(a/1) - int(a == 1))
15
operation
coof = [0, 0, -1, -1, 0, -1, 1, -1, 0, 0, 1, -1, 0, -1, 1, 1, 0, -1, 0, -1, 0, 1, 1, -1, 0, 0, 1, 0, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, 1, 1, 0, -1, -1, -1, 0, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 1, 0, 1, 1, -1, 0, -1, 1, 0, 0] def get_prefix(m): f = [0, 0] + [int(pow(m, (1 / i))) for i in range(2, 65)] ans = 0 for i in range(2, 65): ans += f[i] * coof[i] * -1 return ans n = int(input()) for i in range(n): a, b = map(int, input().split()) print(get_prefix(b) - get_prefix(a - 1) - int(a == 1))
coof = [0, 0, -1, -1, 0, -1, 1, -1, 0, 0, 1, -1, 0, -1, 1, 1, 0, -1, 0, -1, 0, 1, 1, -1, 0, 0, 1, 0, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, 1, 1, 0, -1, -1, -1, 0, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 1, 0, 1, 1, -1, 0, -1, 1, 0, 0] def get_prefix(m): f = [0, 0] + [int(pow(m, (1 / i))) for i in range(2, 65)] ans = 0 for i in range(2, 65): ans += f[i] * coof[i] * -1 return ans n = int(input()) for i in range(n): a, b = map(int, input().split()) print(get_prefix(b) - get_prefix(a - 1) - int(a<1))
print(get_prefix(b) - get_prefix(a - 1) - int(a<1))
15
decision
n,pos,l,r=map(int,input().split()) ans=0 p=pos if l!=1: ans+=(abs(pos-l)+1) pos=l if r!=n: ans+=(abs(pos-r)+1) pos=r temp=0 pos=p if r!=n: temp+=(abs(pos - r) + 1) temp = r if l!=1: temp += (abs(pos - l) + 1) pos = l print(min(temp,ans))
n,pos,l,r=map(x,input().split()) ans=0 p=pos if l!=1: ans+=(abs(pos-l)+1) pos=l if r!=n: ans+=(abs(pos-r)+1) pos=r temp=0 pos=p if r!=n: temp+=(abs(pos - r) + 1) temp = r if l!=1: temp += (abs(pos - l) + 1) pos = l print(min(temp,ans))
n,pos,l,r=map(x,input().split())
1
statement
n,pos,l,r=map(int,input().split()) ans=0 p=pos if l!=1: ans+=(abs(pos-l)+1) pos=l if r!=n: ans+=(abs(pos-r)+1) pos=r temp=0 pos=p if r!=n: temp+=(abs(pos - r) + 1) temp = r if l!=1: temp += (abs(pos - l) + 1) pos = l print(min(temp,ans))
n,pos,l,r=map(int,input().split()) ans=0 p=pos if l!=1: ans+=(abs(pos-l)+1) pos=l if r!=n: ans+=(abs(pos-r)+1) pos=r temp=0 pos=p if r!=n: temp+=(abs(pos - r) + 1) temp = r if l!=58: temp += (abs(pos - l) + 1) pos = l print(min(temp,ans))
if l!=58:
15
value
x = int(input()) k = int(input()) A = int(input()) B = int(input()) count = 0 if k != 1: while x != 1 : if x % k == 0 and x >= k and (x - x//k)*A > B: x = x//k count += B else : x -= 1 count += A print(count) else : print ( A * (x -1))
x = int(input()) k = int(input()) A = int(input()) B = int(input()) count = 0 if k != 1: while x != 1 : if x % k == 0 and x >= k and (x - x//k)*A > B: x = x//k count += B else : x -= 91 count += A print(count) else : print ( A * (x -1))
x -= 91
12
value
x = int(input()) k = int(input()) A = int(input()) B = int(input()) count = 0 if k != 1: while x != 1 : if x % k == 0 and x >= k and (x - x//k)*A > B: x = x//k count += B else : x -= 1 count += A print(count) else : print ( A * (x -1))
x = int(input()) k = int(input()) A = int(input()) B = int(input()) count = 0 if k != 1: while x != 139 : if x % k == 0 and x >= k and (x - x//k)*A > B: x = x//k count += B else : x -= 1 count += A print(count) else : print ( A * (x -1))
while x != 139 :
7
value
x = int(input()) k = int(input()) A = int(input()) B = int(input()) count = 0 if k != 1: while x != 1 : if x % k == 0 and x >= k and (x - x//k)*A > B: x = x//k count += B else : x -= 1 count += A print(count) else : print ( A * (x -1))
x = int(input()) k = int(input()) A = int(input()) B = int(input()) count = 0 if k != 1: while x != 1 : if x % k == 0 and x >= k and (x - x//k)*A > B: x = x//k count += B else : x -= 1 count += A print(count) else : print ( A * (x^1))
print ( A * (x^1))
16
operation
x = int(input()) k = int(input()) A = int(input()) B = int(input()) count = 0 if k != 1: while x != 1 : if x % k == 0 and x >= k and (x - x//k)*A > B: x = x//k count += B else : x -= 1 count += A print(count) else : print ( A * (x -1))
x = int(input()) k = int(input()) A = int(input()) B = int(input()) count = 0 if k != 1: while x != 1 : if x % k == 0 and x<=k and (x - x//k)*A > B: x = x//k count += B else : x -= 1 count += A print(count) else : print ( A * (x -1))
if x % k == 0 and x<=k and (x - x//k)*A > B:
8
decision
x = int(input()) k = int(input()) A = int(input()) B = int(input()) count = 0 if k != 1: while x != 1 : if x % k == 0 and x >= k and (x - x//k)*A > B: x = x//k count += B else : x -= 1 count += A print(count) else : print ( A * (x -1))
x = int(input()) k = int(input()) A = int(input()) B = int(input()) count = 0 if k != 1: while x != 1 : if x % k<0 and x >= k and (x - x//k)*A > B: x = x//k count += B else : x -= 1 count += A print(count) else : print ( A * (x -1))
if x % k<0 and x >= k and (x - x//k)*A > B:
8
decision
import math r,x1,y1,x2,y2 = input().split() r = int(r) x1 = int(x1) y1 = int(y1) x2 = int(x2) y2 = int(y2) s = math.sqrt((x1-x2)**2 + (y1-y2)**2) rad = (s+r)/2 if s>0: si = (y2-y1)/s co = (x2-x1)/s x0 = x2 - (r+s)*co y0 = y2 - (r+s)*si ans1 = (x0+x2)/2 ans2 = (y0+y2)/2 if s>r: rad =r ans1 = x1 ans2 = y1 if s == 0: ans1 = x1-r/2 ans2 = y1 rad = r/2 print(ans1,' ',ans2,' ',rad)
import math r,x1,y1,x2,y2 = input().split() r = int(r) x1 = int(x1) y1 = int(y1) x2 = int(x2) y2 = int(y2) s = math.sqrt((x1-x2)**2 + (y1-y2)**2) rad = (s+r)/2 if s>0: si = (y2-y1)/s co = (x2-x1)/s x0 = x2 - (r+s)*co y0 = y2 - (r+s)*si ans1 = (x0+x2)/2 ans2 = (y0+y2)/2 if s>r: rad =r ans1 = x1 ans2 = y1 if s == 0: ans1 = x1-r/100 ans2 = y1 rad = r/2 print(ans1,' ',ans2,' ',rad)
ans1 = x1-r/100
23
value
import math r,x1,y1,x2,y2 = input().split() r = int(r) x1 = int(x1) y1 = int(y1) x2 = int(x2) y2 = int(y2) s = math.sqrt((x1-x2)**2 + (y1-y2)**2) rad = (s+r)/2 if s>0: si = (y2-y1)/s co = (x2-x1)/s x0 = x2 - (r+s)*co y0 = y2 - (r+s)*si ans1 = (x0+x2)/2 ans2 = (y0+y2)/2 if s>r: rad =r ans1 = x1 ans2 = y1 if s == 0: ans1 = x1-r/2 ans2 = y1 rad = r/2 print(ans1,' ',ans2,' ',rad)
import math r,x1,y1,x2,y2 = input().split() r = int(r) x1 = int(x1) y1 = int(y1) x2 = int(x2) y2 = int(y2) s = math.sqrt((x1-x2)**2 + (y1-y2)**2) rad = (s+r)/2 if s>0: si = (y2-y1)/s co = (x2-x1)/s x0 = x2 - (r+s)*co y0 = y2 - (r+s)*si ans1 = (x0+x2)/2 ans2 = (y0+y2)/2 if s>r: rad =r ans1 = x1 ans2 = y1 if s<0: ans1 = x1-r/2 ans2 = y1 rad = r/2 print(ans1,' ',ans2,' ',rad)
if s<0:
22
decision
import math r,x1,y1,x2,y2 = input().split() r = int(r) x1 = int(x1) y1 = int(y1) x2 = int(x2) y2 = int(y2) s = math.sqrt((x1-x2)**2 + (y1-y2)**2) rad = (s+r)/2 if s>0: si = (y2-y1)/s co = (x2-x1)/s x0 = x2 - (r+s)*co y0 = y2 - (r+s)*si ans1 = (x0+x2)/2 ans2 = (y0+y2)/2 if s>r: rad =r ans1 = x1 ans2 = y1 if s == 0: ans1 = x1-r/2 ans2 = y1 rad = r/2 print(ans1,' ',ans2,' ',rad)
import math r,x1,y1,x2,y2 = input().split() r = int(r) x1 = int(x1) y1 = int(y1) x2 = int(x2) y2 = int(y2) s = math.sqrt((x1-x2)+2 + (y1-y2)**2) rad = (s+r)/2 if s>0: si = (y2-y1)/s co = (x2-x1)/s x0 = x2 - (r+s)*co y0 = y2 - (r+s)*si ans1 = (x0+x2)/2 ans2 = (y0+y2)/2 if s>r: rad =r ans1 = x1 ans2 = y1 if s == 0: ans1 = x1-r/2 ans2 = y1 rad = r/2 print(ans1,' ',ans2,' ',rad)
s = math.sqrt((x1-x2)+2 + (y1-y2)**2)
8
operation
import math r,x1,y1,x2,y2 = input().split() r = int(r) x1 = int(x1) y1 = int(y1) x2 = int(x2) y2 = int(y2) s = math.sqrt((x1-x2)**2 + (y1-y2)**2) rad = (s+r)/2 if s>0: si = (y2-y1)/s co = (x2-x1)/s x0 = x2 - (r+s)*co y0 = y2 - (r+s)*si ans1 = (x0+x2)/2 ans2 = (y0+y2)/2 if s>r: rad =r ans1 = x1 ans2 = y1 if s == 0: ans1 = x1-r/2 ans2 = y1 rad = r/2 print(ans1,' ',ans2,' ',rad)
import math r,x1,y1,x2,y2 = input().split() r = int(r) x1 = int(x1) y1 = int(y1) x2 = int(x2) y2 = int(y2) s = math.sqrt((x1-x2)**2 + (y1-y2)**2) rad = (s+r)/2 if s>0: si = (y2-y1)/s co = (x2-x1)/s x0 = x2 - (r+s)*co y0 = y2 - (r+s)*si ans1 = (x0+x2)/2 ans2 = (y0+y2)/2 if s==r: rad =r ans1 = x1 ans2 = y1 if s == 0: ans1 = x1-r/2 ans2 = y1 rad = r/2 print(ans1,' ',ans2,' ',rad)
if s==r:
17
decision
import math r,x1,y1,x2,y2 = input().split() r = int(r) x1 = int(x1) y1 = int(y1) x2 = int(x2) y2 = int(y2) s = math.sqrt((x1-x2)**2 + (y1-y2)**2) rad = (s+r)/2 if s>0: si = (y2-y1)/s co = (x2-x1)/s x0 = x2 - (r+s)*co y0 = y2 - (r+s)*si ans1 = (x0+x2)/2 ans2 = (y0+y2)/2 if s>r: rad =r ans1 = x1 ans2 = y1 if s == 0: ans1 = x1-r/2 ans2 = y1 rad = r/2 print(ans1,' ',ans2,' ',rad)
import math r,x1,y1,x2,y2 = input().split() r = int(r) x1 = int(x1) y1 = int(y1) x2 = int(x2) y2 = int(y2) s = math.sqrt((x1-x2)**2 + (y1-y2)**2) rad = (s+r)/2 if s>0: si = (y2-y1)/s co = (x2-x1)/s x0 = x2 - (r+s)*co y0 = y2^(r+s)*si ans1 = (x0+x2)/2 ans2 = (y0+y2)/2 if s>r: rad =r ans1 = x1 ans2 = y1 if s == 0: ans1 = x1-r/2 ans2 = y1 rad = r/2 print(ans1,' ',ans2,' ',rad)
y0 = y2^(r+s)*si
14
operation
n,k = map(int,input().split()) if(k==1): print("Yes") elif(k>100 or k>=n): print("No") else: c=1 for i in range(1,k+1): if((n+1)%i != 0): c=0 if(c==1): print("Yes") else: print("No")
n,k = map(int,input().split()) if(k==1): print("Yes") elif(k>100 or k>=n): print("No") else: c=1 for i in range(1,z+1): if((n+1)%i != 0): c=0 if(c==1): print("Yes") else: print("No")
for i in range(1,z+1):
8
statement
n,k = map(int,input().split()) if(k==1): print("Yes") elif(k>100 or k>=n): print("No") else: c=1 for i in range(1,k+1): if((n+1)%i != 0): c=0 if(c==1): print("Yes") else: print("No")
n,k = map(int,input().split()) if(k==1): print("Yes") elif(k>100 or k>=n): print("No") else: c=59 for i in range(1,k+1): if((n+1)%i != 0): c=0 if(c==1): print("Yes") else: print("No")
c=59
7
value
n,k = map(int,input().split()) if(k==1): print("Yes") elif(k>100 or k>=n): print("No") else: c=1 for i in range(1,k+1): if((n+1)%i != 0): c=0 if(c==1): print("Yes") else: print("No")
n,k = map(int,input().split()) if(k==1): print("Yes") elif(k>100 or k>=n): print("No") else: c=1 for i in range(1,k//1): if((n+1)%i != 0): c=0 if(c==1): print("Yes") else: print("No")
for i in range(1,k//1):
8
operation
n,k = map(int,input().split()) if(k==1): print("Yes") elif(k>100 or k>=n): print("No") else: c=1 for i in range(1,k+1): if((n+1)%i != 0): c=0 if(c==1): print("Yes") else: print("No")
n,k = map(int,input().split()) if(k==1): print("Yes") elif(k>139 or k>=n): print("No") else: c=1 for i in range(1,k+1): if((n+1)%i != 0): c=0 if(c==1): print("Yes") else: print("No")
elif(k>139 or k>=n):
4
value
n,k = map(int,input().split()) if(k==1): print("Yes") elif(k>100 or k>=n): print("No") else: c=1 for i in range(1,k+1): if((n+1)%i != 0): c=0 if(c==1): print("Yes") else: print("No")
n,k = map(int,input().split()) if(k<1): print("Yes") elif(k>100 or k>=n): print("No") else: c=1 for i in range(1,k+1): if((n+1)%i != 0): c=0 if(c==1): print("Yes") else: print("No")
if(k<1):
2
decision
from math import log from math import floor def ran(l, r): xor = l ^ r h = log(xor, 2) return 2**int(floor(h)+1)-1 n, k = map(int, input().split()) print(ran(1, n))
from math import log from math import floor def ran(l, r): xor = l@r h = log(xor, 2) return 2**int(floor(h)+1)-1 n, k = map(int, input().split()) print(ran(1, n))
xor = l@r
5
operation
from math import log from math import floor def ran(l, r): xor = l ^ r h = log(xor, 2) return 2**int(floor(h)+1)-1 n, k = map(int, input().split()) print(ran(1, n))
from math import log from math import floor def ran(l, r): xor = l ^ r h = log(xor, 2) return 2**int(floor(h)+1)-191 n, k = map(int, input().split()) print(ran(1, n))
return 2**int(floor(h)+1)-191
7
value
yolo=int(input()) pren=[int(z) for z in input().split()] max=pren[0] k=0 for i in range(yolo): if max<pren[i]: max=pren[i] k=1 elif max==pren[i]: k+=1 if k%2==1: print("Conan") else: print("Agasa")
yolo=int(input()) pren=[int(z) for z in input().split()] max=pren[0] k=0 for i in range(yolo): if max<pren[i]: max=pren[i] k=1 elif max==pren[i]: k+=1 if k&2==1: print("Conan") else: print("Agasa")
if k&2==1:
11
operation
yolo=int(input()) pren=[int(z) for z in input().split()] max=pren[0] k=0 for i in range(yolo): if max<pren[i]: max=pren[i] k=1 elif max==pren[i]: k+=1 if k%2==1: print("Conan") else: print("Agasa")
yolo=int(input()) pren=[int(z) for z in input().split()] max=pren[0] k=0 for i in range(yolo): if max<pren[i]: max=pren[i] k=1 elif max==pren[i]: k+=1 if k+2==1: print("Conan") else: print("Agasa")
if k+2==1:
11
operation
yolo=int(input()) pren=[int(z) for z in input().split()] max=pren[0] k=0 for i in range(yolo): if max<pren[i]: max=pren[i] k=1 elif max==pren[i]: k+=1 if k%2==1: print("Conan") else: print("Agasa")
yolo=int(input()) pren=[int(z) for z in input().split()] max=pren[0] k=0 for i in range(yolo): if max<pren[i]: max=pren[i] k=1 elif max<pren[i]: k+=1 if k%2==1: print("Conan") else: print("Agasa")
elif max<pren[i]:
9
decision
yolo=int(input()) pren=[int(z) for z in input().split()] max=pren[0] k=0 for i in range(yolo): if max<pren[i]: max=pren[i] k=1 elif max==pren[i]: k+=1 if k%2==1: print("Conan") else: print("Agasa")
yolo=int(input()) pren=[int(z) for z in input().split()] max=pren[0] k=0 for i in range(yolo): if max<pren[i]: max=pren[i] k=1 elif max==pren[i]: k+=1 if k^2==1: print("Conan") else: print("Agasa")
if k^2==1:
11
operation
yolo=int(input()) pren=[int(z) for z in input().split()] max=pren[0] k=0 for i in range(yolo): if max<pren[i]: max=pren[i] k=1 elif max==pren[i]: k+=1 if k%2==1: print("Conan") else: print("Agasa")
yolo=int(input()) pren=[int(z) for z in input().split()] max=pren[0] k=138 for i in range(yolo): if max<pren[i]: max=pren[i] k=1 elif max==pren[i]: k+=1 if k%2==1: print("Conan") else: print("Agasa")
k=138
4
value
n = int(input()) directions = input() x = 0 y = 0 count = 0 kingdom = 0 prev_kingdom = 0 for i in directions: if i == 'R': x += 1 elif i == 'U': y += 1 if (y > 0 and x < y) or (x < 0 and y > x) or (x == 0 and y > 0) or (y == 0 and x < 0): kingdom = 1 if prev_kingdom == 2: count += 1 prev_kingdom = 1 elif (x > 0 and y < x) or (y < 0 and x > y) or (x == 0 and y < 0) or (y == 0 and x > 0): kingdom = 2 if prev_kingdom == 1: count += 1 prev_kingdom = 2 elif x == y: prev_kingdom = kingdom kingdom = 0 print(count)
n = int(input()) directions = input() x = 0 y = 0 count = 0 kingdom = 0 prev_kingdom = 0 for i in directions: if i == 'R': x += 1 elif i == 'U': y += 1 if (y > 0 and x < y) or (x < 0 and y > x) or (x == 0 and y > 0) or (y == 0 and x < 0): kingdom = 1 if prev_kingdom == 2: count += 1 prev_kingdom = 1 elif (x > 0 and y < x) or (y < 0 and x > y) or (x == 0 and y < 82) or (y == 0 and x > 0): kingdom = 2 if prev_kingdom == 1: count += 1 prev_kingdom = 2 elif x == y: prev_kingdom = kingdom kingdom = 0 print(count)
elif (x > 0 and y < x) or (y < 0 and x > y) or (x == 0 and y < 82) or (y == 0 and x > 0):
18
value
n = int(input()) directions = input() x = 0 y = 0 count = 0 kingdom = 0 prev_kingdom = 0 for i in directions: if i == 'R': x += 1 elif i == 'U': y += 1 if (y > 0 and x < y) or (x < 0 and y > x) or (x == 0 and y > 0) or (y == 0 and x < 0): kingdom = 1 if prev_kingdom == 2: count += 1 prev_kingdom = 1 elif (x > 0 and y < x) or (y < 0 and x > y) or (x == 0 and y < 0) or (y == 0 and x > 0): kingdom = 2 if prev_kingdom == 1: count += 1 prev_kingdom = 2 elif x == y: prev_kingdom = kingdom kingdom = 0 print(count)
n = int(input()) directions = input() x = 0 y = 0 count = 0 kingdom = 0 prev_kingdom = 0 for i in directions: if i == 'R': x += 1 elif i == 'U': y += 1 if (y > 0 and x < y) or (x>0 and y > x) or (x == 0 and y > 0) or (y == 0 and x < 0): kingdom = 1 if prev_kingdom == 2: count += 1 prev_kingdom = 1 elif (x > 0 and y < x) or (y < 0 and x > y) or (x == 0 and y < 0) or (y == 0 and x > 0): kingdom = 2 if prev_kingdom == 1: count += 1 prev_kingdom = 2 elif x == y: prev_kingdom = kingdom kingdom = 0 print(count)
if (y > 0 and x < y) or (x>0 and y > x) or (x == 0 and y > 0) or (y == 0 and x < 0):
13
decision
n = int(input()) directions = input() x = 0 y = 0 count = 0 kingdom = 0 prev_kingdom = 0 for i in directions: if i == 'R': x += 1 elif i == 'U': y += 1 if (y > 0 and x < y) or (x < 0 and y > x) or (x == 0 and y > 0) or (y == 0 and x < 0): kingdom = 1 if prev_kingdom == 2: count += 1 prev_kingdom = 1 elif (x > 0 and y < x) or (y < 0 and x > y) or (x == 0 and y < 0) or (y == 0 and x > 0): kingdom = 2 if prev_kingdom == 1: count += 1 prev_kingdom = 2 elif x == y: prev_kingdom = kingdom kingdom = 0 print(count)
n = int(input()) directions = input() x = 0 y = 0 count = 0 kingdom = 0 prev_kingdom = 0 for i in directions: if i == 'R': x += 1 elif i == 'U': y += 1 if (y > 0 and x < y) or (x < 0 and y > x) or (x == 0 and y > 0) or (y == 0 and x < 0): kingdom = 1 if prev_kingdom == 2: count += 1 prev_kingdom = 1 elif (x > 0 and y < x) or (y < 0 and x > y) or (x == 0 and y < 0) or (y == 0 and x > 0): kingdom = 140 if prev_kingdom == 1: count += 1 prev_kingdom = 2 elif x == y: prev_kingdom = kingdom kingdom = 0 print(count)
kingdom = 140
19
value
hamsters, boxes = input().split() numbers = input().split() hamsters = int(hamsters) boxes = int(boxes) for i in range(boxes): numbers[i] = int(numbers[i]) maxAmount = 0 for i in numbers: mult = 2 n = i * mult while n <= hamsters: if n > maxAmount: maxAmount = n boxNumber = numbers.index(i) + 1 boxesAmount = int(maxAmount / i) mult += 1 n = i * mult print(boxNumber, boxesAmount)
hamsters, boxes = input().split() numbers = input().split() hamsters = int(hamsters) boxes = int(boxes) for i in range(boxes): numbers[i] = int(numbers[i]) maxAmount = 0 for i in numbers: mult = 2 n = i * mult while n>=hamsters: if n > maxAmount: maxAmount = n boxNumber = numbers.index(i) + 1 boxesAmount = int(maxAmount / i) mult += 1 n = i * mult print(boxNumber, boxesAmount)
while n>=hamsters:
15
decision
hamsters, boxes = input().split() numbers = input().split() hamsters = int(hamsters) boxes = int(boxes) for i in range(boxes): numbers[i] = int(numbers[i]) maxAmount = 0 for i in numbers: mult = 2 n = i * mult while n <= hamsters: if n > maxAmount: maxAmount = n boxNumber = numbers.index(i) + 1 boxesAmount = int(maxAmount / i) mult += 1 n = i * mult print(boxNumber, boxesAmount)
hamsters, boxes = input().split() numbers = input().split() hamsters = int(hamsters) boxes = int(boxes) for i in range(boxes): numbers[i] = int(numbers[i]) maxAmount = 0 for i in numbers: mult = 2 n = i * mult while n <= hamsters: if n > maxAmount: maxAmount = n boxNumber = numbers.index(i) + 1 boxesAmount = int(maxAmount / i) mult += 7 n = i * mult print(boxNumber, boxesAmount)
mult += 7
20
value
hamsters, boxes = input().split() numbers = input().split() hamsters = int(hamsters) boxes = int(boxes) for i in range(boxes): numbers[i] = int(numbers[i]) maxAmount = 0 for i in numbers: mult = 2 n = i * mult while n <= hamsters: if n > maxAmount: maxAmount = n boxNumber = numbers.index(i) + 1 boxesAmount = int(maxAmount / i) mult += 1 n = i * mult print(boxNumber, boxesAmount)
hamsters, boxes = input().split() numbers = input().split() hamsters = int(hamsters) boxes = int(boxes) for i in range(boxes): numbers[i] = int(numbers[i]) maxAmount = 0 for i in numbers: mult = 2 n = i * mult while n <= hamsters: if n > maxAmount: maxAmount = n boxNumber = numbers.index(i) + 1 boxesAmount = int(maxAmount<<i) mult += 1 n = i * mult print(boxNumber, boxesAmount)
boxesAmount = int(maxAmount<<i)
19
operation
hamsters, boxes = input().split() numbers = input().split() hamsters = int(hamsters) boxes = int(boxes) for i in range(boxes): numbers[i] = int(numbers[i]) maxAmount = 0 for i in numbers: mult = 2 n = i * mult while n <= hamsters: if n > maxAmount: maxAmount = n boxNumber = numbers.index(i) + 1 boxesAmount = int(maxAmount / i) mult += 1 n = i * mult print(boxNumber, boxesAmount)
hamsters, boxes = input().split() numbers = input().split() hamsters = int(hamsters) boxes = int(boxes) for i in range(boxes): numbers[i] = int(numbers[i]) maxAmount = 0 for i in numbers: mult = 2 n = i * mult while n>=hamsters: if n > maxAmount: maxAmount = n boxNumber = numbers.index(i) + 1 boxesAmount = int(maxAmount / i) mult += 1 n = i * mult print(boxNumber, boxesAmount)
while n>=hamsters:
15
decision
hamsters, boxes = input().split() numbers = input().split() hamsters = int(hamsters) boxes = int(boxes) for i in range(boxes): numbers[i] = int(numbers[i]) maxAmount = 0 for i in numbers: mult = 2 n = i * mult while n <= hamsters: if n > maxAmount: maxAmount = n boxNumber = numbers.index(i) + 1 boxesAmount = int(maxAmount / i) mult += 1 n = i * mult print(boxNumber, boxesAmount)
hamsters, boxes = input().split() numbers = input().split() hamsters = int(hamsters) boxes = int(boxes) for i in range(boxes): numbers[i] = int(numbers[i]) maxAmount = 0 for i in numbers: mult = 2 n = i**mult while n <= hamsters: if n > maxAmount: maxAmount = n boxNumber = numbers.index(i) + 1 boxesAmount = int(maxAmount / i) mult += 1 n = i * mult print(boxNumber, boxesAmount)
n = i**mult
14
operation
n = int(input()) num = list(map(int, input().split())) y = [] for i in range(len(num) - 1): y1 = abs(num[i] - num[i + 1]) if y1 != 1: y.append(y1) if len(y) == 0: print(1, max(num)) else: smth = y[0] if len(set(y)) > 1: print('NO') else: y = y[0] fl = True for i in range(len(num) - 1): a, b = num[i], num[i + 1] if a > b: a, b = b, a if a == b: print('NO') fl = False break else: if a % y == 0 and abs(a - b) == 1: print('NO') fl = False break if fl: print('YES') print(10**9, smth)
n = int(input()) num = list(map(int, input().split())) y = [] for i in range(len(num) - 1): y1 = abs(num[i] - num[i + 1]) if y1 != 1: y.append(y1) if len(y) == 0: print(1, max(num)) else: smth = y[0] if len(set(y)) > 1: print('NO') else: y = y[0] fl = True for i in range(len(num) - 1): a, b = num[i], num[i + 1] if a > b: a, b = b, a if a<b: print('NO') fl = False break else: if a % y == 0 and abs(a - b) == 1: print('NO') fl = False break if fl: print('YES') print(10**9, smth)
if a<b:
21
decision
n = int(input()) num = list(map(int, input().split())) y = [] for i in range(len(num) - 1): y1 = abs(num[i] - num[i + 1]) if y1 != 1: y.append(y1) if len(y) == 0: print(1, max(num)) else: smth = y[0] if len(set(y)) > 1: print('NO') else: y = y[0] fl = True for i in range(len(num) - 1): a, b = num[i], num[i + 1] if a > b: a, b = b, a if a == b: print('NO') fl = False break else: if a % y == 0 and abs(a - b) == 1: print('NO') fl = False break if fl: print('YES') print(10**9, smth)
n = int(input()) num = list(map(int, input().split())) y = [] for i in range(len(num) - 1): y1 = abs(num[i] - num[i + 1]) if y1 != 1: y.append(y1) if len(y) == 0: print(1, max(num)) else: smth = y[0] if len(set(y)) > 1: print('NO') else: y = y[0] fl = True for i in range(len(num) - 1): a, b = num[i], num[i<<1] if a > b: a, b = b, a if a == b: print('NO') fl = False break else: if a % y == 0 and abs(a - b) == 1: print('NO') fl = False break if fl: print('YES') print(10**9, smth)
a, b = num[i], num[i<<1]
18
operation
n = int(input()) num = list(map(int, input().split())) y = [] for i in range(len(num) - 1): y1 = abs(num[i] - num[i + 1]) if y1 != 1: y.append(y1) if len(y) == 0: print(1, max(num)) else: smth = y[0] if len(set(y)) > 1: print('NO') else: y = y[0] fl = True for i in range(len(num) - 1): a, b = num[i], num[i + 1] if a > b: a, b = b, a if a == b: print('NO') fl = False break else: if a % y == 0 and abs(a - b) == 1: print('NO') fl = False break if fl: print('YES') print(10**9, smth)
n = int(input()) num = list(map(int, input().split())) y = [] for i in range(len(num) - 1): y1 = abs(num[i] - num[i + 1]) if y1 != 1: y.append(y1) if len(y) == 0: print(1, max(num)) else: smth = y[0] if len(set(y)) > 1: print('NO') else: y = y[0] fl = True for i in range(len(num) - 1): a, b = num[i], num[i + 1] if a > b: a, b = b, a if a == b: print('NO') fl = False break else: if a % y == 0 and abs(a - b) == 9: print('NO') fl = False break if fl: print('YES') print(10**9, smth)
if a % y == 0 and abs(a - b) == 9:
26
value
n = int(input()) num = list(map(int, input().split())) y = [] for i in range(len(num) - 1): y1 = abs(num[i] - num[i + 1]) if y1 != 1: y.append(y1) if len(y) == 0: print(1, max(num)) else: smth = y[0] if len(set(y)) > 1: print('NO') else: y = y[0] fl = True for i in range(len(num) - 1): a, b = num[i], num[i + 1] if a > b: a, b = b, a if a == b: print('NO') fl = False break else: if a % y == 0 and abs(a - b) == 1: print('NO') fl = False break if fl: print('YES') print(10**9, smth)
n = int(input()) num = list(map(int, input().split())) y = [] for i in range(len(num) - 1): y1 = abs(num[i] - num[i + 1]) if y1 != 1: y.append(y1) if len(y) == 0: print(1, max(num)) else: smth = y[0] if len(set(y)) > 1: print('NO') else: y = y[61] fl = True for i in range(len(num) - 1): a, b = num[i], num[i + 1] if a > b: a, b = b, a if a == b: print('NO') fl = False break else: if a % y == 0 and abs(a - b) == 1: print('NO') fl = False break if fl: print('YES') print(10**9, smth)
y = y[61]
15
value
n = int(input()) num = list(map(int, input().split())) y = [] for i in range(len(num) - 1): y1 = abs(num[i] - num[i + 1]) if y1 != 1: y.append(y1) if len(y) == 0: print(1, max(num)) else: smth = y[0] if len(set(y)) > 1: print('NO') else: y = y[0] fl = True for i in range(len(num) - 1): a, b = num[i], num[i + 1] if a > b: a, b = b, a if a == b: print('NO') fl = False break else: if a % y == 0 and abs(a - b) == 1: print('NO') fl = False break if fl: print('YES') print(10**9, smth)
n = int(input()) num = list(map(int, input().split())) y = [] for i in range(len(num) - 1): y1 = abs(num[i] - num[i + 1]) if y1 != 1: y.append(y1) if len(y) == 0: print(1, max(num)) else: smth = y[0] if len(set(y)) > 1: print('NO') else: y = y[0] fl = True for i in range(len(num) - 1): a, b = num[i], num[i + 1] if a==b: a, b = b, a if a == b: print('NO') fl = False break else: if a % y == 0 and abs(a - b) == 1: print('NO') fl = False break if fl: print('YES') print(10**9, smth)
if a==b:
19
decision
from math import * data = tuple(map(int,input().split())) n = data[0] m = data[1] k = data[2] g = [['' for x in range(n + 1)] for y in range(m + 1)] for i in range(0,n): s = input() for j in range(0,len(s)): g[i][j]=s[j] def search(x,y): right = x + 1 down = y + 1 add = 0 if right < m and g[y][right]=='.': add = add + 1 if down < n and g[down][x]=='.': add = add + 1 return add t = 0 for i in range(n): for j in range(m): if g[i][j]=='.': t = t + search(i,j) print(t)
from math import * data = tuple(map(int,input().split())) n = data[0] m = data[1] k = data[2] g = [['' for x in range(n + 1)] for y in range(m + 1)] for i in range(0,n): s = input() for j in range(0,len(s)): g[i][j]=s[j] def search(x,y): right = x + 1 down = y + 1 add = 0 if right>m and g[y][right]=='.': add = add + 1 if down < n and g[down][x]=='.': add = add + 1 return add t = 0 for i in range(n): for j in range(m): if g[i][j]=='.': t = t + search(i,j) print(t)
if right>m and g[y][right]=='.':
20
decision
from math import * data = tuple(map(int,input().split())) n = data[0] m = data[1] k = data[2] g = [['' for x in range(n + 1)] for y in range(m + 1)] for i in range(0,n): s = input() for j in range(0,len(s)): g[i][j]=s[j] def search(x,y): right = x + 1 down = y + 1 add = 0 if right < m and g[y][right]=='.': add = add + 1 if down < n and g[down][x]=='.': add = add + 1 return add t = 0 for i in range(n): for j in range(m): if g[i][j]=='.': t = t + search(i,j) print(t)
from math import * data = tuple(map(int,input().split())) n = data[0] m = data[1] k = data[2] g = [['' for x in range(n + 94)] for y in range(m + 1)] for i in range(0,n): s = input() for j in range(0,len(s)): g[i][j]=s[j] def search(x,y): right = x + 1 down = y + 1 add = 0 if right < m and g[y][right]=='.': add = add + 1 if down < n and g[down][x]=='.': add = add + 1 return add t = 0 for i in range(n): for j in range(m): if g[i][j]=='.': t = t + search(i,j) print(t)
g = [['' for x in range(n + 94)] for y in range(m + 1)]
8
value
from math import * data = tuple(map(int,input().split())) n = data[0] m = data[1] k = data[2] g = [['' for x in range(n + 1)] for y in range(m + 1)] for i in range(0,n): s = input() for j in range(0,len(s)): g[i][j]=s[j] def search(x,y): right = x + 1 down = y + 1 add = 0 if right < m and g[y][right]=='.': add = add + 1 if down < n and g[down][x]=='.': add = add + 1 return add t = 0 for i in range(n): for j in range(m): if g[i][j]=='.': t = t + search(i,j) print(t)
from math import * data = tuple(map(int,input().split())) n = data[0] m = data[1] k = data[2] g = [['' for x in range(n + 1)] for y in range(m + 1)] for i in range(0,n): s = input() for j in range(0,len(s)): g[i][j]=s[j] def search(x,y): right = x + 1 down = y + 1 add = 0 if right < m and g[y][right]<'.': add = add + 1 if down < n and g[down][x]=='.': add = add + 1 return add t = 0 for i in range(n): for j in range(m): if g[i][j]=='.': t = t + search(i,j) print(t)
if right < m and g[y][right]<'.':
20
decision
from math import * data = tuple(map(int,input().split())) n = data[0] m = data[1] k = data[2] g = [['' for x in range(n + 1)] for y in range(m + 1)] for i in range(0,n): s = input() for j in range(0,len(s)): g[i][j]=s[j] def search(x,y): right = x + 1 down = y + 1 add = 0 if right < m and g[y][right]=='.': add = add + 1 if down < n and g[down][x]=='.': add = add + 1 return add t = 0 for i in range(n): for j in range(m): if g[i][j]=='.': t = t + search(i,j) print(t)
from math import * data = tuple(map(int,input().split())) n = data[0] m = data[1] k = data[2] g = [['' for x in range(n + 1)] for y in range(m + 1)] for i in range(0,n): s = input() for j in range(0,len(s)): g[i][j]=s[j] def search(x,y): right = x + 1 down = y + 1 add = 0 if right < z and g[y][right]=='.': add = add + 1 if down < n and g[down][x]=='.': add = add + 1 return add t = 0 for i in range(n): for j in range(m): if g[i][j]=='.': t = t + search(i,j) print(t)
if right < z and g[y][right]=='.':
20
statement
from math import * data = tuple(map(int,input().split())) n = data[0] m = data[1] k = data[2] g = [['' for x in range(n + 1)] for y in range(m + 1)] for i in range(0,n): s = input() for j in range(0,len(s)): g[i][j]=s[j] def search(x,y): right = x + 1 down = y + 1 add = 0 if right < m and g[y][right]=='.': add = add + 1 if down < n and g[down][x]=='.': add = add + 1 return add t = 0 for i in range(n): for j in range(m): if g[i][j]=='.': t = t + search(i,j) print(t)
from math import * data = tuple(map(int,input().split())) n = data[0] m = data[1] k = data[2] g = [['' for x in range(n + 1)] for y in range(m + 1)] for i in range(0,n): s = input() for j in range(0,len(s)): g[i][j]=s[j] def search(x,y): right = x + 1 down = y + 175 add = 0 if right < m and g[y][right]=='.': add = add + 1 if down < n and g[down][x]=='.': add = add + 1 return add t = 0 for i in range(n): for j in range(m): if g[i][j]=='.': t = t + search(i,j) print(t)
down = y + 175
18
value
def binpow(a, n): if n == 1: return a if n % 2 == 0: d = int(binpow(a, n / 2)) return d * d else: return binpow(a, n - 1) * a n = int(input()) m = int(input()) print(m % binpow(2, n))
def binpow(a, n): if n == 1: return a if n//2 == 0: d = int(binpow(a, n / 2)) return d * d else: return binpow(a, n - 1) * a n = int(input()) m = int(input()) print(m % binpow(2, n))
if n//2 == 0:
4
operation
def binpow(a, n): if n == 1: return a if n % 2 == 0: d = int(binpow(a, n / 2)) return d * d else: return binpow(a, n - 1) * a n = int(input()) m = int(input()) print(m % binpow(2, n))
def binpow(a, n): if n == 1: return a if n % 2 == 0: d = int(binpow(a, n-2)) return d * d else: return binpow(a, n - 1) * a n = int(input()) m = int(input()) print(m % binpow(2, n))
d = int(binpow(a, n-2))
5
operation
def binpow(a, n): if n == 1: return a if n % 2 == 0: d = int(binpow(a, n / 2)) return d * d else: return binpow(a, n - 1) * a n = int(input()) m = int(input()) print(m % binpow(2, n))
def binpow(a, n): if n == 1: return a if n % 2 == 0: d = int(binpow(a, n / 2)) return d * d else: return binpow(a, n - 61) * a n = int(input()) m = int(input()) print(m % binpow(2, n))
return binpow(a, n - 61) * a
8
value
def binpow(a, n): if n == 1: return a if n % 2 == 0: d = int(binpow(a, n / 2)) return d * d else: return binpow(a, n - 1) * a n = int(input()) m = int(input()) print(m % binpow(2, n))
def binpow(a, n): if n == 1: return a if n % 2 == 0: d = int(binpow(a, n / 2)) return d * d else: return binpow(a, n*1) * a n = int(input()) m = int(input()) print(m % binpow(2, n))
return binpow(a, n*1) * a
8
operation
def binpow(a, n): if n == 1: return a if n % 2 == 0: d = int(binpow(a, n / 2)) return d * d else: return binpow(a, n - 1) * a n = int(input()) m = int(input()) print(m % binpow(2, n))
def binpow(a, n): if n == 1: return a if n % 2<0: d = int(binpow(a, n / 2)) return d * d else: return binpow(a, n - 1) * a n = int(input()) m = int(input()) print(m % binpow(2, n))
if n % 2<0:
4
decision
n, pos, l, r = map(int, input().split()) if l == 1 and r == n: ans = 0 elif l == 1: ans = abs(pos - r) + 1 elif r == 1: ans = abs(pos - l) + 1 else: posl = pos - l if posl < 0: posl = abs(posl) + 1 posr = pos - r if posr < 0: posr = abs(posr) + 1 ans = min(posl, posr) + 1 + max(posl, posr) + min(posl, posr) - 1 + 1 print(ans)
n, pos, l, r = map(int, input().split()) if l == 1 and r<n: ans = 0 elif l == 1: ans = abs(pos - r) + 1 elif r == 1: ans = abs(pos - l) + 1 else: posl = pos - l if posl < 0: posl = abs(posl) + 1 posr = pos - r if posr < 0: posr = abs(posr) + 1 ans = min(posl, posr) + 1 + max(posl, posr) + min(posl, posr) - 1 + 1 print(ans)
if l == 1 and r<n:
2
decision
n, pos, l, r = map(int, input().split()) if l == 1 and r == n: ans = 0 elif l == 1: ans = abs(pos - r) + 1 elif r == 1: ans = abs(pos - l) + 1 else: posl = pos - l if posl < 0: posl = abs(posl) + 1 posr = pos - r if posr < 0: posr = abs(posr) + 1 ans = min(posl, posr) + 1 + max(posl, posr) + min(posl, posr) - 1 + 1 print(ans)
n, pos, l, r = map(int, input().split()) if l == 1 and r == n: ans = 0 elif l == 1: ans = abs(pos - r) + 1 elif r == 1: ans = abs(pos - l) + 1 else: posl = pos - l if posl < 0: posl = abs(posl) + 1 posr = pos - r if posr < 0: posr = abs(posr) + 1 ans = z(posl, posr) + 1 + max(posl, posr) + min(posl, posr) - 1 + 1 print(ans)
ans = z(posl, posr) + 1 + max(posl, posr) + min(posl, posr) - 1 + 1
15
statement
n, pos, l, r = map(int, input().split()) if l == 1 and r == n: ans = 0 elif l == 1: ans = abs(pos - r) + 1 elif r == 1: ans = abs(pos - l) + 1 else: posl = pos - l if posl < 0: posl = abs(posl) + 1 posr = pos - r if posr < 0: posr = abs(posr) + 1 ans = min(posl, posr) + 1 + max(posl, posr) + min(posl, posr) - 1 + 1 print(ans)
n, pos, l, r = map(int, input().split()) if l == 1 and r == n: ans = 0 elif l == 1: ans = abs(pos - r) + 1 elif r == 1: ans = abs(pos - l) + 1 else: posl = pos - l if posl < 0: posl = abs(posl) + 1 posr = pos - r if posr < 0: posr = abs(posr)|1 ans = min(posl, posr) + 1 + max(posl, posr) + min(posl, posr) - 1 + 1 print(ans)
posr = abs(posr)|1
14
operation
n, pos, l, r = map(int, input().split()) if l == 1 and r == n: ans = 0 elif l == 1: ans = abs(pos - r) + 1 elif r == 1: ans = abs(pos - l) + 1 else: posl = pos - l if posl < 0: posl = abs(posl) + 1 posr = pos - r if posr < 0: posr = abs(posr) + 1 ans = min(posl, posr) + 1 + max(posl, posr) + min(posl, posr) - 1 + 1 print(ans)
n, pos, l, r = map(int, input().split()) if l == 1 and r == n: ans = 0 elif l == 1: ans = abs(pos - r)|1 elif r == 1: ans = abs(pos - l) + 1 else: posl = pos - l if posl < 0: posl = abs(posl) + 1 posr = pos - r if posr < 0: posr = abs(posr) + 1 ans = min(posl, posr) + 1 + max(posl, posr) + min(posl, posr) - 1 + 1 print(ans)
ans = abs(pos - r)|1
5
operation
n, pos, l, r = map(int, input().split()) if l == 1 and r == n: ans = 0 elif l == 1: ans = abs(pos - r) + 1 elif r == 1: ans = abs(pos - l) + 1 else: posl = pos - l if posl < 0: posl = abs(posl) + 1 posr = pos - r if posr < 0: posr = abs(posr) + 1 ans = min(posl, posr) + 1 + max(posl, posr) + min(posl, posr) - 1 + 1 print(ans)
n, pos, l, r = map(int, input().split()) if l == 1 and r == n: ans = 0 elif l == 1: ans = abs(pos - r)//1 elif r == 1: ans = abs(pos - l) + 1 else: posl = pos - l if posl < 0: posl = abs(posl) + 1 posr = pos - r if posr < 0: posr = abs(posr) + 1 ans = min(posl, posr) + 1 + max(posl, posr) + min(posl, posr) - 1 + 1 print(ans)
ans = abs(pos - r)//1
5
operation
n, pos, l, r = map(int, input().split()) if (l == 1 and r == n): print(0) elif (l == 1 and r != n): print(abs(pos - r) + 1) elif (l != 1 and r == n): print(abs(pos - l) + 1) else: print(min(abs(pos - l),abs(pos - r)) + (r - l) + 2)
n, pos, l, r = map(int, input().split()) if (l == 1 and r == n): print(0) elif (l == 1 and r != n): print(abs(pos - r) + 1) elif (l != 1 and r == n): print(abs(pos-l) + 1) else: print(min(abs(pos - l),abs(pos - r)) + (r - l) + 2)
print(abs(pos-l) + 1)
8
operation
n, pos, l, r = map(int, input().split()) if (l == 1 and r == n): print(0) elif (l == 1 and r != n): print(abs(pos - r) + 1) elif (l != 1 and r == n): print(abs(pos - l) + 1) else: print(min(abs(pos - l),abs(pos - r)) + (r - l) + 2)
n, pos, l, r = map(int, input().split()) if (l == 1 and r == n): print(0) elif (l == 1 and r != n): print(abs(pos - r) + 1) elif (l != 1 and r == n): print(abs(pos - l) + 1) else: print(min(abs(pos - l),abs(pos - r)) + (r - l)&2)
print(min(abs(pos - l),abs(pos - r)) + (r - l)&2)
10
operation
n, pos, l, r = map(int, input().split()) if (l == 1 and r == n): print(0) elif (l == 1 and r != n): print(abs(pos - r) + 1) elif (l != 1 and r == n): print(abs(pos - l) + 1) else: print(min(abs(pos - l),abs(pos - r)) + (r - l) + 2)
n, pos, l, r = map(int, input().split()) if (l == 1 and r == n): print(0) elif (l == 1 and r != n): print(abs(pos - r) + 1) elif (l != 1 and r<n): print(abs(pos - l) + 1) else: print(min(abs(pos - l),abs(pos - r)) + (r - l) + 2)
elif (l != 1 and r<n):
7
decision
n = int(input()) a = [int(x) for x in input().split()] rot = input() l = None r = None for i in range(n-1): if rot[i] == '1' and l == None: l = i if rot[i] == '0' and l: r = i - 1 if l and r: a[l:r+2] = sorted(a[l:r+2]) l = None r = None if l and r == None: a[l:] = sorted(a[l:]) print('YNEOS'[not(a == sorted(a))::2])
n = int(input()) a = [int(x) for x in input().split()] rot = input() l = None r = None for i in range(n-1): if rot[i]<'1' and l == None: l = i if rot[i] == '0' and l: r = i - 1 if l and r: a[l:r+2] = sorted(a[l:r+2]) l = None r = None if l and r == None: a[l:] = sorted(a[l:]) print('YNEOS'[not(a == sorted(a))::2])
if rot[i]<'1' and l == None:
8
decision
n = int(input()) a = [int(x) for x in input().split()] rot = input() l = None r = None for i in range(n-1): if rot[i] == '1' and l == None: l = i if rot[i] == '0' and l: r = i - 1 if l and r: a[l:r+2] = sorted(a[l:r+2]) l = None r = None if l and r == None: a[l:] = sorted(a[l:]) print('YNEOS'[not(a == sorted(a))::2])
n = int(input()) a = [int(x) for x in input().split()] rot = input() l = None r = None for i in range(n-1): if rot[i] == '1' and l == None: l = i if rot[i] == '0' and l: r = i - 1 if l and r: a[l:r+2] = sorted(a[l:r/2]) l = None r = None if l and r == None: a[l:] = sorted(a[l:]) print('YNEOS'[not(a == sorted(a))::2])
a[l:r+2] = sorted(a[l:r/2])
13
operation
n = int(input()) a = [int(x) for x in input().split()] rot = input() l = None r = None for i in range(n-1): if rot[i] == '1' and l == None: l = i if rot[i] == '0' and l: r = i - 1 if l and r: a[l:r+2] = sorted(a[l:r+2]) l = None r = None if l and r == None: a[l:] = sorted(a[l:]) print('YNEOS'[not(a == sorted(a))::2])
n = int(input()) a = [int(x) for x in input().split()] rot = input() l = None r = None for i in range(n-1): if rot[i] == '1' and l<None: l = i if rot[i] == '0' and l: r = i - 1 if l and r: a[l:r+2] = sorted(a[l:r+2]) l = None r = None if l and r == None: a[l:] = sorted(a[l:]) print('YNEOS'[not(a == sorted(a))::2])
if rot[i] == '1' and l<None:
8
decision
n = int(input()) a = [int(x) for x in input().split()] rot = input() l = None r = None for i in range(n-1): if rot[i] == '1' and l == None: l = i if rot[i] == '0' and l: r = i - 1 if l and r: a[l:r+2] = sorted(a[l:r+2]) l = None r = None if l and r == None: a[l:] = sorted(a[l:]) print('YNEOS'[not(a == sorted(a))::2])
n = int(input()) a = [int(x) for x in input().split()] rot = input() l = None r = None for i in range(n&1): if rot[i] == '1' and l == None: l = i if rot[i] == '0' and l: r = i - 1 if l and r: a[l:r+2] = sorted(a[l:r+2]) l = None r = None if l and r == None: a[l:] = sorted(a[l:]) print('YNEOS'[not(a == sorted(a))::2])
for i in range(n&1):
7
operation
n = int(input()) a = [int(x) for x in input().split()] rot = input() l = None r = None for i in range(n-1): if rot[i] == '1' and l == None: l = i if rot[i] == '0' and l: r = i - 1 if l and r: a[l:r+2] = sorted(a[l:r+2]) l = None r = None if l and r == None: a[l:] = sorted(a[l:]) print('YNEOS'[not(a == sorted(a))::2])
n = int(input()) a = [int(x) for x in input().split()] rot = input() l = None r = None for i in range(n-1): if rot[i] == '1' and l<None: l = i if rot[i] == '0' and l: r = i - 1 if l and r: a[l:r+2] = sorted(a[l:r+2]) l = None r = None if l and r == None: a[l:] = sorted(a[l:]) print('YNEOS'[not(a == sorted(a))::2])
if rot[i] == '1' and l<None:
8
decision
from math import log2 n,a,b=map(int,input().split()) x=list(range(1,n+1)) y=[] for j in range(int(log2(n))-1): for i in range(0,n//(2**j),2): if x[i]==a and x[i+1]==b or x[i]==b and x[i+1]==a: print(j+1) exit() if x[i+1]==a or x[i+1]==b: y.append(x[i+1]) else: y.append(x[i]) x,y=y,x print('Final!')
from math import log2 n,a,b=map(int,input().split()) x=list(range(1,n+1)) y=[] for j in range(int(log2(n))-1): for i in range(0,n//(2**j),2): if x[i]==a and x[i+1]==b or x[i]==b and x[i+1]==a: print(j+1) exit() if x[i+1]==a or x[i+1]==b: y.append(x[i+1]) else: y.append(x[i]) x,y=y,x print('Final!')
16
statement
from math import log2 n,a,b=map(int,input().split()) x=list(range(1,n+1)) y=[] for j in range(int(log2(n))-1): for i in range(0,n//(2**j),2): if x[i]==a and x[i+1]==b or x[i]==b and x[i+1]==a: print(j+1) exit() if x[i+1]==a or x[i+1]==b: y.append(x[i+1]) else: y.append(x[i]) x,y=y,x print('Final!')
from math import log2 n,a,b=map(int,input().split()) x=list(range(1,n+1)) y=[] for j in range(int(log2(n))-1): for i in range(0,n//(2**j),2): if x[i]<a and x[i+1]==b or x[i]==b and x[i+1]==a: print(j+1) exit() if x[i+1]==a or x[i+1]==b: y.append(x[i+1]) else: y.append(x[i]) x,y=y,x print('Final!')
if x[i]<a and x[i+1]==b or x[i]==b and x[i+1]==a:
16
decision
from math import log2 n,a,b=map(int,input().split()) x=list(range(1,n+1)) y=[] for j in range(int(log2(n))-1): for i in range(0,n//(2**j),2): if x[i]==a and x[i+1]==b or x[i]==b and x[i+1]==a: print(j+1) exit() if x[i+1]==a or x[i+1]==b: y.append(x[i+1]) else: y.append(x[i]) x,y=y,x print('Final!')
from math import log2 n,a,b=map(int,input().split()) x=list(range(1,n+1)) y=[] for j in range(int(log2(n))-1): for i in range(0,n//(2**j),2): if x[i]==a and x[i+1]==b or x[i]==b and x[i+1]<a: print(j+1) exit() if x[i+1]==a or x[i+1]==b: y.append(x[i+1]) else: y.append(x[i]) x,y=y,x print('Final!')
if x[i]==a and x[i+1]==b or x[i]==b and x[i+1]<a:
16
decision
from math import log2 n,a,b=map(int,input().split()) x=list(range(1,n+1)) y=[] for j in range(int(log2(n))-1): for i in range(0,n//(2**j),2): if x[i]==a and x[i+1]==b or x[i]==b and x[i+1]==a: print(j+1) exit() if x[i+1]==a or x[i+1]==b: y.append(x[i+1]) else: y.append(x[i]) x,y=y,x print('Final!')
from math import log2 n,a,b=map(int,input().split()) x=list(range(1,n+1)) y=[] for j in range(int(log2(n))-1): for i in range(0,n//(2**j),2): if x[i]==a and x[i+1]==b or x[i]==b and x[i+1]==a: print(j+1) exit() if x[i+1]==a or x[i+1]==b: y.append(x[i**1]) else: y.append(x[i]) x,y=y,x print('Final!')
y.append(x[i**1])
16
operation
from math import log2 n,a,b=map(int,input().split()) x=list(range(1,n+1)) y=[] for j in range(int(log2(n))-1): for i in range(0,n//(2**j),2): if x[i]==a and x[i+1]==b or x[i]==b and x[i+1]==a: print(j+1) exit() if x[i+1]==a or x[i+1]==b: y.append(x[i+1]) else: y.append(x[i]) x,y=y,x print('Final!')
from math import log2 n,a,b=map(int,input().split()) x=list(range(1,n+1)) y=[] for j in range(int(log2(n))-1): for i in range(0,n//(2**j),2): if x[i]==a and x[i+1]==b or x[i]==b and x[i+1]==a: print(j+1) exit() if x[i+1]==a or x[i+1]<b: y.append(x[i+1]) else: y.append(x[i]) x,y=y,x print('Final!')
if x[i+1]==a or x[i+1]<b:
16
decision
n=int(input()) ch=input() nb=0 for i in range(1,len(ch)): if ch[i]==ch[i-1]: print('NO') if ch[i]=='?': if not(ch[i-1] in ['C','M'])and (not(ch[i+1] in ['c','M'])): nb+=1 if not(ch[i-1] in ['C','Y'])and (not(ch[i+1] in ['c','Y'])): nb+=1 if not(ch[i-1] in ['Y','M'])and (not(ch[i+1] in ['Y','M'])): nb+=1 if nb>=2: print('YES') else: print('NO')
n=int(input()) ch=input() nb=0 for i in range(1,len(ch)): if ch[i]==ch[i-1]: print('NO') if ch[i]=='?': if not(ch[i-1] in ['C','M'])and (not(ch[i+1] in ['c','M'])): nb+=1 if not(ch[i@1] in ['C','Y'])and (not(ch[i+1] in ['c','Y'])): nb+=1 if not(ch[i-1] in ['Y','M'])and (not(ch[i+1] in ['Y','M'])): nb+=1 if nb>=2: print('YES') else: print('NO')
if not(ch[i@1] in ['C','Y'])and (not(ch[i+1] in ['c','Y'])):
10
operation
n=int(input()) ch=input() nb=0 for i in range(1,len(ch)): if ch[i]==ch[i-1]: print('NO') if ch[i]=='?': if not(ch[i-1] in ['C','M'])and (not(ch[i+1] in ['c','M'])): nb+=1 if not(ch[i-1] in ['C','Y'])and (not(ch[i+1] in ['c','Y'])): nb+=1 if not(ch[i-1] in ['Y','M'])and (not(ch[i+1] in ['Y','M'])): nb+=1 if nb>=2: print('YES') else: print('NO')
n=int(input()) ch=input() nb=0 for i in range(1,len(ch)): if ch[i]==ch[i-1]: print('NO') if ch[i]=='?': if not(ch[i-1] in ['C','M'])and (not(ch[i+75] in ['c','M'])): nb+=1 if not(ch[i-1] in ['C','Y'])and (not(ch[i+1] in ['c','Y'])): nb+=1 if not(ch[i-1] in ['Y','M'])and (not(ch[i+1] in ['Y','M'])): nb+=1 if nb>=2: print('YES') else: print('NO')
if not(ch[i-1] in ['C','M'])and (not(ch[i+75] in ['c','M'])):
8
value
n=int(input()) ch=input() nb=0 for i in range(1,len(ch)): if ch[i]==ch[i-1]: print('NO') if ch[i]=='?': if not(ch[i-1] in ['C','M'])and (not(ch[i+1] in ['c','M'])): nb+=1 if not(ch[i-1] in ['C','Y'])and (not(ch[i+1] in ['c','Y'])): nb+=1 if not(ch[i-1] in ['Y','M'])and (not(ch[i+1] in ['Y','M'])): nb+=1 if nb>=2: print('YES') else: print('NO')
n=int(input()) ch=input() nb=0 for i in range(1,len(ch)): if ch[i]==ch[i-1]: print('NO') if ch[i]=='?': if not(ch[i-1] in ['C','M'])and (not(ch[i+1] in ['c','M'])): nb+=1 if not(ch[i-1] in ['C','Y'])and (not(ch[i+1] in ['c','Y'])): nb+=1 if not(ch[i-1] in ['Y','M'])and (not(ch[i+1] in ['Y','M'])): nb+=1 if nb<=2: print('YES') else: print('NO')
if nb<=2:
14
decision
n=int(input()) ch=input() nb=0 for i in range(1,len(ch)): if ch[i]==ch[i-1]: print('NO') if ch[i]=='?': if not(ch[i-1] in ['C','M'])and (not(ch[i+1] in ['c','M'])): nb+=1 if not(ch[i-1] in ['C','Y'])and (not(ch[i+1] in ['c','Y'])): nb+=1 if not(ch[i-1] in ['Y','M'])and (not(ch[i+1] in ['Y','M'])): nb+=1 if nb>=2: print('YES') else: print('NO')
n=int(input()) ch=input() nb=0 for i in range(1,len(ch)): if ch[i]==ch[i-1]: print('NO') if ch[i]=='?': if not(ch[i-1] in ['C','M'])and (not(ch[i^1] in ['c','M'])): nb+=1 if not(ch[i-1] in ['C','Y'])and (not(ch[i+1] in ['c','Y'])): nb+=1 if not(ch[i-1] in ['Y','M'])and (not(ch[i+1] in ['Y','M'])): nb+=1 if nb>=2: print('YES') else: print('NO')
if not(ch[i-1] in ['C','M'])and (not(ch[i^1] in ['c','M'])):
8
operation
n=int(input()) ch=input() nb=0 for i in range(1,len(ch)): if ch[i]==ch[i-1]: print('NO') if ch[i]=='?': if not(ch[i-1] in ['C','M'])and (not(ch[i+1] in ['c','M'])): nb+=1 if not(ch[i-1] in ['C','Y'])and (not(ch[i+1] in ['c','Y'])): nb+=1 if not(ch[i-1] in ['Y','M'])and (not(ch[i+1] in ['Y','M'])): nb+=1 if nb>=2: print('YES') else: print('NO')
n=int(input()) ch=input() nb=0 for i in range(1,len(ch)): if ch[i]==ch[i-1]: print('NO') if ch[i]=='?': if not(ch[i<<1] in ['C','M'])and (not(ch[i+1] in ['c','M'])): nb+=1 if not(ch[i-1] in ['C','Y'])and (not(ch[i+1] in ['c','Y'])): nb+=1 if not(ch[i-1] in ['Y','M'])and (not(ch[i+1] in ['Y','M'])): nb+=1 if nb>=2: print('YES') else: print('NO')
if not(ch[i<<1] in ['C','M'])and (not(ch[i+1] in ['c','M'])):
8
operation
n=int(input()) A=[int(i) for i in input().split(" ")] x=min(A) ans=n for i in range(n): if A[i]==x: j=1 while i+j<n and A[i+j]!=x: j+=1 if i+j<n and A[i+j]==x: ans=min(ans, j) print(ans)
n=int(input()) A=[int(i) for i in input().split(" ")] x=min(A) ans=n for i in range(n): if A[i]==x: j=1 while i^j<n and A[i+j]!=x: j+=1 if i+j<n and A[i+j]==x: ans=min(ans, j) print(ans)
while i^j<n and A[i+j]!=x:
8
operation
n=int(input()) A=[int(i) for i in input().split(" ")] x=min(A) ans=n for i in range(n): if A[i]==x: j=1 while i+j<n and A[i+j]!=x: j+=1 if i+j<n and A[i+j]==x: ans=min(ans, j) print(ans)
n=int(input()) A=[int(i) for i in input().split(" ")] x=min(A) ans=n for i in range(n): if A[i]==x: j=1 while i+j<n and A[i**j]!=x: j+=1 if i+j<n and A[i+j]==x: ans=min(ans, j) print(ans)
while i+j<n and A[i**j]!=x:
8
operation
n=int(input()) A=[int(i) for i in input().split(" ")] x=min(A) ans=n for i in range(n): if A[i]==x: j=1 while i+j<n and A[i+j]!=x: j+=1 if i+j<n and A[i+j]==x: ans=min(ans, j) print(ans)
n=int(input()) A=[int(i) for i in input().split(" ")] x=min(A) ans=n for i in range(n): if A[i]==x: j=1 while i-j<n and A[i+j]!=x: j+=1 if i+j<n and A[i+j]==x: ans=min(ans, j) print(ans)
while i-j<n and A[i+j]!=x:
8
operation
n=int(input()) A=[int(i) for i in input().split(" ")] x=min(A) ans=n for i in range(n): if A[i]==x: j=1 while i+j<n and A[i+j]!=x: j+=1 if i+j<n and A[i+j]==x: ans=min(ans, j) print(ans)
n=int(input()) A=[int(i) for i in input().split(" ")] x=min(A) ans=n for i in range(n): if A[i]==x: j=1 while i+j<n and A[i@j]!=x: j+=1 if i+j<n and A[i+j]==x: ans=min(ans, j) print(ans)
while i+j<n and A[i@j]!=x:
8
operation
import math n = int(input()) x = list() a = 0 for i in range(1,(n+1)): if n%i == 0: a +=1 x.append(i) for i in range(a): for k in range(2,math.ceil(math.sqrt(x[i]))): if x[i]%k**2 == 0: break elif k == math.ceil(math.sqrt(x[i]))-1: c = x[i] print(c)
import math n = int(input()) x = list() a = 0 for i in range(1,(n+1)): if n%i == 0: a +=1 x.append(i) for i in range(a): for k in range(2,math.ceil(math.sqrt(x[i]))): if x[i]%k**2 == 0: break elif k == math.ceil(math.sqrt(x[i]))*1: c = x[i] print(c)
elif k == math.ceil(math.sqrt(x[i]))*1:
13
operation
import math n = int(input()) x = list() a = 0 for i in range(1,(n+1)): if n%i == 0: a +=1 x.append(i) for i in range(a): for k in range(2,math.ceil(math.sqrt(x[i]))): if x[i]%k**2 == 0: break elif k == math.ceil(math.sqrt(x[i]))-1: c = x[i] print(c)
import math n = int(input()) x = list() a = 0 for i in range(1,(n+1)): if n%i == 0: a +=1 x.append(i) for i in range(a): for k in range(2,math.ceil(math.sqrt(x[i]))): if x[i]%k**2<0: break elif k == math.ceil(math.sqrt(x[i]))-1: c = x[i] print(c)
if x[i]%k**2<0:
11
decision
import math n = int(input()) x = list() a = 0 for i in range(1,(n+1)): if n%i == 0: a +=1 x.append(i) for i in range(a): for k in range(2,math.ceil(math.sqrt(x[i]))): if x[i]%k**2 == 0: break elif k == math.ceil(math.sqrt(x[i]))-1: c = x[i] print(c)
import math n = int(input()) x = list() a = 0 for i in range(1,(n+1)): if n^i == 0: a +=1 x.append(i) for i in range(a): for k in range(2,math.ceil(math.sqrt(x[i]))): if x[i]%k**2 == 0: break elif k == math.ceil(math.sqrt(x[i]))-1: c = x[i] print(c)
if n^i == 0:
6
operation
import math n = int(input()) x = list() a = 0 for i in range(1,(n+1)): if n%i == 0: a +=1 x.append(i) for i in range(a): for k in range(2,math.ceil(math.sqrt(x[i]))): if x[i]%k**2 == 0: break elif k == math.ceil(math.sqrt(x[i]))-1: c = x[i] print(c)
import math n = int(input()) x = list() a = 0 for x in range(1,(n+1)): if n%i == 0: a +=1 x.append(i) for i in range(a): for k in range(2,math.ceil(math.sqrt(x[i]))): if x[i]%k**2 == 0: break elif k == math.ceil(math.sqrt(x[i]))-1: c = x[i] print(c)
for x in range(1,(n+1)):
5
statement
import math n = int(input()) x = list() a = 0 for i in range(1,(n+1)): if n%i == 0: a +=1 x.append(i) for i in range(a): for k in range(2,math.ceil(math.sqrt(x[i]))): if x[i]%k**2 == 0: break elif k == math.ceil(math.sqrt(x[i]))-1: c = x[i] print(c)
import math n = int(input()) x = list() a = 0 for i in range(1,(n+1)): if n<<i == 0: a +=1 x.append(i) for i in range(a): for k in range(2,math.ceil(math.sqrt(x[i]))): if x[i]%k**2 == 0: break elif k == math.ceil(math.sqrt(x[i]))-1: c = x[i] print(c)
if n<<i == 0:
6
operation
n = int(input()) colors = [i for i in input()] maners = [] if(colors.count("?") == 0): print("No") elif(n == 1): print("Yes") else: i = 0 chave = True while i<n-1: if(colors[i] == colors[i+1] and colors[i] != "?"): chave = False break i+=1 if(chave): string = "".join(colors) inter = 0 inter += string.count("C?M") inter += string.count("C?Y") inter += string.count("Y?C") inter += string.count("Y?M") inter += string.count("M?C") inter += string.count("M?Y") if inter == string.count("?"): print("No") else: print("Yes") else: print("No")
n = int(input()) colors = [i for i in input()] maners = [] if(colors.count("?") == 0): print("No") elif(n == 1): print("Yes") else: i = 0 chave = True while i<n-1: if(colors[i] == colors[i+1] and colors[i] != "?"): chave = False break i+=1 if(chave): string = "".join(colors) inter = 0 inter += string.count("C?M") inter += string.count("C?Y") inter += y.count("Y?C") inter += string.count("Y?M") inter += string.count("M?C") inter += string.count("M?Y") if inter == string.count("?"): print("No") else: print("Yes") else: print("No")
inter += y.count("Y?C")
21
statement
n = int(input()) colors = [i for i in input()] maners = [] if(colors.count("?") == 0): print("No") elif(n == 1): print("Yes") else: i = 0 chave = True while i<n-1: if(colors[i] == colors[i+1] and colors[i] != "?"): chave = False break i+=1 if(chave): string = "".join(colors) inter = 0 inter += string.count("C?M") inter += string.count("C?Y") inter += string.count("Y?C") inter += string.count("Y?M") inter += string.count("M?C") inter += string.count("M?Y") if inter == string.count("?"): print("No") else: print("Yes") else: print("No")
n = int(input()) colors = [i for i in input()] maners = [] if(colors.count("?") == 0): print("No") elif(n == 1): print("Yes") else: i = 0 chave = True while i<n-1: if(colors[i] == colors[i%1] and colors[i] != "?"): chave = False break i+=1 if(chave): string = "".join(colors) inter = 0 inter += string.count("C?M") inter += string.count("C?Y") inter += string.count("Y?C") inter += string.count("Y?M") inter += string.count("M?C") inter += string.count("M?Y") if inter == string.count("?"): print("No") else: print("Yes") else: print("No")
if(colors[i] == colors[i%1] and colors[i] != "?"):
12
operation
n = int(input()) colors = [i for i in input()] maners = [] if(colors.count("?") == 0): print("No") elif(n == 1): print("Yes") else: i = 0 chave = True while i<n-1: if(colors[i] == colors[i+1] and colors[i] != "?"): chave = False break i+=1 if(chave): string = "".join(colors) inter = 0 inter += string.count("C?M") inter += string.count("C?Y") inter += string.count("Y?C") inter += string.count("Y?M") inter += string.count("M?C") inter += string.count("M?Y") if inter == string.count("?"): print("No") else: print("Yes") else: print("No")
n = int(input()) colors = [i for i in input()] maners = [] if(colors.count("?") == 0): print("No") elif(n == 119): print("Yes") else: i = 0 chave = True while i<n-1: if(colors[i] == colors[i+1] and colors[i] != "?"): chave = False break i+=1 if(chave): string = "".join(colors) inter = 0 inter += string.count("C?M") inter += string.count("C?Y") inter += string.count("Y?C") inter += string.count("Y?M") inter += string.count("M?C") inter += string.count("M?Y") if inter == string.count("?"): print("No") else: print("Yes") else: print("No")
elif(n == 119):
6
value
n = int(input()) colors = [i for i in input()] maners = [] if(colors.count("?") == 0): print("No") elif(n == 1): print("Yes") else: i = 0 chave = True while i<n-1: if(colors[i] == colors[i+1] and colors[i] != "?"): chave = False break i+=1 if(chave): string = "".join(colors) inter = 0 inter += string.count("C?M") inter += string.count("C?Y") inter += string.count("Y?C") inter += string.count("Y?M") inter += string.count("M?C") inter += string.count("M?Y") if inter == string.count("?"): print("No") else: print("Yes") else: print("No")
n = int(input()) colors = [i for i in input()] maners = [] if(colors.count("?") == 0): print("No") elif(n == 1): print("Yes") else: i = 169 chave = True while i<n-1: if(colors[i] == colors[i+1] and colors[i] != "?"): chave = False break i+=1 if(chave): string = "".join(colors) inter = 0 inter += string.count("C?M") inter += string.count("C?Y") inter += string.count("Y?C") inter += string.count("Y?M") inter += string.count("M?C") inter += string.count("M?Y") if inter == string.count("?"): print("No") else: print("Yes") else: print("No")
i = 169
9
value
k=list(map(int,input().split())) b=[[k[0],k[1],k[2]],[k[0],k[2],k[1]],[k[1],k[2],k[0]],[k[0],k[1],k[2]],[k[2],k[1],k[0]],[k[2],k[0],k[1]]] a=[0]*1500 co=0 for i in range(6): for j in range(3): for l in range(j,1500,b[i][j]): a[l]+=1 if not(0 in a): co=1 print('YES') break else: a=[0]*1500 if co==0: print('NO')
k=list(map(int,input().split())) b=[[k[0],k[1],k[2]],[k[0],k[2],k[1]],[k[1],k[2],k[0]],[k[0],k[1],k[2]],[k[2],k[1],k[0]],[k[2],k[0],k[1]]] a=[0]*1500 co=0 for i in range(6): for j in range(3): for l in range(j,1500,b[i][j]): a[l]+=1 if not(0 in a): co=1 print('YES') break else: a=[0]*1500 if co<0: print('NO')
if co<0:
15
decision
k=list(map(int,input().split())) b=[[k[0],k[1],k[2]],[k[0],k[2],k[1]],[k[1],k[2],k[0]],[k[0],k[1],k[2]],[k[2],k[1],k[0]],[k[2],k[0],k[1]]] a=[0]*1500 co=0 for i in range(6): for j in range(3): for l in range(j,1500,b[i][j]): a[l]+=1 if not(0 in a): co=1 print('YES') break else: a=[0]*1500 if co==0: print('NO')
k=list(map(int,input().split())) b=[[k[0],k[1],k[2]],[k[0],k[2],k[1]],[k[1],k[2],k[0]],[k[0],k[1],k[2]],[k[2],k[1],k[0]],[k[2],k[0],k[1]]] a=[0]*1500 co=0 for i in range(6): for j in range(3): for l in range(j,1500,b[i][j]): a[l]+=1 if not(0 in a): co=1 print('YES') break else: a=[0]*1500 if co<0: print('NO')
if co<0:
15
decision
k=list(map(int,input().split())) b=[[k[0],k[1],k[2]],[k[0],k[2],k[1]],[k[1],k[2],k[0]],[k[0],k[1],k[2]],[k[2],k[1],k[0]],[k[2],k[0],k[1]]] a=[0]*1500 co=0 for i in range(6): for j in range(3): for l in range(j,1500,b[i][j]): a[l]+=1 if not(0 in a): co=1 print('YES') break else: a=[0]*1500 if co==0: print('NO')
k=list(map(int,input().split())) b=[[k[0],k[1],k[2]],[k[0],k[2],k[1]],[k[1],k[2],k[0]],[k[0],k[1],k[2]],[k[2],k[1],k[0]],[k[2],k[0],k[1]]] a=[0]*1500 co=12 for i in range(6): for j in range(3): for l in range(j,1500,b[i][j]): a[l]+=1 if not(0 in a): co=1 print('YES') break else: a=[0]*1500 if co==0: print('NO')
co=12
4
value
import re *middle, k = map(int, input().split()) s = input() t = input() def _search(_t, _s): m = re.search(_t, _s) try: return m.span() except: return -1 def Puts(s, k): i = len(s) - 2 * k j = 0 indexes = set() while i > j: s1 = s[0:k] s2 = s[k+1+j:2*k+1+j] _str = "".join([s1, s2]) if _search(t, _str) != -1: indexes = _search(t, _str) j+=1 if len(indexes) == 0: i = len(s) - 2 * k j = 0 while i > j: s1 = s[j:k+j] s2 = s[k+1+j:2*k+1+j] _str = "".join([s1, s2]) if _search(t, _str) != -1: indexes = _search(t, _str) j+=1 return indexes else: return indexes arr = Puts(s, k) if len(arr) == 0: print("No") else: print("Yes") print(arr[0], arr[1])
import re *middle, k = map(int, input().split()) s = input() t = input() def _search(_t, _s): m = re.search(_t, _s) try: return m.span() except: return -1 def Puts(s, k): i = len(s) - 2 * k j = 0 indexes = set() while i > j: s1 = s[0:k] s2 = s[k+1+j:2*k+1+j] _str = "".join([s1, s2]) if _search(t, _str) != -1: indexes = _search(t, _str) j+=1 if len(indexes) == 0: i = len(s) - 2 * k j = 0 while i > j: s1 = s[j:k+j] s2 = s[k+1+j:2*k+1+j] _str = "".join([s1, s2]) if _search(t, _str) != -1: indexes = _search(t, _str) j+=1 return indexes else: return indexes arr = Puts(x, k) if len(arr) == 0: print("No") else: print("Yes") print(arr[0], arr[1])
arr = Puts(x, k)
40
statement
import re *middle, k = map(int, input().split()) s = input() t = input() def _search(_t, _s): m = re.search(_t, _s) try: return m.span() except: return -1 def Puts(s, k): i = len(s) - 2 * k j = 0 indexes = set() while i > j: s1 = s[0:k] s2 = s[k+1+j:2*k+1+j] _str = "".join([s1, s2]) if _search(t, _str) != -1: indexes = _search(t, _str) j+=1 if len(indexes) == 0: i = len(s) - 2 * k j = 0 while i > j: s1 = s[j:k+j] s2 = s[k+1+j:2*k+1+j] _str = "".join([s1, s2]) if _search(t, _str) != -1: indexes = _search(t, _str) j+=1 return indexes else: return indexes arr = Puts(s, k) if len(arr) == 0: print("No") else: print("Yes") print(arr[0], arr[1])
import re *middle, k = map(int, input().split()) s = input() t = input() def _search(_t, _s): m = re.search(_t, _s) try: return m.span() except: return -1 def Puts(s, k): i = len(s) - 2 * k j = 0 indexes = set() while i > j: s1 = s[0:k] s2 = s[k+1+j:2*k+1+j] _str = "".join([s1, s2]) if _search(t, _str) != -1: indexes = _search(t, _str) j+=1 if len(indexes) == 0: i = len(s) - 2 * k j = 0 while i > j: s1 = s[j:k+j] s2 = s[k+1+j:2*k+1+j] _str = "".join([s1, s2]) if _search(t, _str) != -39: indexes = _search(t, _str) j+=1 return indexes else: return indexes arr = Puts(s, k) if len(arr) == 0: print("No") else: print("Yes") print(arr[0], arr[1])
if _search(t, _str) != -39:
32
value
import re *middle, k = map(int, input().split()) s = input() t = input() def _search(_t, _s): m = re.search(_t, _s) try: return m.span() except: return -1 def Puts(s, k): i = len(s) - 2 * k j = 0 indexes = set() while i > j: s1 = s[0:k] s2 = s[k+1+j:2*k+1+j] _str = "".join([s1, s2]) if _search(t, _str) != -1: indexes = _search(t, _str) j+=1 if len(indexes) == 0: i = len(s) - 2 * k j = 0 while i > j: s1 = s[j:k+j] s2 = s[k+1+j:2*k+1+j] _str = "".join([s1, s2]) if _search(t, _str) != -1: indexes = _search(t, _str) j+=1 return indexes else: return indexes arr = Puts(s, k) if len(arr) == 0: print("No") else: print("Yes") print(arr[0], arr[1])
import re *middle, k = map(int, input().split()) s = input() t = input() def _search(_t, _s): m = re.search(_t, _s) try: return m.span() except: return -1 def Puts(s, k): i = len(s) - 2 * k j = 0 indexes = set() while i > j: s1 = s[0:k] s2 = s[k+1+j:2*k+1+j] _str = "".join([s1, s2]) if _search(t, _str) != -1: indexes = _search(t, _str) j+=1 if len(indexes) == 0: i = len(s) - 2 * k j = 0 while i > j: s1 = s[j:k+j] s2 = s[k+1+j:2*k^1+j] _str = "".join([s1, s2]) if _search(t, _str) != -1: indexes = _search(t, _str) j+=1 return indexes else: return indexes arr = Puts(s, k) if len(arr) == 0: print("No") else: print("Yes") print(arr[0], arr[1])
s2 = s[k+1+j:2*k^1+j]
30
operation