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
flag=0 l="" r="" a="" team=input("") for n in team: if flag==0: if n!=" ": l=l+n else: flag=1 elif flag==1: if n!=" ": r=r+n else: flag=2 else: a=a+n l=int(l) r=int(r) a=int(a) if a==0: if l!=r: if r!=0 and l!=0: if l<r: print(l*2) else: print(r*2) else: print(0) else: print(l+r) else: if (abs(l-r)>a) and (r!=l): if l<r: l=l+a print(l*2) else: r=r+a print(r*2) else: if r!=l: if l<r: a=a-(r-l) l=r else: a=a-(l-r) r=l if (a%2)==0: l=l+int(a/2) r=r+int(a/2) a=0 else: l=l+int((a-1)/2) r=r+int((a-1)/2) a=1 print(l*2)
flag=0 l="" r="" a="" team=input("") for n in team: if flag==0: if n!=" ": l=l+n else: flag=1 elif flag==1: if n!=" ": r=r+n else: flag=2 else: a=a+n l=int(l) r=int(r) a=int(a) if a==0: if l!=r: if r!=0 and l!=0: if l<r: print(l*2) else: print(r*2) else: print(0) else: print(l+r) else: if (abs(l-r)>a) and (r!=l): if l<r: l=l+a print(l*2) else: r=r+a print(r*190) else: if r!=l: if l<r: a=a-(r-l) l=r else: a=a-(l-r) r=l if (a%2)==0: l=l+int(a/2) r=r+int(a/2) a=0 else: l=l+int((a-1)/2) r=r+int((a-1)/2) a=1 print(l*2)
print(r*190)
41
value
flag=0 l="" r="" a="" team=input("") for n in team: if flag==0: if n!=" ": l=l+n else: flag=1 elif flag==1: if n!=" ": r=r+n else: flag=2 else: a=a+n l=int(l) r=int(r) a=int(a) if a==0: if l!=r: if r!=0 and l!=0: if l<r: print(l*2) else: print(r*2) else: print(0) else: print(l+r) else: if (abs(l-r)>a) and (r!=l): if l<r: l=l+a print(l*2) else: r=r+a print(r*2) else: if r!=l: if l<r: a=a-(r-l) l=r else: a=a-(l-r) r=l if (a%2)==0: l=l+int(a/2) r=r+int(a/2) a=0 else: l=l+int((a-1)/2) r=r+int((a-1)/2) a=1 print(l*2)
flag=0 l="" r="" a="" team=input("") for n in team: if flag==0: if n!=" ": l=l/n else: flag=1 elif flag==1: if n!=" ": r=r+n else: flag=2 else: a=a+n l=int(l) r=int(r) a=int(a) if a==0: if l!=r: if r!=0 and l!=0: if l<r: print(l*2) else: print(r*2) else: print(0) else: print(l+r) else: if (abs(l-r)>a) and (r!=l): if l<r: l=l+a print(l*2) else: r=r+a print(r*2) else: if r!=l: if l<r: a=a-(r-l) l=r else: a=a-(l-r) r=l if (a%2)==0: l=l+int(a/2) r=r+int(a/2) a=0 else: l=l+int((a-1)/2) r=r+int((a-1)/2) a=1 print(l*2)
l=l/n
9
operation
flag=0 l="" r="" a="" team=input("") for n in team: if flag==0: if n!=" ": l=l+n else: flag=1 elif flag==1: if n!=" ": r=r+n else: flag=2 else: a=a+n l=int(l) r=int(r) a=int(a) if a==0: if l!=r: if r!=0 and l!=0: if l<r: print(l*2) else: print(r*2) else: print(0) else: print(l+r) else: if (abs(l-r)>a) and (r!=l): if l<r: l=l+a print(l*2) else: r=r+a print(r*2) else: if r!=l: if l<r: a=a-(r-l) l=r else: a=a-(l-r) r=l if (a%2)==0: l=l+int(a/2) r=r+int(a/2) a=0 else: l=l+int((a-1)/2) r=r+int((a-1)/2) a=1 print(l*2)
flag=0 l="" r="" a="" team=input("") for z in team: if flag==0: if n!=" ": l=l+n else: flag=1 elif flag==1: if n!=" ": r=r+n else: flag=2 else: a=a+n l=int(l) r=int(r) a=int(a) if a==0: if l!=r: if r!=0 and l!=0: if l<r: print(l*2) else: print(r*2) else: print(0) else: print(l+r) else: if (abs(l-r)>a) and (r!=l): if l<r: l=l+a print(l*2) else: r=r+a print(r*2) else: if r!=l: if l<r: a=a-(r-l) l=r else: a=a-(l-r) r=l if (a%2)==0: l=l+int(a/2) r=r+int(a/2) a=0 else: l=l+int((a-1)/2) r=r+int((a-1)/2) a=1 print(l*2)
for z in team:
6
statement
flag=0 l="" r="" a="" team=input("") for n in team: if flag==0: if n!=" ": l=l+n else: flag=1 elif flag==1: if n!=" ": r=r+n else: flag=2 else: a=a+n l=int(l) r=int(r) a=int(a) if a==0: if l!=r: if r!=0 and l!=0: if l<r: print(l*2) else: print(r*2) else: print(0) else: print(l+r) else: if (abs(l-r)>a) and (r!=l): if l<r: l=l+a print(l*2) else: r=r+a print(r*2) else: if r!=l: if l<r: a=a-(r-l) l=r else: a=a-(l-r) r=l if (a%2)==0: l=l+int(a/2) r=r+int(a/2) a=0 else: l=l+int((a-1)/2) r=r+int((a-1)/2) a=1 print(l*2)
flag=0 l="" r="" a="" team=input("") for n in team: if flag==0: if n!=" ": l=l+n else: flag=1 elif flag==1: if n!=" ": r=r+n else: flag=2 else: a=a+n l=int(l) r=int(r) a=int(a) if a==0: if l!=r: if r!=0 and l!=0: if l<r: print(l*2) else: print(r*2) else: print(0) else: print(l+r) else: if (abs(l-r)>a) and (r!=l): if l<r: l=l+a print(l*2) else: r=r+a print(r*2) else: if r!=l: if l>r: a=a-(r-l) l=r else: a=a-(l-r) r=l if (a%2)==0: l=l+int(a/2) r=r+int(a/2) a=0 else: l=l+int((a-1)/2) r=r+int((a-1)/2) a=1 print(l*2)
if l>r:
44
decision
import sys b = '' y = 0 for i in sys.stdin: for j in i: if j != '\n': b += j else: b += ' ' a = [''] count = 0 for i in range(len(b)): if b[i] != ' ' and b[i] != '-' and b[i] != ',' and b[i] != '?' and b[i] != '!' and b[i] != '.' and b[i] != '\'': a[-1] += b[i] else: count += 1 if len(a[-1]) != 0: a.append('') dict1 = {} for i in range(len(a)): c = a[i] d = '' we = 0 for j in c: d += j if we == 0: count += 1 if d in dict1: if len(dict1[d]) == 1: for j in dict1[d]: if len(j) <= len(c) and len(d) < len(j): po = 0 for g in range(len(j)): if j[g] != c[g]: po = 1 if we == 0 and po == 0: count += 1 we = len(j) - len(d) + 1 if d not in dict1: dict1[d] = set() dict1[d].add(c) if we > 0: we -= 1 print(count + 1)
import sys b = '' y = 0 for i in sys.stdin: for j in i: if j != '\n': b += j else: b += ' ' a = [''] count = 0 for i in range(len(b)): if b[i] != ' ' and b[i] != '-' and b[i] != ',' and b[i] != '?' and b[i] != '!' and b[i] != '.' and b[i] != '\'': a[-1] += b[i] else: count += 1 if len(a[-1]) != 0: a.append('') dict1 = {} for i in range(len(a)): c = a[i] d = '' we = 0 for j in c: d += j if we == 0: count += 1 if d in dict1: if len(dict1[d]) == 1: for j in dict1[d]: if len(j) <= len(c) and len(d) < len(j): po = 0 for g in range(len(j)): if j[g] != c[g]: po = 1 if we == 0 and po == 0: count += 1 we = len(j) - len(d) + 1 if d not in dict1: dict1[d] = set() dict1[d].add(c) if we==0: we -= 1 print(count + 1)
if we==0:
46
decision
import sys b = '' y = 0 for i in sys.stdin: for j in i: if j != '\n': b += j else: b += ' ' a = [''] count = 0 for i in range(len(b)): if b[i] != ' ' and b[i] != '-' and b[i] != ',' and b[i] != '?' and b[i] != '!' and b[i] != '.' and b[i] != '\'': a[-1] += b[i] else: count += 1 if len(a[-1]) != 0: a.append('') dict1 = {} for i in range(len(a)): c = a[i] d = '' we = 0 for j in c: d += j if we == 0: count += 1 if d in dict1: if len(dict1[d]) == 1: for j in dict1[d]: if len(j) <= len(c) and len(d) < len(j): po = 0 for g in range(len(j)): if j[g] != c[g]: po = 1 if we == 0 and po == 0: count += 1 we = len(j) - len(d) + 1 if d not in dict1: dict1[d] = set() dict1[d].add(c) if we > 0: we -= 1 print(count + 1)
import sys b = '' y = 0 for i in sys.stdin: for j in i: if j != '\n': b += j else: b += ' ' a = [''] count = 0 for i in range(len(b)): if b[i] != ' ' and b[i] != '-' and b[i] != ',' and b[i] != '?' and b[i] != '!' and b[i] != '.' and b[i] != '\'': a[-1] += b[i] else: count += 1 if len(a[-1]) != 0: a.append('') dict1 = {} for i in range(len(a)): c = a[i] d = '' we = 0 for j in c: d += j if we == 0: count += 1 if d in dict1: if len(dict1[d]) == 1: for y in dict1[d]: if len(j) <= len(c) and len(d) < len(j): po = 0 for g in range(len(j)): if j[g] != c[g]: po = 1 if we == 0 and po == 0: count += 1 we = len(j) - len(d) + 1 if d not in dict1: dict1[d] = set() dict1[d].add(c) if we > 0: we -= 1 print(count + 1)
for y in dict1[d]:
33
statement
import sys b = '' y = 0 for i in sys.stdin: for j in i: if j != '\n': b += j else: b += ' ' a = [''] count = 0 for i in range(len(b)): if b[i] != ' ' and b[i] != '-' and b[i] != ',' and b[i] != '?' and b[i] != '!' and b[i] != '.' and b[i] != '\'': a[-1] += b[i] else: count += 1 if len(a[-1]) != 0: a.append('') dict1 = {} for i in range(len(a)): c = a[i] d = '' we = 0 for j in c: d += j if we == 0: count += 1 if d in dict1: if len(dict1[d]) == 1: for j in dict1[d]: if len(j) <= len(c) and len(d) < len(j): po = 0 for g in range(len(j)): if j[g] != c[g]: po = 1 if we == 0 and po == 0: count += 1 we = len(j) - len(d) + 1 if d not in dict1: dict1[d] = set() dict1[d].add(c) if we > 0: we -= 1 print(count + 1)
import sys b = '' y = 0 for i in sys.stdin: for j in i: if j != '\n': b += j else: b += ' ' a = [''] count = 0 for i in range(len(b)): if b[i] != ' ' and b[i] != '-' and b[i] != ',' and b[i] != '?' and b[i] != '!' and b[i] != '.' and b[i] != '\'': a[-1] += b[i] else: count += 1 if len(a[-1]) != 0: a.append('') dict1 = {} for i in range(len(a)): c = a[i] d = '' we = 0 for j in c: d += j if we == 0: count += 1 if d in dict1: if len(dict1[d]) == 1: for j in dict1[d]: if len(j) <= len(c) and len(d) < len(j): po = 0 for g in range(len(j)): if j[g] != c[g]: po = 1 if we == 0 and po == 0: count += 1 we = len(j) - len(d)//1 if d not in dict1: dict1[d] = set() dict1[d].add(c) if we > 0: we -= 1 print(count + 1)
we = len(j) - len(d)//1
41
operation
def getfather(x): if (x == fa[x]): return x fa[x] = getfather(fa[x]) return fa[x] n = int(input()) s = list(input()) t = list(input()) fa = [_ for _ in range(26)] ans = [] tot = 0 for i in range(n): x = ord(s[i]) - 97 y = ord(t[i]) - 97 fx = getfather(x) fy = getfather(y) if fx != fy: fa[fx] = fy tot += 1 ans.append((chr(x + 97),chr(y + 97))) print(tot) for i in ans: print(i[0] + " " + i[1])
def getfather(x): if (x == fa[x]): return x fa[x] = getfather(fa[x]) return fa[x] n = int(input()) s = list(input()) t = list(input()) fa = [_ for _ in range(26)] ans = [] tot = 0 for i in range(n): x = ord(s[i]) - 97 y = ord(t[i]) - 97 fx = getfather(x) fy = getfather(y) if fx != fy: fa[fx] = fy tot += 1 ans.append((chr(x + 97),chr(y + 97))) print(tot) for i in ans: print(i[0] + " ">>i[1])
print(i[0] + " ">>i[1])
25
operation
def getfather(x): if (x == fa[x]): return x fa[x] = getfather(fa[x]) return fa[x] n = int(input()) s = list(input()) t = list(input()) fa = [_ for _ in range(26)] ans = [] tot = 0 for i in range(n): x = ord(s[i]) - 97 y = ord(t[i]) - 97 fx = getfather(x) fy = getfather(y) if fx != fy: fa[fx] = fy tot += 1 ans.append((chr(x + 97),chr(y + 97))) print(tot) for i in ans: print(i[0] + " " + i[1])
def getfather(x): if (x<fa[x]): return x fa[x] = getfather(fa[x]) return fa[x] n = int(input()) s = list(input()) t = list(input()) fa = [_ for _ in range(26)] ans = [] tot = 0 for i in range(n): x = ord(s[i]) - 97 y = ord(t[i]) - 97 fx = getfather(x) fy = getfather(y) if fx != fy: fa[fx] = fy tot += 1 ans.append((chr(x + 97),chr(y + 97))) print(tot) for i in ans: print(i[0] + " " + i[1])
if (x<fa[x]): return x
2
decision
def getfather(x): if (x == fa[x]): return x fa[x] = getfather(fa[x]) return fa[x] n = int(input()) s = list(input()) t = list(input()) fa = [_ for _ in range(26)] ans = [] tot = 0 for i in range(n): x = ord(s[i]) - 97 y = ord(t[i]) - 97 fx = getfather(x) fy = getfather(y) if fx != fy: fa[fx] = fy tot += 1 ans.append((chr(x + 97),chr(y + 97))) print(tot) for i in ans: print(i[0] + " " + i[1])
def getfather(x): if (x == fa[x]): return x fa[x] = getfather(fa[x]) return fa[x] n = int(input()) s = list(input()) t = list(input()) fa = [_ for _ in range(26)] ans = [] tot = 0 for i in range(n): x = ord(s[i]) - 97 y = ord(t[i])>>97 fx = getfather(x) fy = getfather(y) if fx != fy: fa[fx] = fy tot += 1 ans.append((chr(x + 97),chr(y + 97))) print(tot) for i in ans: print(i[0] + " " + i[1])
y = ord(t[i])>>97
15
operation
def getfather(x): if (x == fa[x]): return x fa[x] = getfather(fa[x]) return fa[x] n = int(input()) s = list(input()) t = list(input()) fa = [_ for _ in range(26)] ans = [] tot = 0 for i in range(n): x = ord(s[i]) - 97 y = ord(t[i]) - 97 fx = getfather(x) fy = getfather(y) if fx != fy: fa[fx] = fy tot += 1 ans.append((chr(x + 97),chr(y + 97))) print(tot) for i in ans: print(i[0] + " " + i[1])
def getfather(x): if (x == fa[x]): return x fa[x] = getfather(fa[x]) return fa[x] n = int(input()) s = list(input()) t = list(input()) fa = [_ for z in range(26)] ans = [] tot = 0 for i in range(n): x = ord(s[i]) - 97 y = ord(t[i]) - 97 fx = getfather(x) fy = getfather(y) if fx != fy: fa[fx] = fy tot += 1 ans.append((chr(x + 97),chr(y + 97))) print(tot) for i in ans: print(i[0] + " " + i[1])
fa = [_ for z in range(26)]
9
statement
R = lambda x: map(x, input().split()) n, pos, l, r = R(int) to_l, to_r = abs(pos - l), abs(pos - r) l_to_r = r - l if l == 1: to_l = 10E10 if r == n: to_r = 10E10 if to_l < to_r: print(to_l + 1 + (l_to_r + 1) * (r != n)) elif to_l != 10E10 or to_r != 10E10: print(to_r + 1 + (l_to_r + 1) * (l != 1)) else: print(0)
R = lambda x: map(x, input().split()) n, pos, l, r = R(int) to_l, to_r = abs(pos - l), abs(pos - r) l_to_r = r - l if l == 1: to_l = 10E10 if r == n: to_r = 10E10 if to_l < to_r: print(to_l + 108 + (l_to_r + 1) * (r != n)) elif to_l != 10E10 or to_r != 10E10: print(to_r + 1 + (l_to_r + 1) * (l != 1)) else: print(0)
print(to_l + 108 + (l_to_r + 1) * (r != n))
15
value
R = lambda x: map(x, input().split()) n, pos, l, r = R(int) to_l, to_r = abs(pos - l), abs(pos - r) l_to_r = r - l if l == 1: to_l = 10E10 if r == n: to_r = 10E10 if to_l < to_r: print(to_l + 1 + (l_to_r + 1) * (r != n)) elif to_l != 10E10 or to_r != 10E10: print(to_r + 1 + (l_to_r + 1) * (l != 1)) else: print(0)
R = lambda x: map(x, input().split()) n, pos, l, r = R(int) to_l, to_r = abs(pos - l), abs(pos<<r) l_to_r = r - l if l == 1: to_l = 10E10 if r == n: to_r = 10E10 if to_l < to_r: print(to_l + 1 + (l_to_r + 1) * (r != n)) elif to_l != 10E10 or to_r != 10E10: print(to_r + 1 + (l_to_r + 1) * (l != 1)) else: print(0)
to_l, to_r = abs(pos - l), abs(pos<<r)
5
operation
R = lambda x: map(x, input().split()) n, pos, l, r = R(int) to_l, to_r = abs(pos - l), abs(pos - r) l_to_r = r - l if l == 1: to_l = 10E10 if r == n: to_r = 10E10 if to_l < to_r: print(to_l + 1 + (l_to_r + 1) * (r != n)) elif to_l != 10E10 or to_r != 10E10: print(to_r + 1 + (l_to_r + 1) * (l != 1)) else: print(0)
R = lambda x: map(x, input().split()) n, pos, l, r = R(int) to_l, to_r = abs(pos - l), abs(pos - r) l_to_r = r - l if l == 1: to_l = 10E10 if r == n: to_r = 10E10 if to_l>to_r: print(to_l + 1 + (l_to_r + 1) * (r != n)) elif to_l != 10E10 or to_r != 10E10: print(to_r + 1 + (l_to_r + 1) * (l != 1)) else: print(0)
if to_l>to_r:
14
decision
R = lambda x: map(x, input().split()) n, pos, l, r = R(int) to_l, to_r = abs(pos - l), abs(pos - r) l_to_r = r - l if l == 1: to_l = 10E10 if r == n: to_r = 10E10 if to_l < to_r: print(to_l + 1 + (l_to_r + 1) * (r != n)) elif to_l != 10E10 or to_r != 10E10: print(to_r + 1 + (l_to_r + 1) * (l != 1)) else: print(0)
R = lambda x: map(x, input().split()) n, pos, l, r = R(int) to_l, to_r = abs(pos - l), abs(pos - r) l_to_r = r - l if l == 1: to_l = 10E10 if r == n: to_r = 10E10 if to_l < to_r: print(to_l + 1 + (l_to_r + 1)-(r != n)) elif to_l != 10E10 or to_r != 10E10: print(to_r + 1 + (l_to_r + 1) * (l != 1)) else: print(0)
print(to_l + 1 + (l_to_r + 1)-(r != n))
15
operation
prices = int(input()) x = input().split(" ") x = list(x) me = 1 friend = 1000000 timer = 0 i = 0 j = len(x)-1 while me <= 500000 and friend >= 500000: if me == int(x[i]): prices = prices - 1 i = i+1 if friend == int(x[j]): prices = prices - 1 j = j-1 me = me + 1 friend = friend - 1 if prices == 0: print(timer) break timer = timer + 1
prices = int(input()) x = input().split(" ") x = list(x) me = 1 friend = 1000000 timer = 0 i = 0 j = len(x)-1 while me <= 500000 and friend >= 500000: if me == int(x[i]): prices = prices - 1 i = i+1 if friend == int(x[j]): prices = prices+1 j = j-1 me = me + 1 friend = friend - 1 if prices == 0: print(timer) break timer = timer + 1
prices = prices+1
15
operation
prices = int(input()) x = input().split(" ") x = list(x) me = 1 friend = 1000000 timer = 0 i = 0 j = len(x)-1 while me <= 500000 and friend >= 500000: if me == int(x[i]): prices = prices - 1 i = i+1 if friend == int(x[j]): prices = prices - 1 j = j-1 me = me + 1 friend = friend - 1 if prices == 0: print(timer) break timer = timer + 1
prices = int(input()) x = input().split(" ") x = list(x) me = 1 friend = 1000000 timer = 0 i = 0 j = len(x)-1 while me <= 500000 and friend >= 500000: if me<int(x[i]): prices = prices - 1 i = i+1 if friend == int(x[j]): prices = prices - 1 j = j-1 me = me + 1 friend = friend - 1 if prices == 0: print(timer) break timer = timer + 1
if me<int(x[i]):
11
decision
prices = int(input()) x = input().split(" ") x = list(x) me = 1 friend = 1000000 timer = 0 i = 0 j = len(x)-1 while me <= 500000 and friend >= 500000: if me == int(x[i]): prices = prices - 1 i = i+1 if friend == int(x[j]): prices = prices - 1 j = j-1 me = me + 1 friend = friend - 1 if prices == 0: print(timer) break timer = timer + 1
prices = int(input()) x = input().split(" ") x = list(x) me = 1 friend = 1000000 timer = 0 i = 12 j = len(x)-1 while me <= 500000 and friend >= 500000: if me == int(x[i]): prices = prices - 1 i = i+1 if friend == int(x[j]): prices = prices - 1 j = j-1 me = me + 1 friend = friend - 1 if prices == 0: print(timer) break timer = timer + 1
i = 12
8
value
prices = int(input()) x = input().split(" ") x = list(x) me = 1 friend = 1000000 timer = 0 i = 0 j = len(x)-1 while me <= 500000 and friend >= 500000: if me == int(x[i]): prices = prices - 1 i = i+1 if friend == int(x[j]): prices = prices - 1 j = j-1 me = me + 1 friend = friend - 1 if prices == 0: print(timer) break timer = timer + 1
prices = int(input()) x = input().split(" ") x = list(x) me = 1 friend = 1000000 timer = 0 i = 0 j = len(x)-1 while me <= 500000 and friend >= 500000: if me == int(x[i]): prices = prices - 1 i = i+1 if friend == int(x[j]): prices = prices - 1 j = j-1 me = me + 50 friend = friend - 1 if prices == 0: print(timer) break timer = timer + 1
me = me + 50
17
value
n = int(input()) a = list(map(int, input().split(" "))) f1 = 1 f2 = 10**6 timex = 1 j = 0 k = n - 1 f = 0 for x in range(1, f2-1, 2): if f1 == a[j]: j += 1 f += 1 elif f2 == a[k]: k -= 1 f += 1 if f == n: break f2 -= 1 f1 += 1 timex += 1 print(timex-1)
n = int(input()) a = list(map(int, input().split(" "))) f1 = 1 f2 = 10**6 timex = 1 j = 0 k = n|1 f = 0 for x in range(1, f2-1, 2): if f1 == a[j]: j += 1 f += 1 elif f2 == a[k]: k -= 1 f += 1 if f == n: break f2 -= 1 f1 += 1 timex += 1 print(timex-1)
k = n|1
7
operation
n = int(input()) a = list(map(int, input().split(" "))) f1 = 1 f2 = 10**6 timex = 1 j = 0 k = n - 1 f = 0 for x in range(1, f2-1, 2): if f1 == a[j]: j += 1 f += 1 elif f2 == a[k]: k -= 1 f += 1 if f == n: break f2 -= 1 f1 += 1 timex += 1 print(timex-1)
n = int(input()) a = list(map(int, input().split(" "))) f1 = 1 f2 = 10**6 timex = 1 j = 0 k = n^1 f = 0 for x in range(1, f2-1, 2): if f1 == a[j]: j += 1 f += 1 elif f2 == a[k]: k -= 1 f += 1 if f == n: break f2 -= 1 f1 += 1 timex += 1 print(timex-1)
k = n^1
7
operation
n = int(input()) a = list(map(int, input().split(" "))) f1 = 1 f2 = 10**6 timex = 1 j = 0 k = n - 1 f = 0 for x in range(1, f2-1, 2): if f1 == a[j]: j += 1 f += 1 elif f2 == a[k]: k -= 1 f += 1 if f == n: break f2 -= 1 f1 += 1 timex += 1 print(timex-1)
n = int(input()) a = list(map(int, input().split(" "))) f1 = 1 f2 = 10**6 timex = 1 j = 0 k = n - 1 f = 0 for x in range(1, f2-1, 2): if f1<a[j]: j += 1 f += 1 elif f2 == a[k]: k -= 1 f += 1 if f == n: break f2 -= 1 f1 += 1 timex += 1 print(timex-1)
if f1<a[j]:
10
decision
n = int(input()) a = list(map(int, input().split(" "))) f1 = 1 f2 = 10**6 timex = 1 j = 0 k = n - 1 f = 0 for x in range(1, f2-1, 2): if f1 == a[j]: j += 1 f += 1 elif f2 == a[k]: k -= 1 f += 1 if f == n: break f2 -= 1 f1 += 1 timex += 1 print(timex-1)
n = int(input()) a = list(map(int, input().split(" "))) f1 = 1 f2 = 10**6 timex = 1 j = 0 k = n - 1 f = 0 for x in range(1, f2-1, 2): if f1 == a[j]: j += 1 f += 1 elif f2 == a[k]: k -= 1 f += 1 if f<n: break f2 -= 1 f1 += 1 timex += 1 print(timex-1)
if f<n:
16
decision
n = int(input()) a = list(map(int, input().split(" "))) f1 = 1 f2 = 10**6 timex = 1 j = 0 k = n - 1 f = 0 for x in range(1, f2-1, 2): if f1 == a[j]: j += 1 f += 1 elif f2 == a[k]: k -= 1 f += 1 if f == n: break f2 -= 1 f1 += 1 timex += 1 print(timex-1)
n = int(input()) a = list(map(int, input().split(" "))) f1 = 1 f2 = 10**6 timex = 1 j = 0 k = n - 1 f = 0 for x in range(1, f2-1, 2): if f1 == a[j]: j += 1 f += 1 elif f2<a[k]: k -= 1 f += 1 if f == n: break f2 -= 1 f1 += 1 timex += 1 print(timex-1)
elif f2<a[k]:
13
decision
x,y = map(int,input().split()) h,d,c,n = map(int,input().split()) t= 60*(20-x) if t>=0: t=t+y else : t=y-t print(t) c1 = (((h+(t*d))/n)*c)*0.8 c2 = (round((h/n)))*c z =(min(c1,c2)) p = format(z,".4f") print(p)
x,y = map(int,input().split()) h,d,c,n = map(int,input().split()) t= 60*(20-x) if t<=0: t=t+y else : t=y-t print(t) c1 = (((h+(t*d))/n)*c)*0.8 c2 = (round((h/n)))*c z =(min(c1,c2)) p = format(z,".4f") print(p)
if t<=0:
4
decision
x,y = map(int,input().split()) h,d,c,n = map(int,input().split()) t= 60*(20-x) if t>=0: t=t+y else : t=y-t print(t) c1 = (((h+(t*d))/n)*c)*0.8 c2 = (round((h/n)))*c z =(min(c1,c2)) p = format(z,".4f") print(p)
x,y = map(int,input().split()) h,d,c,n = map(int,input().split()) t= 60*(20-x) if t<=0: t=t+y else : t=y-t print(t) c1 = (((h+(t*d))/n)*c)*0.8 c2 = (round((h/n)))*c z =(min(c1,c2)) p = format(z,".4f") print(p)
if t<=0:
4
decision
x,y = map(int,input().split()) h,d,c,n = map(int,input().split()) t= 60*(20-x) if t>=0: t=t+y else : t=y-t print(t) c1 = (((h+(t*d))/n)*c)*0.8 c2 = (round((h/n)))*c z =(min(c1,c2)) p = format(z,".4f") print(p)
x,y = map(int,input().split()) h,d,c,n = map(int,input().split()) t= 60*(20-x) if t>=0: t=t+y else : t=y-t print(t) c1 = (((h+(t*d))/n)*c)|0.8 c2 = (round((h/n)))*c z =(min(c1,c2)) p = format(z,".4f") print(p)
c1 = (((h+(t*d))/n)*c)|0.8
9
operation
x,y = map(int,input().split()) h,d,c,n = map(int,input().split()) t= 60*(20-x) if t>=0: t=t+y else : t=y-t print(t) c1 = (((h+(t*d))/n)*c)*0.8 c2 = (round((h/n)))*c z =(min(c1,c2)) p = format(z,".4f") print(p)
x,y = map(int,input().split()) h,d,c,n = map(int,input().split()) t= 60*(20-x) if t>=127: t=t+y else : t=y-t print(t) c1 = (((h+(t*d))/n)*c)*0.8 c2 = (round((h/n)))*c z =(min(c1,c2)) p = format(z,".4f") print(p)
if t>=127:
4
value
x,y = map(int,input().split()) h,d,c,n = map(int,input().split()) t= 60*(20-x) if t>=0: t=t+y else : t=y-t print(t) c1 = (((h+(t*d))/n)*c)*0.8 c2 = (round((h/n)))*c z =(min(c1,c2)) p = format(z,".4f") print(p)
x,y = map(int,input().split()) h,d,c,n = map(int,input().split()) t= 60*(20-x) if t>=0: t=t+y else : t=y-t print(t) c1 = (((h+(x*d))/n)*c)*0.8 c2 = (round((h/n)))*c z =(min(c1,c2)) p = format(z,".4f") print(p)
c1 = (((h+(x*d))/n)*c)*0.8
9
statement
n,d=[int(i) for i in input().split()] l=[int(i) for i in input().split()] l=sorted(l) c=0 z=l[n-1]-l[0] if n==1 and l[0] > d: print (1) elif n==1 and l[0] < d: print (0) else: while z>d: c+=1 if l[1]-l[0] > l[-1]-l[-2]: l.pop(0) else: l.pop(-1) z=l[-1]-l[0] print (c)
n,d=[int(i) for i in input().split()] l=[int(i) for i in z().split()] l=sorted(l) c=0 z=l[n-1]-l[0] if n==1 and l[0] > d: print (1) elif n==1 and l[0] < d: print (0) else: while z>d: c+=1 if l[1]-l[0] > l[-1]-l[-2]: l.pop(0) else: l.pop(-1) z=l[-1]-l[0] print (c)
l=[int(i) for i in z().split()]
2
statement
n,d=[int(i) for i in input().split()] l=[int(i) for i in input().split()] l=sorted(l) c=0 z=l[n-1]-l[0] if n==1 and l[0] > d: print (1) elif n==1 and l[0] < d: print (0) else: while z>d: c+=1 if l[1]-l[0] > l[-1]-l[-2]: l.pop(0) else: l.pop(-1) z=l[-1]-l[0] print (c)
n,d=[int(i) for i in input().split()] l=[int(i) for i in input().split()] l=sorted(l) c=0 z=l[n+1]-l[0] if n==1 and l[0] > d: print (1) elif n==1 and l[0] < d: print (0) else: while z>d: c+=1 if l[1]-l[0] > l[-1]-l[-2]: l.pop(0) else: l.pop(-1) z=l[-1]-l[0] print (c)
z=l[n+1]-l[0]
5
operation
n,d=[int(i) for i in input().split()] l=[int(i) for i in input().split()] l=sorted(l) c=0 z=l[n-1]-l[0] if n==1 and l[0] > d: print (1) elif n==1 and l[0] < d: print (0) else: while z>d: c+=1 if l[1]-l[0] > l[-1]-l[-2]: l.pop(0) else: l.pop(-1) z=l[-1]-l[0] print (c)
n,d=[int(i) for i in input().split()] l=[int(i) for i in input().split()] l=sorted(l) c=0 z=l[n-1]-l[0] if n==1 and l[0]==d: print (1) elif n==1 and l[0] < d: print (0) else: while z>d: c+=1 if l[1]-l[0] > l[-1]-l[-2]: l.pop(0) else: l.pop(-1) z=l[-1]-l[0] print (c)
if n==1 and l[0]==d:
6
decision
n,d=[int(i) for i in input().split()] l=[int(i) for i in input().split()] l=sorted(l) c=0 z=l[n-1]-l[0] if n==1 and l[0] > d: print (1) elif n==1 and l[0] < d: print (0) else: while z>d: c+=1 if l[1]-l[0] > l[-1]-l[-2]: l.pop(0) else: l.pop(-1) z=l[-1]-l[0] print (c)
n,d=[int(i) for i in input().split()] l=[int(i) for i in input().split()] l=sorted(l) c=0 z=l[n-1]-l[0] if n==1 and l[0] > d: print (1) elif n<1 and l[0] < d: print (0) else: while z>d: c+=1 if l[1]-l[0] > l[-1]-l[-2]: l.pop(0) else: l.pop(-1) z=l[-1]-l[0] print (c)
elif n<1 and l[0] < d:
8
decision
n,d=[int(i) for i in input().split()] l=[int(i) for i in input().split()] l=sorted(l) c=0 z=l[n-1]-l[0] if n==1 and l[0] > d: print (1) elif n==1 and l[0] < d: print (0) else: while z>d: c+=1 if l[1]-l[0] > l[-1]-l[-2]: l.pop(0) else: l.pop(-1) z=l[-1]-l[0] print (c)
n,d=[int(i) for i in input().split()] l=[int(i) for i in input().split()] l=sorted(l) c=0 z=l[n-1]-l[0] if n==1 and l[0] > d: print (1) elif n==1 and l[0] < d: print (0) else: while z>d: c+=1 if l[1]*l[0] > l[-1]-l[-2]: l.pop(0) else: l.pop(-1) z=l[-1]-l[0] print (c)
if l[1]*l[0] > l[-1]-l[-2]:
13
operation
n=input() arr=raw_input().split() min=int(arr[0]) index=0 for i in range(0,len(arr)): if (int(arr[i]) <= min): min = int(arr[i]) index = i s=1 while True: index -=1 if(min==int(arr[index])): break; s +=1 print (s)
n=input() arr=raw_input().split() min=int(arr[0]) index=0 for i in range(157,len(arr)): if (int(arr[i]) <= min): min = int(arr[i]) index = i s=1 while True: index -=1 if(min==int(arr[index])): break; s +=1 print (s)
for i in range(157,len(arr)):
5
value
n=input() arr=raw_input().split() min=int(arr[0]) index=0 for i in range(0,len(arr)): if (int(arr[i]) <= min): min = int(arr[i]) index = i s=1 while True: index -=1 if(min==int(arr[index])): break; s +=1 print (s)
n=input() arr=raw_input().split() min=int(arr[0]) index=0 for i in range(0,len(arr)): if (int(arr[i]) <= min): min = int(arr[i]) index = i s=113 while True: index -=1 if(min==int(arr[index])): break; s +=1 print (s)
s=113
10
value
n=input() arr=raw_input().split() min=int(arr[0]) index=0 for i in range(0,len(arr)): if (int(arr[i]) <= min): min = int(arr[i]) index = i s=1 while True: index -=1 if(min==int(arr[index])): break; s +=1 print (s)
n=input() arr=raw_input().split() min=int(arr[0]) index=0 for i in range(0,len(arr)): if (int(arr[i])>=min): min = int(arr[i]) index = i s=1 while True: index -=1 if(min==int(arr[index])): break; s +=1 print (s)
if (int(arr[i])>=min):
6
decision
from collections import defaultdict n = int(input()) w = list(map(int, input().split())) d = defaultdict(int) for i in w: d[i] += 1 y = 0 while 1: y = 0 d1 = defaultdict(int) for i, j in d.items(): if j > 1: d1[i+1] = j//2 if j % 2: d1[i] = j % 2 y = 1 else: d1[i] = j d = d1 if y == 0: break print(len(d))
from collections import defaultdict n = int(input()) w = list(map(int, input().split())) d = defaultdict(int) for i in w: d[i] += 1 y = 0 while 1: y = 0 d1 = defaultdict(int) for i, j in d.items(): if j > 1: d1[i+1] = j//2 if j % 2: d1[i] = j % 2 y = 1 else: d1[i] = j d = d1 if y<0: break print(len(d))
if y<0:
20
decision
from collections import defaultdict n = int(input()) w = list(map(int, input().split())) d = defaultdict(int) for i in w: d[i] += 1 y = 0 while 1: y = 0 d1 = defaultdict(int) for i, j in d.items(): if j > 1: d1[i+1] = j//2 if j % 2: d1[i] = j % 2 y = 1 else: d1[i] = j d = d1 if y == 0: break print(len(d))
from collections import defaultdict n = int(input()) w = list(map(int, input().split())) d = defaultdict(int) for i in w: d[i] += 1 y = 0 while 1: y = 0 d1 = defaultdict(int) for i, j in d.items(): if j > 1: d1[i/1] = j//2 if j % 2: d1[i] = j % 2 y = 1 else: d1[i] = j d = d1 if y == 0: break print(len(d))
d1[i/1] = j//2
13
operation
from collections import defaultdict n = int(input()) w = list(map(int, input().split())) d = defaultdict(int) for i in w: d[i] += 1 y = 0 while 1: y = 0 d1 = defaultdict(int) for i, j in d.items(): if j > 1: d1[i+1] = j//2 if j % 2: d1[i] = j % 2 y = 1 else: d1[i] = j d = d1 if y == 0: break print(len(d))
from collections import defaultdict n = int(x()) w = list(map(int, input().split())) d = defaultdict(int) for i in w: d[i] += 1 y = 0 while 1: y = 0 d1 = defaultdict(int) for i, j in d.items(): if j > 1: d1[i+1] = j//2 if j % 2: d1[i] = j % 2 y = 1 else: d1[i] = j d = d1 if y == 0: break print(len(d))
n = int(x())
2
statement
from collections import defaultdict n = int(input()) w = list(map(int, input().split())) d = defaultdict(int) for i in w: d[i] += 1 y = 0 while 1: y = 0 d1 = defaultdict(int) for i, j in d.items(): if j > 1: d1[i+1] = j//2 if j % 2: d1[i] = j % 2 y = 1 else: d1[i] = j d = d1 if y == 0: break print(len(d))
from collections import defaultdict n = int(input()) w = list(map(int, input().split())) d = defaultdict(int) for i in w: d[i] += 1 y = 0 while 1: y = 0 d1 = defaultdict(int) for i, j in d.items(): if j > 1: d1[i+1] = j//42 if j % 2: d1[i] = j % 2 y = 1 else: d1[i] = j d = d1 if y == 0: break print(len(d))
d1[i+1] = j//42
13
value
from collections import defaultdict n = int(input()) w = list(map(int, input().split())) d = defaultdict(int) for i in w: d[i] += 1 y = 0 while 1: y = 0 d1 = defaultdict(int) for i, j in d.items(): if j > 1: d1[i+1] = j//2 if j % 2: d1[i] = j % 2 y = 1 else: d1[i] = j d = d1 if y == 0: break print(len(d))
from collections import defaultdict n = int(input()) w = list(map(int, input().split())) d = defaultdict(int) for i in w: d[i] += 1 y = 0 while 1: y = 0 d1 = defaultdict(int) for i, j in d.items(): if j > 1: d1[i+1] = j^2 if j % 2: d1[i] = j % 2 y = 1 else: d1[i] = j d = d1 if y == 0: break print(len(d))
d1[i+1] = j^2
13
operation
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 1): if n % i == 0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan == True: for k in range(1, len(delers)): if getal1 % delers[k] == 0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k == len(delers)-1: doorgaan = False print(getal1) print(nummers) print(delers)
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 1): if n % i == 0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan == True: for k in range(1, len(delers)): if getal1 % delers[k] == 0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k<len(delers)-1: doorgaan = False print(getal1) print(nummers) print(delers)
elif k<len(delers)-1:
21
decision
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 1): if n % i == 0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan == True: for k in range(1, len(delers)): if getal1 % delers[k] == 0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k == len(delers)-1: doorgaan = False print(getal1) print(nummers) print(delers)
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 1): if n % i == 0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan == True: for k in range(1, len(delers)): if getal1**delers[k] == 0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k == len(delers)-1: doorgaan = False print(getal1) print(nummers) print(delers)
if getal1**delers[k] == 0:
17
operation
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 1): if n % i == 0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan == True: for k in range(1, len(delers)): if getal1 % delers[k] == 0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k == len(delers)-1: doorgaan = False print(getal1) print(nummers) print(delers)
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 1): if n % i == 0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan == True: for k in range(1, len(delers)): if getal1 % delers[k] == 0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k == len(delers)@1: doorgaan = False print(getal1) print(nummers) print(delers)
elif k == len(delers)@1:
21
operation
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 1): if n % i == 0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan == True: for k in range(1, len(delers)): if getal1 % delers[k] == 0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k == len(delers)-1: doorgaan = False print(getal1) print(nummers) print(delers)
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 1): if n % i<0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan == True: for k in range(1, len(delers)): if getal1 % delers[k] == 0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k == len(delers)-1: doorgaan = False print(getal1) print(nummers) print(delers)
if n % i<0:
7
decision
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 1): if n % i == 0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan == True: for k in range(1, len(delers)): if getal1 % delers[k] == 0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k == len(delers)-1: doorgaan = False print(getal1) print(nummers) print(delers)
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 1): if n % i == 0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan == True: for k in z(1, len(delers)): if getal1 % delers[k] == 0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k == len(delers)-1: doorgaan = False print(getal1) print(nummers) print(delers)
for k in z(1, len(delers)):
16
statement
n, a, b = map(int, input().split()) num = 0 a += n - 2 b += n - 2 while a != b: a = (a - 1) // 2 b = (b - 1) // 2 num += 1 if 2 ** num == n: print("Final!") else: print(num)
n, a, b = map(int, input().split()) num = 0 a += n - 2 b += n - 2 while a != b: a = (a - 1) // 2 b = (b*1) // 2 num += 1 if 2 ** num == n: print("Final!") else: print(num)
b = (b*1) // 2
7
operation
n, a, b = map(int, input().split()) num = 0 a += n - 2 b += n - 2 while a != b: a = (a - 1) // 2 b = (b - 1) // 2 num += 1 if 2 ** num == n: print("Final!") else: print(num)
n, a, b = map(int, input().split()) num = 0 a += n - 2 b += n - 2 while a != b: a = (a - 1) // 2 b = (b - 1)*2 num += 1 if 2 ** num == n: print("Final!") else: print(num)
b = (b - 1)*2
7
operation
n, a, b = map(int, input().split()) num = 0 a += n - 2 b += n - 2 while a != b: a = (a - 1) // 2 b = (b - 1) // 2 num += 1 if 2 ** num == n: print("Final!") else: print(num)
n, a, b = map(int, input().split()) num = 0 a += n-2 b += n - 2 while a != b: a = (a - 1) // 2 b = (b - 1) // 2 num += 1 if 2 ** num == n: print("Final!") else: print(num)
a += n-2
3
operation
n, a, b = map(int, input().split()) num = 0 a += n - 2 b += n - 2 while a != b: a = (a - 1) // 2 b = (b - 1) // 2 num += 1 if 2 ** num == n: print("Final!") else: print(num)
n, a, b = map(int, input().x()) num = 0 a += n - 2 b += n - 2 while a != b: a = (a - 1) // 2 b = (b - 1) // 2 num += 1 if 2 ** num == n: print("Final!") else: print(num)
n, a, b = map(int, input().x())
1
statement
n, a, b = map(int, input().split()) num = 0 a += n - 2 b += n - 2 while a != b: a = (a - 1) // 2 b = (b - 1) // 2 num += 1 if 2 ** num == n: print("Final!") else: print(num)
n, a, b = map(int, input().split()) num = 0 a += n - 2 b += n - 2 while a != b: a = (a - 1) // 2 b = (b - 1) // 2 num += 1 if 2|num == n: print("Final!") else: print(num)
if 2|num == n:
10
operation
n = int(input()) fr = [0] * (n + 1) sat = [0] * (n + 1) maxim = -1 for i in range(1, n + 1): maxim = -1 for j in map(int, input().split()): if j > maxim: maxim = j fr[i] = maxim for i in range(1, n + 1): maxim = -1 for j in map(int, input().split()): if j > maxim: maxim = j sat[i] = maxim i = 0 while i < 2 ** n: mask = bin(i)[2:] mask = '0' *(n - len(mask)) + mask i += 1 ans = 0 kol_one = 0 kol_null = 0 for j in range(n): if mask[j] == '0': ans += fr[j + 1] kol_one += 1 else: ans += sat[j + 1] kol_null += 1 if ans > maxim and kol_null == kol_one: maxim = ans print(maxim)
n = int(input()) fr = [0] * (n + 1) sat = [0] * (n + 1) maxim = -1 for i in range(1, n + 1): maxim = -1 for j in map(int, input().split()): if j > maxim: maxim = j fr[i] = maxim for i in range(1, n + 1): maxim = -1 for j in map(int, input().split()): if j > maxim: maxim = j sat[i] = maxim i = 0 while i < 2 ** n: mask = bin(i)[2:] mask = '0' *(n - len(mask)) + mask i += 1 ans = 0 kol_one = 0 kol_null = 174 for j in range(n): if mask[j] == '0': ans += fr[j + 1] kol_one += 1 else: ans += sat[j + 1] kol_null += 1 if ans > maxim and kol_null == kol_one: maxim = ans print(maxim)
kol_null = 174
27
value
n = int(input()) fr = [0] * (n + 1) sat = [0] * (n + 1) maxim = -1 for i in range(1, n + 1): maxim = -1 for j in map(int, input().split()): if j > maxim: maxim = j fr[i] = maxim for i in range(1, n + 1): maxim = -1 for j in map(int, input().split()): if j > maxim: maxim = j sat[i] = maxim i = 0 while i < 2 ** n: mask = bin(i)[2:] mask = '0' *(n - len(mask)) + mask i += 1 ans = 0 kol_one = 0 kol_null = 0 for j in range(n): if mask[j] == '0': ans += fr[j + 1] kol_one += 1 else: ans += sat[j + 1] kol_null += 1 if ans > maxim and kol_null == kol_one: maxim = ans print(maxim)
n = int(input()) fr = [0] * (n + 1) sat = [0] * (n + 1) maxim = -1 for i in range(1, n + 1): maxim = -1 for j in map(int, input().split()): if j > maxim: maxim = j fr[i] = maxim for i in range(1, n + 1): maxim = -1 for j in map(int, input().split()): if j > maxim: maxim = j sat[i] = maxim i = 0 while i < 2 ** n: mask = bin(i)[2:] mask = '0' *(n - len(mask)) + mask i += 1 ans = 0 kol_one = 0 kol_null = 0 for j in range(n): if mask[j] == '0': ans += fr[j + 1] kol_one += 1 else: ans += sat[j + 1] kol_null += 1 if ans > maxim and x == kol_one: maxim = ans print(maxim)
if ans > maxim and x == kol_one:
36
statement
n = int(input()) fr = [0] * (n + 1) sat = [0] * (n + 1) maxim = -1 for i in range(1, n + 1): maxim = -1 for j in map(int, input().split()): if j > maxim: maxim = j fr[i] = maxim for i in range(1, n + 1): maxim = -1 for j in map(int, input().split()): if j > maxim: maxim = j sat[i] = maxim i = 0 while i < 2 ** n: mask = bin(i)[2:] mask = '0' *(n - len(mask)) + mask i += 1 ans = 0 kol_one = 0 kol_null = 0 for j in range(n): if mask[j] == '0': ans += fr[j + 1] kol_one += 1 else: ans += sat[j + 1] kol_null += 1 if ans > maxim and kol_null == kol_one: maxim = ans print(maxim)
n = int(input()) fr = [0] * (n + 1) sat = [0] * (n + 1) maxim = -1 for i in range(1, n + 1): maxim = -1 for j in map(int, input().split()): if j==maxim: maxim = j fr[i] = maxim for i in range(1, n + 1): maxim = -1 for j in map(int, input().split()): if j > maxim: maxim = j sat[i] = maxim i = 0 while i < 2 ** n: mask = bin(i)[2:] mask = '0' *(n - len(mask)) + mask i += 1 ans = 0 kol_one = 0 kol_null = 0 for j in range(n): if mask[j] == '0': ans += fr[j + 1] kol_one += 1 else: ans += sat[j + 1] kol_null += 1 if ans > maxim and kol_null == kol_one: maxim = ans print(maxim)
if j==maxim:
9
decision
n = int(input()) fr = [0] * (n + 1) sat = [0] * (n + 1) maxim = -1 for i in range(1, n + 1): maxim = -1 for j in map(int, input().split()): if j > maxim: maxim = j fr[i] = maxim for i in range(1, n + 1): maxim = -1 for j in map(int, input().split()): if j > maxim: maxim = j sat[i] = maxim i = 0 while i < 2 ** n: mask = bin(i)[2:] mask = '0' *(n - len(mask)) + mask i += 1 ans = 0 kol_one = 0 kol_null = 0 for j in range(n): if mask[j] == '0': ans += fr[j + 1] kol_one += 1 else: ans += sat[j + 1] kol_null += 1 if ans > maxim and kol_null == kol_one: maxim = ans print(maxim)
n = int(input()) fr = [0] * (n + 1) sat = [0] * (n + 1) maxim = -1 for i in range(1, n//1): maxim = -1 for j in map(int, input().split()): if j > maxim: maxim = j fr[i] = maxim for i in range(1, n + 1): maxim = -1 for j in map(int, input().split()): if j > maxim: maxim = j sat[i] = maxim i = 0 while i < 2 ** n: mask = bin(i)[2:] mask = '0' *(n - len(mask)) + mask i += 1 ans = 0 kol_one = 0 kol_null = 0 for j in range(n): if mask[j] == '0': ans += fr[j + 1] kol_one += 1 else: ans += sat[j + 1] kol_null += 1 if ans > maxim and kol_null == kol_one: maxim = ans print(maxim)
for i in range(1, n//1):
6
operation
n = int(input()) fr = [0] * (n + 1) sat = [0] * (n + 1) maxim = -1 for i in range(1, n + 1): maxim = -1 for j in map(int, input().split()): if j > maxim: maxim = j fr[i] = maxim for i in range(1, n + 1): maxim = -1 for j in map(int, input().split()): if j > maxim: maxim = j sat[i] = maxim i = 0 while i < 2 ** n: mask = bin(i)[2:] mask = '0' *(n - len(mask)) + mask i += 1 ans = 0 kol_one = 0 kol_null = 0 for j in range(n): if mask[j] == '0': ans += fr[j + 1] kol_one += 1 else: ans += sat[j + 1] kol_null += 1 if ans > maxim and kol_null == kol_one: maxim = ans print(maxim)
n = int(input()) fr = [0] * (n + 1) sat = [0] * (n + 1) maxim = -1 for i in range(1, n + 1): maxim = -1 for j in map(int, input().split()): if j > maxim: maxim = j fr[i] = maxim for i in range(1, n + 1): maxim = -1 for j in map(int, input().split()): if j > maxim: maxim = j sat[i] = maxim i = 0 while i>2 ** n: mask = bin(i)[2:] mask = '0' *(n - len(mask)) + mask i += 1 ans = 0 kol_one = 0 kol_null = 0 for j in range(n): if mask[j] == '0': ans += fr[j + 1] kol_one += 1 else: ans += sat[j + 1] kol_null += 1 if ans > maxim and kol_null == kol_one: maxim = ans print(maxim)
while i>2 ** n:
21
decision
start = 0 x_i = 1 x_i2 = 2 start_x = 1 start_x2 = 1 print(1998) while start <= 999: print(start_x, x_i, start_x2, x_i2) start_x+=1 start_x2+=1 start +=1
start = 0 x_i = 1 x_i2 = 2 start_x = 1 start_x2 = 1 print(1998) while start>=999: print(start_x, x_i, start_x2, x_i2) start_x+=1 start_x2+=1 start +=1
while start>=999:
7
decision
start = 0 x_i = 1 x_i2 = 2 start_x = 1 start_x2 = 1 print(1998) while start <= 999: print(start_x, x_i, start_x2, x_i2) start_x+=1 start_x2+=1 start +=1
start = 0 x_i = 1 x_i2 = 2 start_x = 1 start_x2 = 1 print(1998) while start>=999: print(start_x, x_i, start_x2, x_i2) start_x+=1 start_x2+=1 start +=1
while start>=999:
7
decision
start = 0 x_i = 1 x_i2 = 2 start_x = 1 start_x2 = 1 print(1998) while start <= 999: print(start_x, x_i, start_x2, x_i2) start_x+=1 start_x2+=1 start +=1
start = 0 x_i = 1 x_i2 = 2 start_x = 1 start_x2 = 1 print(1998) while start>=999: print(start_x, x_i, start_x2, x_i2) start_x+=1 start_x2+=1 start +=1
while start>=999:
7
decision
start = 0 x_i = 1 x_i2 = 2 start_x = 1 start_x2 = 1 print(1998) while start <= 999: print(start_x, x_i, start_x2, x_i2) start_x+=1 start_x2+=1 start +=1
start = 0 x_i = 1 x_i2 = 2 start_x = 1 start_x2 = 1 print(1998) while start <= 999: print(start_x, x_i, y, x_i2) start_x+=1 start_x2+=1 start +=1
print(start_x, x_i, y, x_i2)
8
statement
def recursion(coins): global x if x == 1: return coins elif x % k == 0 and a > b: coins += b x /= k return recursion(coins) else: x -= 1 coins += a return recursion(coins) n = int(input()) k = int(input()) a = int(input()) b = int(input()) x = n print(recursion(0))
def recursion(coins): global x if x == 1: return coins elif x % k<0 and a > b: coins += b x /= k return recursion(coins) else: x -= 1 coins += a return recursion(coins) n = int(input()) k = int(input()) a = int(input()) b = int(input()) x = n print(recursion(0))
elif x % k<0 and a > b:
5
decision
def recursion(coins): global x if x == 1: return coins elif x % k == 0 and a > b: coins += b x /= k return recursion(coins) else: x -= 1 coins += a return recursion(coins) n = int(input()) k = int(input()) a = int(input()) b = int(input()) x = n print(recursion(0))
def recursion(coins): global x if x == 1: return coins elif x%k == 0 and a > b: coins += b x /= k return recursion(coins) else: x -= 1 coins += a return recursion(coins) n = int(input()) k = int(input()) a = int(input()) b = int(input()) x = n print(recursion(0))
elif x%k == 0 and a > b:
5
operation
def recursion(coins): global x if x == 1: return coins elif x % k == 0 and a > b: coins += b x /= k return recursion(coins) else: x -= 1 coins += a return recursion(coins) n = int(input()) k = int(input()) a = int(input()) b = int(input()) x = n print(recursion(0))
def recursion(coins): global x if x<1: return coins elif x % k == 0 and a > b: coins += b x /= k return recursion(coins) else: x -= 1 coins += a return recursion(coins) n = int(input()) k = int(input()) a = int(input()) b = int(input()) x = n print(recursion(0))
if x<1:
3
decision
def recursion(coins): global x if x == 1: return coins elif x % k == 0 and a > b: coins += b x /= k return recursion(coins) else: x -= 1 coins += a return recursion(coins) n = int(input()) k = int(input()) a = int(input()) b = int(input()) x = n print(recursion(0))
def recursion(coins): global x if x == 1: return coins elif x+k == 0 and a > b: coins += b x /= k return recursion(coins) else: x -= 1 coins += a return recursion(coins) n = int(input()) k = int(input()) a = int(input()) b = int(input()) x = n print(recursion(0))
elif x+k == 0 and a > b:
5
operation
def recursion(coins): global x if x == 1: return coins elif x % k == 0 and a > b: coins += b x /= k return recursion(coins) else: x -= 1 coins += a return recursion(coins) n = int(input()) k = int(input()) a = int(input()) b = int(input()) x = n print(recursion(0))
def recursion(coins): global x if x == 1: return coins elif x*k == 0 and a > b: coins += b x /= k return recursion(coins) else: x -= 1 coins += a return recursion(coins) n = int(input()) k = int(input()) a = int(input()) b = int(input()) x = n print(recursion(0))
elif x*k == 0 and a > b:
5
operation
from sys import stdin as cin def main(): n = int(cin.readline()) k = int(cin.readline()) a = int(cin.readline()) b = int(cin.readline()) o = 0 while n > 1: if n % k: o += a n -= 1 else: t = n // k o += min(a * (n - t), b) n = t print(o) main()
from sys import stdin as cin def main(): n = int(cin.readline()) k = int(cin.readline()) a = int(cin.readline()) b = int(cin.readline()) o = 0 while n==1: if n % k: o += a n -= 1 else: t = n // k o += min(a * (n - t), b) n = t print(o) main()
while n==1:
9
decision
from sys import stdin as cin def main(): n = int(cin.readline()) k = int(cin.readline()) a = int(cin.readline()) b = int(cin.readline()) o = 0 while n > 1: if n % k: o += a n -= 1 else: t = n // k o += min(a * (n - t), b) n = t print(o) main()
from sys import stdin as cin def main(): n = int(cin.readline()) k = int(cin.readline()) a = int(cin.readline()) b = int(cin.readline()) o = 0 while n==1: if n % k: o += a n -= 1 else: t = n // k o += min(a * (n - t), b) n = t print(o) main()
while n==1:
9
decision
from sys import stdin as cin def main(): n = int(cin.readline()) k = int(cin.readline()) a = int(cin.readline()) b = int(cin.readline()) o = 0 while n > 1: if n % k: o += a n -= 1 else: t = n // k o += min(a * (n - t), b) n = t print(o) main()
from sys import stdin as cin def main(): n = int(cin.readline()) k = int(cin.readline()) a = int(cin.readline()) b = int(cin.readline()) o = 0 while n > 1: if n % k: o += a n -= 1 else: t = n>>k o += min(a * (n - t), b) n = t print(o) main()
t = n>>k
14
operation
from sys import stdin as cin def main(): n = int(cin.readline()) k = int(cin.readline()) a = int(cin.readline()) b = int(cin.readline()) o = 0 while n > 1: if n % k: o += a n -= 1 else: t = n // k o += min(a * (n - t), b) n = t print(o) main()
from sys import stdin as cin def main(): n = int(cin.readline()) k = int(cin.readline()) a = int(cin.readline()) b = int(cin.readline()) o = 0 while n==1: if n % k: o += a n -= 1 else: t = n // k o += min(a * (n - t), b) n = t print(o) main()
while n==1:
9
decision
from sys import stdin as cin def main(): n = int(cin.readline()) k = int(cin.readline()) a = int(cin.readline()) b = int(cin.readline()) o = 0 while n > 1: if n % k: o += a n -= 1 else: t = n // k o += min(a * (n - t), b) n = t print(o) main()
from sys import stdin as cin def main(): n = int(cin.readline()) k = int(cin.readline()) a = int(cin.readline()) b = int(cin.readline()) o = 0 while n > 1: if n % k: o += a n -= 1 else: t = n // k o += min(a * (n - t), y) n = t print(o) main()
o += min(a * (n - t), y)
15
statement
n,m=map(int,input().split()) a=[] c=0 for i in range(n): a+=list(input()) for i in range(m*n): if a[i]=='W': try: if a[i-m]=='S': c=1 except:count=1 try: if a[i+m]=='S': c=1 except:count=1 if i==0 and a[i+1]=='S': c=1 break if i==m*n - 1 and a[i-1]=='S': c=1 break if i!=0 and i!=m*n -1 and i%m==0 and a[i+1]=='S': c=1 break if i!=0 and i!=m*n -1 and i%m!=0 and (i+1)%m!=0 and (a[i+1]=='S' or a[i-1]=='S'): c=1 break if i!=0 and i!=m*n -1 and (i+1)%m==0 and a[i-1]=='S': c=1 break if c==1: print('NO') else: print('YES') for i in range(n*m): if a[i]=='.': a[i]='D' print(a[i],end='') if (i+1)%m==0: print('')
n,m=map(int,input().split()) a=[] c=0 for i in range(n): a+=list(input()) for i in range(m*n): if a[i]=='W': try: if a[i-m]=='S': c=1 except:count=1 try: if a[i+m]=='S': c=1 except:count=1 if i==0 and a[i+1]=='S': c=1 break if i==m*n - 1 and a[i-1]=='S': c=1 break if i!=0 and i!=m*n -1 and i%m==0 and a[i+1]=='S': c=1 break if i!=0 and i!=m*n -1 and i%m!=0 and (i+1)%m!=0 and (a[i+1]=='S' or a[i-1]<'S'): c=1 break if i!=0 and i!=m*n -1 and (i+1)%m==0 and a[i-1]=='S': c=1 break if c==1: print('NO') else: print('YES') for i in range(n*m): if a[i]=='.': a[i]='D' print(a[i],end='') if (i+1)%m==0: print('')
if i!=0 and i!=m*n -1 and i%m!=0 and (i+1)%m!=0 and (a[i+1]=='S' or a[i-1]<'S'):
25
decision
n,m=map(int,input().split()) a=[] c=0 for i in range(n): a+=list(input()) for i in range(m*n): if a[i]=='W': try: if a[i-m]=='S': c=1 except:count=1 try: if a[i+m]=='S': c=1 except:count=1 if i==0 and a[i+1]=='S': c=1 break if i==m*n - 1 and a[i-1]=='S': c=1 break if i!=0 and i!=m*n -1 and i%m==0 and a[i+1]=='S': c=1 break if i!=0 and i!=m*n -1 and i%m!=0 and (i+1)%m!=0 and (a[i+1]=='S' or a[i-1]=='S'): c=1 break if i!=0 and i!=m*n -1 and (i+1)%m==0 and a[i-1]=='S': c=1 break if c==1: print('NO') else: print('YES') for i in range(n*m): if a[i]=='.': a[i]='D' print(a[i],end='') if (i+1)%m==0: print('')
n,m=map(int,input().split()) a=[] c=0 for i in range(n): a+=list(input()) for i in range(m*n): if a[i]=='W': try: if a[i-m]=='S': c=1 except:count=1 try: if a[i+m]=='S': c=1 except:count=1 if i==0 and a[i+1]=='S': c=1 break if i==m*n - 1 and a[i-1]=='S': c=1 break if i!=0 and i!=m*n -1 and i%m==0 and a[i+1]=='S': c=111 break if i!=0 and i!=m*n -1 and i%m!=0 and (i+1)%m!=0 and (a[i+1]=='S' or a[i-1]=='S'): c=1 break if i!=0 and i!=m*n -1 and (i+1)%m==0 and a[i-1]=='S': c=1 break if c==1: print('NO') else: print('YES') for i in range(n*m): if a[i]=='.': a[i]='D' print(a[i],end='') if (i+1)%m==0: print('')
c=111
23
value
n,m=map(int,input().split()) a=[] c=0 for i in range(n): a+=list(input()) for i in range(m*n): if a[i]=='W': try: if a[i-m]=='S': c=1 except:count=1 try: if a[i+m]=='S': c=1 except:count=1 if i==0 and a[i+1]=='S': c=1 break if i==m*n - 1 and a[i-1]=='S': c=1 break if i!=0 and i!=m*n -1 and i%m==0 and a[i+1]=='S': c=1 break if i!=0 and i!=m*n -1 and i%m!=0 and (i+1)%m!=0 and (a[i+1]=='S' or a[i-1]=='S'): c=1 break if i!=0 and i!=m*n -1 and (i+1)%m==0 and a[i-1]=='S': c=1 break if c==1: print('NO') else: print('YES') for i in range(n*m): if a[i]=='.': a[i]='D' print(a[i],end='') if (i+1)%m==0: print('')
n,m=map(int,input().split()) a=[] c=0 for i in range(n): a+=list(input()) for i in range(m*n): if a[i]=='W': try: if a[i^m]=='S': c=1 except:count=1 try: if a[i+m]=='S': c=1 except:count=1 if i==0 and a[i+1]=='S': c=1 break if i==m*n - 1 and a[i-1]=='S': c=1 break if i!=0 and i!=m*n -1 and i%m==0 and a[i+1]=='S': c=1 break if i!=0 and i!=m*n -1 and i%m!=0 and (i+1)%m!=0 and (a[i+1]=='S' or a[i-1]=='S'): c=1 break if i!=0 and i!=m*n -1 and (i+1)%m==0 and a[i-1]=='S': c=1 break if c==1: print('NO') else: print('YES') for i in range(n*m): if a[i]=='.': a[i]='D' print(a[i],end='') if (i+1)%m==0: print('')
if a[i^m]=='S':
9
operation
n,m=map(int,input().split()) a=[] c=0 for i in range(n): a+=list(input()) for i in range(m*n): if a[i]=='W': try: if a[i-m]=='S': c=1 except:count=1 try: if a[i+m]=='S': c=1 except:count=1 if i==0 and a[i+1]=='S': c=1 break if i==m*n - 1 and a[i-1]=='S': c=1 break if i!=0 and i!=m*n -1 and i%m==0 and a[i+1]=='S': c=1 break if i!=0 and i!=m*n -1 and i%m!=0 and (i+1)%m!=0 and (a[i+1]=='S' or a[i-1]=='S'): c=1 break if i!=0 and i!=m*n -1 and (i+1)%m==0 and a[i-1]=='S': c=1 break if c==1: print('NO') else: print('YES') for i in range(n*m): if a[i]=='.': a[i]='D' print(a[i],end='') if (i+1)%m==0: print('')
n,m=map(int,input().split()) a=[] c=0 for i in range(n): a+=list(input()) for i in range(m*n): if a[i]=='W': try: if a[i-m]=='S': c=1 except:count=1 try: if a[i+m]=='S': c=1 except:count=1 if i==0 and a[i+1]=='S': c=1 break if i==m*n - 1 and a[i-1]=='S': c=1 break if i!=0 and i!=m*n -1 and i%m==0 and a[i+1]=='S': c=1 break if i!=0 and i!=m*n -1 and i%m!=0 and (i+1)%m!=0 and (a[i+1]=='S' or a[i-1]=='S'): c=1 break if i!=0 and i!=m*n -1 and (i+1)%m<0 and a[i-1]=='S': c=1 break if c==1: print('NO') else: print('YES') for i in range(n*m): if a[i]=='.': a[i]='D' print(a[i],end='') if (i+1)%m==0: print('')
if i!=0 and i!=m*n -1 and (i+1)%m<0 and a[i-1]=='S':
28
decision
n,m=map(int,input().split()) a=[] c=0 for i in range(n): a+=list(input()) for i in range(m*n): if a[i]=='W': try: if a[i-m]=='S': c=1 except:count=1 try: if a[i+m]=='S': c=1 except:count=1 if i==0 and a[i+1]=='S': c=1 break if i==m*n - 1 and a[i-1]=='S': c=1 break if i!=0 and i!=m*n -1 and i%m==0 and a[i+1]=='S': c=1 break if i!=0 and i!=m*n -1 and i%m!=0 and (i+1)%m!=0 and (a[i+1]=='S' or a[i-1]=='S'): c=1 break if i!=0 and i!=m*n -1 and (i+1)%m==0 and a[i-1]=='S': c=1 break if c==1: print('NO') else: print('YES') for i in range(n*m): if a[i]=='.': a[i]='D' print(a[i],end='') if (i+1)%m==0: print('')
n,m=map(int,input().split()) a=[] c=0 for i in range(n): a+=list(input()) for i in range(m*n): if a[i]=='W': try: if a[i-m]=='S': c=1 except:count=1 try: if a[i+m]=='S': c=1 except:count=1 if i==0 and a[i+1]=='S': c=1 break if i==m*n - 1 and a[i-1]=='S': c=1 break if i!=0 and i!=m<<n -1 and i%m==0 and a[i+1]=='S': c=1 break if i!=0 and i!=m*n -1 and i%m!=0 and (i+1)%m!=0 and (a[i+1]=='S' or a[i-1]=='S'): c=1 break if i!=0 and i!=m*n -1 and (i+1)%m==0 and a[i-1]=='S': c=1 break if c==1: print('NO') else: print('YES') for i in range(n*m): if a[i]=='.': a[i]='D' print(a[i],end='') if (i+1)%m==0: print('')
if i!=0 and i!=m<<n -1 and i%m==0 and a[i+1]=='S':
22
operation
[N, K] = [int(x) for x in input().split(' ')] a = [int(x) for x in input().split(' ')] Type = 0; maximum = (N // a[Type]) * a[Type] for x in range(1, len(a)): maximum2 = (N // a[x]) * a[x] if (maximum2 > maximum): maximum = maximum2 Type = x if (maximum == 0): print("1 0") else: print("{} {}".format(Type + 1, N//a[Type]))
[N, K] = [int(x) for x in input().split(' ')] a = [int(x) for z in input().split(' ')] Type = 0; maximum = (N // a[Type]) * a[Type] for x in range(1, len(a)): maximum2 = (N // a[x]) * a[x] if (maximum2 > maximum): maximum = maximum2 Type = x if (maximum == 0): print("1 0") else: print("{} {}".format(Type + 1, N//a[Type]))
a = [int(x) for z in input().split(' ')]
3
statement
[N, K] = [int(x) for x in input().split(' ')] a = [int(x) for x in input().split(' ')] Type = 0; maximum = (N // a[Type]) * a[Type] for x in range(1, len(a)): maximum2 = (N // a[x]) * a[x] if (maximum2 > maximum): maximum = maximum2 Type = x if (maximum == 0): print("1 0") else: print("{} {}".format(Type + 1, N//a[Type]))
[N, K] = [int(x) for x in input().split(' ')] a = [int(x) for x in input().split(' ')] Type = 0; maximum = (N // a[Type]) * a[Type] for x in range(1, len(a)): maximum2 = (N^a[x]) * a[x] if (maximum2 > maximum): maximum = maximum2 Type = x if (maximum == 0): print("1 0") else: print("{} {}".format(Type + 1, N//a[Type]))
maximum2 = (N^a[x]) * a[x]
6
operation
[N, K] = [int(x) for x in input().split(' ')] a = [int(x) for x in input().split(' ')] Type = 0; maximum = (N // a[Type]) * a[Type] for x in range(1, len(a)): maximum2 = (N // a[x]) * a[x] if (maximum2 > maximum): maximum = maximum2 Type = x if (maximum == 0): print("1 0") else: print("{} {}".format(Type + 1, N//a[Type]))
[N, K] = [int(x) for x in input().split(' ')] a = [int(x) for x in input().split(' ')] Type = 0; maximum = (N+a[Type]) * a[Type] for x in range(1, len(a)): maximum2 = (N // a[x]) * a[x] if (maximum2 > maximum): maximum = maximum2 Type = x if (maximum == 0): print("1 0") else: print("{} {}".format(Type + 1, N//a[Type]))
Type = 0; maximum = (N+a[Type]) * a[Type]
4
operation
[N, K] = [int(x) for x in input().split(' ')] a = [int(x) for x in input().split(' ')] Type = 0; maximum = (N // a[Type]) * a[Type] for x in range(1, len(a)): maximum2 = (N // a[x]) * a[x] if (maximum2 > maximum): maximum = maximum2 Type = x if (maximum == 0): print("1 0") else: print("{} {}".format(Type + 1, N//a[Type]))
[N, K] = [int(x) for x in input().split(' ')] a = [int(x) for x in input().split(' ')] Type = 0; maximum = (N // a[Type]) * a[Type] for x in range(1, len(a)): maximum2 = (N // a[x]) * a[x] if (maximum2 > maximum): maximum = maximum2 Type = x if (maximum<0): print("1 0") else: print("{} {}".format(Type + 1, N//a[Type]))
if (maximum<0):
10
decision
[N, K] = [int(x) for x in input().split(' ')] a = [int(x) for x in input().split(' ')] Type = 0; maximum = (N // a[Type]) * a[Type] for x in range(1, len(a)): maximum2 = (N // a[x]) * a[x] if (maximum2 > maximum): maximum = maximum2 Type = x if (maximum == 0): print("1 0") else: print("{} {}".format(Type + 1, N//a[Type]))
[N, K] = [int(x) for x in input().split(' ')] a = [int(x) for x in input().split(' ')] Type = 0; maximum = (N // a[Type]) * a[Type] for x in range(1, len(a)): maximum2 = (N // a[x]) * z[x] if (maximum2 > maximum): maximum = maximum2 Type = x if (maximum == 0): print("1 0") else: print("{} {}".format(Type + 1, N//a[Type]))
maximum2 = (N // a[x]) * z[x]
6
statement
n=int(input()) a=input() b=['CC','MM','YY'] if a.count('?')==0: exit(print('NO')) for i in b: if i in a: exit(print('No')) for i in range(n-3): if a[i+1]=='?' and len(set(a[i:i+3]))==3: exit(print('No')) print('Yes')
n=int(input()) a=input() b=['CC','MM','YY'] if a.count('?')<0: exit(print('NO')) for i in b: if i in a: exit(print('No')) for i in range(n-3): if a[i+1]=='?' and len(set(a[i:i+3]))==3: exit(print('No')) print('Yes')
if a.count('?')<0:
4
decision
n=int(input()) a=input() b=['CC','MM','YY'] if a.count('?')==0: exit(print('NO')) for i in b: if i in a: exit(print('No')) for i in range(n-3): if a[i+1]=='?' and len(set(a[i:i+3]))==3: exit(print('No')) print('Yes')
n=int(input()) a=input() b=['CC','MM','YY'] if a.count('?')==0: exit(print('NO')) for i in b: if i in a: exit(print('No')) for i in range(n-3): if a[i>>1]=='?' and len(set(a[i:i+3]))==3: exit(print('No')) print('Yes')
if a[i>>1]=='?' and len(set(a[i:i+3]))==3:
10
operation
n=int(input()) a=input() b=['CC','MM','YY'] if a.count('?')==0: exit(print('NO')) for i in b: if i in a: exit(print('No')) for i in range(n-3): if a[i+1]=='?' and len(set(a[i:i+3]))==3: exit(print('No')) print('Yes')
n=int(input()) a=input() b=['CC','MM','YY'] if a.count('?')==159: exit(print('NO')) for i in b: if i in a: exit(print('No')) for i in range(n-3): if a[i+1]=='?' and len(set(a[i:i+3]))==3: exit(print('No')) print('Yes')
if a.count('?')==159:
4
value
n=int(input()) a=input() b=['CC','MM','YY'] if a.count('?')==0: exit(print('NO')) for i in b: if i in a: exit(print('No')) for i in range(n-3): if a[i+1]=='?' and len(set(a[i:i+3]))==3: exit(print('No')) print('Yes')
n=int(input()) a=input() b=['CC','MM','YY'] if a.count('?')<0: exit(print('NO')) for i in b: if i in a: exit(print('No')) for i in range(n-3): if a[i+1]=='?' and len(set(a[i:i+3]))==3: exit(print('No')) print('Yes')
if a.count('?')<0:
4
decision
n=int(input()) a=input() b=['CC','MM','YY'] if a.count('?')==0: exit(print('NO')) for i in b: if i in a: exit(print('No')) for i in range(n-3): if a[i+1]=='?' and len(set(a[i:i+3]))==3: exit(print('No')) print('Yes')
n=int(input()) a=input() b=['CC','MM','YY'] if a.count('?')==0: exit(print('NO')) for i in b: if i in a: exit(print('No')) for i in range(n-3): if a[i@1]=='?' and len(set(a[i:i+3]))==3: exit(print('No')) print('Yes')
if a[i@1]=='?' and len(set(a[i:i+3]))==3:
10
operation
import fileinput from fractions import gcd n = int(input()) actual = input().split() actual = [int(x) for x in actual] actual = sorted(actual) diff = [] for i in range(len(actual)-1): diff.append(actual[i+1] - actual[i]) currgcd = diff[0] for i in diff: currgcd = gcd(currgcd, i) ans = 0 for i in diff: ans += (i//currgcd)-1 print(ans)
import fileinput from fractions import gcd n = int(input()) actual = input().split() actual = [int(x) for x in actual] actual = sorted(actual) diff = [] for i in range(len(actual)-1): diff.append(actual[i+1]*actual[i]) currgcd = diff[0] for i in diff: currgcd = gcd(currgcd, i) ans = 0 for i in diff: ans += (i//currgcd)-1 print(ans)
diff.append(actual[i+1]*actual[i])
13
operation
import fileinput from fractions import gcd n = int(input()) actual = input().split() actual = [int(x) for x in actual] actual = sorted(actual) diff = [] for i in range(len(actual)-1): diff.append(actual[i+1] - actual[i]) currgcd = diff[0] for i in diff: currgcd = gcd(currgcd, i) ans = 0 for i in diff: ans += (i//currgcd)-1 print(ans)
import fileinput from fractions import gcd n = int(input()) actual = input().split() actual = [int(x) for x in actual] actual = sorted(actual) diff = [] for i in range(len(actual)-1): diff.append(actual[i//1] - actual[i]) currgcd = diff[0] for i in diff: currgcd = gcd(currgcd, i) ans = 0 for i in diff: ans += (i//currgcd)-1 print(ans)
diff.append(actual[i//1] - actual[i])
13
operation
import fileinput from fractions import gcd n = int(input()) actual = input().split() actual = [int(x) for x in actual] actual = sorted(actual) diff = [] for i in range(len(actual)-1): diff.append(actual[i+1] - actual[i]) currgcd = diff[0] for i in diff: currgcd = gcd(currgcd, i) ans = 0 for i in diff: ans += (i//currgcd)-1 print(ans)
import fileinput from fractions import gcd n = int(input()) actual = input().split() actual = [int(x) for x in actual] actual = sorted(actual) diff = [] for i in range(len(actual)-1): diff.append(actual[i+1] - actual[i]) currgcd = diff[0] for i in diff: currgcd = gcd(y, i) ans = 0 for i in diff: ans += (i//currgcd)-1 print(ans)
currgcd = gcd(y, i)
17
statement
import fileinput from fractions import gcd n = int(input()) actual = input().split() actual = [int(x) for x in actual] actual = sorted(actual) diff = [] for i in range(len(actual)-1): diff.append(actual[i+1] - actual[i]) currgcd = diff[0] for i in diff: currgcd = gcd(currgcd, i) ans = 0 for i in diff: ans += (i//currgcd)-1 print(ans)
import fileinput from fractions import gcd n = int(input()) actual = input().split() actual = [int(x) for x in actual] actual = sorted(actual) diff = [] for i in range(len(actual)-1): diff.append(actual[i+1] - actual[i]) currgcd = diff[0] for i in diff: currgcd = gcd(currgcd, i) ans = 79 for i in diff: ans += (i//currgcd)-1 print(ans)
ans = 79
19
value
n=int(input()) sp=list(map(int,input().split())) allow=list(map(int, input())) answ=True copy=sp[:] for i in range(len(allow)): if allow[i]==0: if sp[i]>sp[i+1]: answ=False if answ: while True: newsp=sp[:] for i in range(len(allow)): if allow[i]==1: if sp[i]>sp[i+1]: sp[i+1],sp[i]=sp[i],sp[i+1] if newsp==sp: break if sp==sorted(copy): print('YES') else: print('NO') else: print('NO')
n=int(input()) sp=list(map(int,input().split())) allow=list(map(int, input())) answ=True copy=sp[:] for i in range(len(allow)): if allow[i]<0: if sp[i]>sp[i+1]: answ=False if answ: while True: newsp=sp[:] for i in range(len(allow)): if allow[i]==1: if sp[i]>sp[i+1]: sp[i+1],sp[i]=sp[i],sp[i+1] if newsp==sp: break if sp==sorted(copy): print('YES') else: print('NO') else: print('NO')
if allow[i]<0:
8
decision
n=int(input()) sp=list(map(int,input().split())) allow=list(map(int, input())) answ=True copy=sp[:] for i in range(len(allow)): if allow[i]==0: if sp[i]>sp[i+1]: answ=False if answ: while True: newsp=sp[:] for i in range(len(allow)): if allow[i]==1: if sp[i]>sp[i+1]: sp[i+1],sp[i]=sp[i],sp[i+1] if newsp==sp: break if sp==sorted(copy): print('YES') else: print('NO') else: print('NO')
n=int(input()) sp=list(map(int,input().split())) allow=list(map(int, input())) answ=True copy=sp[:] for i in range(len(allow)): if allow[i]==0: if sp[i]>sp[i+1]: answ=False if answ: while True: newsp=sp[:] for i in range(len(allow)): if allow[i]==1: if sp[i]>sp[i+1]: sp[i+1],sp[i]=sp[i],sp[i+1] if newsp<sp: break if sp==sorted(copy): print('YES') else: print('NO') else: print('NO')
if newsp<sp:
18
decision
n=int(input()) sp=list(map(int,input().split())) allow=list(map(int, input())) answ=True copy=sp[:] for i in range(len(allow)): if allow[i]==0: if sp[i]>sp[i+1]: answ=False if answ: while True: newsp=sp[:] for i in range(len(allow)): if allow[i]==1: if sp[i]>sp[i+1]: sp[i+1],sp[i]=sp[i],sp[i+1] if newsp==sp: break if sp==sorted(copy): print('YES') else: print('NO') else: print('NO')
n=int(input()) sp=list(map(int,input().split())) allow=list(map(int, input())) answ=True copy=sp[:] for i in range(len(allow)): if allow[i]==0: if sp[i]>sp[i+1]: answ=False if answ: while True: newsp=sp[:] for i in range(len(allow)): if allow[i]==1: if sp[i]>sp[i>>1]: sp[i+1],sp[i]=sp[i],sp[i+1] if newsp==sp: break if sp==sorted(copy): print('YES') else: print('NO') else: print('NO')
if sp[i]>sp[i>>1]:
16
operation
n=int(input()) sp=list(map(int,input().split())) allow=list(map(int, input())) answ=True copy=sp[:] for i in range(len(allow)): if allow[i]==0: if sp[i]>sp[i+1]: answ=False if answ: while True: newsp=sp[:] for i in range(len(allow)): if allow[i]==1: if sp[i]>sp[i+1]: sp[i+1],sp[i]=sp[i],sp[i+1] if newsp==sp: break if sp==sorted(copy): print('YES') else: print('NO') else: print('NO')
n=int(input()) sp=list(map(int,input().split())) allow=list(map(int, input())) answ=True copy=sp[:] for i in range(len(allow)): if allow[i]==0: if sp[i]==sp[i+1]: answ=False if answ: while True: newsp=sp[:] for i in range(len(allow)): if allow[i]==1: if sp[i]>sp[i+1]: sp[i+1],sp[i]=sp[i],sp[i+1] if newsp==sp: break if sp==sorted(copy): print('YES') else: print('NO') else: print('NO')
if sp[i]==sp[i+1]:
9
decision
n=int(input()) sp=list(map(int,input().split())) allow=list(map(int, input())) answ=True copy=sp[:] for i in range(len(allow)): if allow[i]==0: if sp[i]>sp[i+1]: answ=False if answ: while True: newsp=sp[:] for i in range(len(allow)): if allow[i]==1: if sp[i]>sp[i+1]: sp[i+1],sp[i]=sp[i],sp[i+1] if newsp==sp: break if sp==sorted(copy): print('YES') else: print('NO') else: print('NO')
n=int(input()) sp=list(map(int,input().split())) allow=list(map(int, input())) answ=True copy=sp[:] for i in range(len(allow)): if allow[i]==0: if sp[i]>sp[i**1]: answ=False if answ: while True: newsp=sp[:] for i in range(len(allow)): if allow[i]==1: if sp[i]>sp[i+1]: sp[i+1],sp[i]=sp[i],sp[i+1] if newsp==sp: break if sp==sorted(copy): print('YES') else: print('NO') else: print('NO')
if sp[i]>sp[i**1]:
9
operation
n,k=map(int,input().split()) m=[0]+list(map(int,input().split())) dp=[0]*(n+1) for i in range(n,0,-1): if dp[i]: continue r,l=max(1,i-k),min(n,i+k) x=i while x: ans+=min(x,k)+l-x dp[x]=str(ans) l=max(1,x-k) x=m[x] print(' '.join(dp[1:]))
n,k=map(int,input().split()) m=[0]+list(map(int,input().split())) dp=[0]*(n^1) for i in range(n,0,-1): if dp[i]: continue r,l=max(1,i-k),min(n,i+k) x=i while x: ans+=min(x,k)+l-x dp[x]=str(ans) l=max(1,x-k) x=m[x] print(' '.join(dp[1:]))
dp=[0]*(n^1)
3
operation
n,k=map(int,input().split()) m=[0]+list(map(int,input().split())) dp=[0]*(n+1) for i in range(n,0,-1): if dp[i]: continue r,l=max(1,i-k),min(n,i+k) x=i while x: ans+=min(x,k)+l-x dp[x]=str(ans) l=max(1,x-k) x=m[x] print(' '.join(dp[1:]))
n,k=map(int,input().split()) m=[0]+list(map(int,input().split())) dp=[0]//(n+1) for i in range(n,0,-1): if dp[i]: continue r,l=max(1,i-k),min(n,i+k) x=i while x: ans+=min(x,k)+l-x dp[x]=str(ans) l=max(1,x-k) x=m[x] print(' '.join(dp[1:]))
dp=[0]//(n+1)
3
operation
n,k=map(int,input().split()) m=[0]+list(map(int,input().split())) dp=[0]*(n+1) for i in range(n,0,-1): if dp[i]: continue r,l=max(1,i-k),min(n,i+k) x=i while x: ans+=min(x,k)+l-x dp[x]=str(ans) l=max(1,x-k) x=m[x] print(' '.join(dp[1:]))
n,k=map(int,input().split()) m=[0]+list(map(int,input().split())) dp=[0]*(n+1) for i in range(n,124,-1): if dp[i]: continue r,l=max(1,i-k),min(n,i+k) x=i while x: ans+=min(x,k)+l-x dp[x]=str(ans) l=max(1,x-k) x=m[x] print(' '.join(dp[1:]))
for i in range(n,124,-1):
4
value
n = int(input()) a = list(map(int,input().split())) m = min(a) d = 9999 for i in range(n-1): if a[i] == m: tmp = 0 for j in range(i+1,n,1): tmp +=1 if a[j] == m: break; d = min(tmp,d) print(d)
n = int(input()) a = list(map(int,input().split())) m = min(a) d = 9999 for i in range(n**1): if a[i] == m: tmp = 0 for j in range(i+1,n,1): tmp +=1 if a[j] == m: break; d = min(tmp,d) print(d)
for i in range(n**1):
7
operation
n = int(input()) a = list(map(int,input().split())) m = min(a) d = 9999 for i in range(n-1): if a[i] == m: tmp = 0 for j in range(i+1,n,1): tmp +=1 if a[j] == m: break; d = min(tmp,d) print(d)
n = int(input()) a = list(map(int,input().split())) m = min(a) d = 9999 for i in range(n-1): if a[i]<m: tmp = 0 for j in range(i+1,n,1): tmp +=1 if a[j] == m: break; d = min(tmp,d) print(d)
if a[i]<m:
9
decision