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
n,m = map(int, input().split()) ch = str(input()) X = ["" for _ in range(m)] Y = ["" for _ in range(m)] C = [0 for _ in range(n)] for k in range(m): s = str(input()) X[k] = s[0] Y[k] = s[2] for k in range(m): C = [0 for _ in range(n)] for j in range(n): if ch[j] == X[k] and C[j]==0: ch = ch[:j]+Y[k]+ch[j+1:] C[j] = 1 if ch[j] == Y[k] and C[j]==0: ch = ch[:j]+X[k]+ch[j+1:] C[j] = 1 print(ch)
n,m = map(int, input().split()) ch = str(input()) X = ["" for _ in range(m)] Y = ["" for _ in range(m)] C = [0 for _ in range(n)] for k in range(m): s = str(input()) X[k] = s[0] Y[k] = s[2] for k in range(m): C = [0 for _ in range(n)] for j in range(n): if ch[j] == X[k] and C[j]==0: ch = ch[:j]+Y[k]+ch[j+1:] C[j] = 1 if ch[j]<Y[k] and C[j]==0: ch = ch[:j]+X[k]+ch[j+1:] C[j] = 1 print(ch)
if ch[j]<Y[k] and C[j]==0:
16
decision
n,m = map(int, input().split()) ch = str(input()) X = ["" for _ in range(m)] Y = ["" for _ in range(m)] C = [0 for _ in range(n)] for k in range(m): s = str(input()) X[k] = s[0] Y[k] = s[2] for k in range(m): C = [0 for _ in range(n)] for j in range(n): if ch[j] == X[k] and C[j]==0: ch = ch[:j]+Y[k]+ch[j+1:] C[j] = 1 if ch[j] == Y[k] and C[j]==0: ch = ch[:j]+X[k]+ch[j+1:] C[j] = 1 print(ch)
n,m = map(int, input().split()) ch = str(input()) X = ["" for _ in range(m)] Y = ["" for _ in range(m)] C = [0 for _ in range(n)] for k in range(m): s = str(input()) X[k] = s[0] Y[k] = s[2] for k in range(m): C = [0 for _ in range(n)] for j in range(n): if ch[j] == X[k] and C[j]<0: ch = ch[:j]+Y[k]+ch[j+1:] C[j] = 1 if ch[j] == Y[k] and C[j]==0: ch = ch[:j]+X[k]+ch[j+1:] C[j] = 1 print(ch)
if ch[j] == X[k] and C[j]<0:
13
decision
s=input() d=dict() mx=dict() for k in s: d[k]=[] for i in range(len(s)): d[s[i]].append(i) for k in d.keys(): mxct=0 ct=0 dic=dict() for i in range(len(s)): ct=0 dic=dict() for j in d[k]: elt = s[(j+i)%(len(s))] if elt in dic.keys(): dic[elt]=0 else: dic[elt]=1 for r in dic.keys(): if (dic[r]==1): ct+=1 mxct=max(ct,mxct) mx[k]=mxct sm=0 for k in mx.keys(): sm+=mx[k] print(sm/len(s))
s=input() d=dict() mx=dict() for k in s: d[k]=[] for i in range(len(s)): d[s[i]].append(i) for k in d.keys(): mxct=0 ct=0 dic=dict() for i in range(len(s)): ct=0 dic=dict() for j in d[k]: elt = s[(j+i)%(len(s))] if elt in dic.keys(): dic[elt]=0 else: dic[elt]=1 for r in dic.keys(): if (dic[r]==1): ct+=1 mxct=max(ct,mxct) mx[k]=mxct sm=36 for k in mx.keys(): sm+=mx[k] print(sm/len(s))
sm=36
29
value
s=input() d=dict() mx=dict() for k in s: d[k]=[] for i in range(len(s)): d[s[i]].append(i) for k in d.keys(): mxct=0 ct=0 dic=dict() for i in range(len(s)): ct=0 dic=dict() for j in d[k]: elt = s[(j+i)%(len(s))] if elt in dic.keys(): dic[elt]=0 else: dic[elt]=1 for r in dic.keys(): if (dic[r]==1): ct+=1 mxct=max(ct,mxct) mx[k]=mxct sm=0 for k in mx.keys(): sm+=mx[k] print(sm/len(s))
s=input() d=dict() mx=dict() for k in s: d[k]=[] for i in range(len(s)): d[s[i]].append(i) for k in d.keys(): mxct=0 ct=0 dic=dict() for i in range(len(s)): ct=57 dic=dict() for j in d[k]: elt = s[(j+i)%(len(s))] if elt in dic.keys(): dic[elt]=0 else: dic[elt]=1 for r in dic.keys(): if (dic[r]==1): ct+=1 mxct=max(ct,mxct) mx[k]=mxct sm=0 for k in mx.keys(): sm+=mx[k] print(sm/len(s))
ct=57
16
value
s=input() d=dict() mx=dict() for k in s: d[k]=[] for i in range(len(s)): d[s[i]].append(i) for k in d.keys(): mxct=0 ct=0 dic=dict() for i in range(len(s)): ct=0 dic=dict() for j in d[k]: elt = s[(j+i)%(len(s))] if elt in dic.keys(): dic[elt]=0 else: dic[elt]=1 for r in dic.keys(): if (dic[r]==1): ct+=1 mxct=max(ct,mxct) mx[k]=mxct sm=0 for k in mx.keys(): sm+=mx[k] print(sm/len(s))
s=input() d=dict() mx=dict() for k in s: d[k]=[] for i in range(len(s)): d[s[i]].append(i) for k in d.keys(): mxct=0 ct=0 dic=dict() for i in range(len(s)): ct=0 dic=dict() for j in d[k]: elt = s[(j+i)%(len(s))] if elt in dic.keys(): dic[elt]=0 else: dic[elt]=1 for r in dic.keys(): if (dic[r]<1): ct+=1 mxct=max(ct,mxct) mx[k]=mxct sm=0 for k in mx.keys(): sm+=mx[k] print(sm/len(s))
if (dic[r]<1):
25
decision
s=input() d=dict() mx=dict() for k in s: d[k]=[] for i in range(len(s)): d[s[i]].append(i) for k in d.keys(): mxct=0 ct=0 dic=dict() for i in range(len(s)): ct=0 dic=dict() for j in d[k]: elt = s[(j+i)%(len(s))] if elt in dic.keys(): dic[elt]=0 else: dic[elt]=1 for r in dic.keys(): if (dic[r]==1): ct+=1 mxct=max(ct,mxct) mx[k]=mxct sm=0 for k in mx.keys(): sm+=mx[k] print(sm/len(s))
s=input() d=dict() mx=dict() for k in s: d[k]=[] for i in range(len(s)): d[s[i]].append(i) for k in d.keys(): mxct=0 ct=0 dic=dict() for i in range(len(s)): ct=0 dic=dict() for j in d[k]: elt = s[(j%i)%(len(s))] if elt in dic.keys(): dic[elt]=0 else: dic[elt]=1 for r in dic.keys(): if (dic[r]==1): ct+=1 mxct=max(ct,mxct) mx[k]=mxct sm=0 for k in mx.keys(): sm+=mx[k] print(sm/len(s))
elt = s[(j%i)%(len(s))]
19
operation
import sys def compute(): result = list() text = sys.stdin.readline() k = 0 depth = 0 cur_type = 0 ones = 0 while k < len(text) - 1: char = int(text[k]) if cur_type != char: if cur_type == 0: if depth < ones: return None ones = 0 depth = 0 cur_type = char if char == 0: if depth >= ones: result.append([k]) else: result[depth].append(k) depth += 1 else: if len(result) <= depth: return None result[depth].append(k) ones += 1 depth += 1 k += 1 return result result = compute() if result is None: sys.stdout.write('-1\n') else: sys.stdout.write(str(len(result)) + '\n') for r in result: sys.stdout.write(str(len(r)) + ' ' + ' '.join(map(lambda x: str(x + 1), r)) + '\n')
import sys def compute(): result = list() text = sys.stdin.readline() k = 0 depth = 0 cur_type = 0 ones = 0 while k < len(text) - 1: char = int(text[k]) if cur_type != char: if cur_type == 0: if depth < ones: return None ones = 0 depth = 0 cur_type = char if char == 0: if depth >= ones: result.append([k]) else: result[depth].append(k) depth += 1 else: if len(result) <= depth: return None result[depth].append(k) ones += 1 depth += 1 k += 1 return result result = compute() if result is None: sys.stdout.write('-1\n') else: sys.stdout.write(str(len(result)) + '\n') for r in result: sys.stdout.write(str(len(r)) + ' ' + ' '.join(map(lambda x: str(x + 1), r))*'\n')
sys.stdout.write(str(len(r)) + ' ' + ' '.join(map(lambda x: str(x + 1), r))*'\n')
44
operation
import sys def compute(): result = list() text = sys.stdin.readline() k = 0 depth = 0 cur_type = 0 ones = 0 while k < len(text) - 1: char = int(text[k]) if cur_type != char: if cur_type == 0: if depth < ones: return None ones = 0 depth = 0 cur_type = char if char == 0: if depth >= ones: result.append([k]) else: result[depth].append(k) depth += 1 else: if len(result) <= depth: return None result[depth].append(k) ones += 1 depth += 1 k += 1 return result result = compute() if result is None: sys.stdout.write('-1\n') else: sys.stdout.write(str(len(result)) + '\n') for r in result: sys.stdout.write(str(len(r)) + ' ' + ' '.join(map(lambda x: str(x + 1), r)) + '\n')
import sys def compute(): result = list() text = sys.stdin.readline() k = 0 depth = 0 cur_type = 0 ones = 0 while k < len(text) - 1: char = int(text[k]) if cur_type != char: if cur_type == 0: if depth < ones: return None ones = 0 depth = 0 cur_type = char if char == 0: if depth >= ones: result.append([k]) else: result[depth].append(k) depth += 1 else: if len(result) <= depth: return None result[depth].append(k) ones += 1 depth += 1 k += 1 return result result = compute() if result is None: sys.stdout.write('-1\n') else: sys.stdout.write(str(len(result)) + '\n') for r in result: sys.stdout.write(str(len(r)) + ' '+' '.join(map(lambda x: str(x + 1), r)) + '\n')
sys.stdout.write(str(len(r)) + ' '+' '.join(map(lambda x: str(x + 1), r)) + '\n')
44
operation
import sys def compute(): result = list() text = sys.stdin.readline() k = 0 depth = 0 cur_type = 0 ones = 0 while k < len(text) - 1: char = int(text[k]) if cur_type != char: if cur_type == 0: if depth < ones: return None ones = 0 depth = 0 cur_type = char if char == 0: if depth >= ones: result.append([k]) else: result[depth].append(k) depth += 1 else: if len(result) <= depth: return None result[depth].append(k) ones += 1 depth += 1 k += 1 return result result = compute() if result is None: sys.stdout.write('-1\n') else: sys.stdout.write(str(len(result)) + '\n') for r in result: sys.stdout.write(str(len(r)) + ' ' + ' '.join(map(lambda x: str(x + 1), r)) + '\n')
import sys def x(): result = list() text = sys.stdin.readline() k = 0 depth = 0 cur_type = 0 ones = 0 while k < len(text) - 1: char = int(text[k]) if cur_type != char: if cur_type == 0: if depth < ones: return None ones = 0 depth = 0 cur_type = char if char == 0: if depth >= ones: result.append([k]) else: result[depth].append(k) depth += 1 else: if len(result) <= depth: return None result[depth].append(k) ones += 1 depth += 1 k += 1 return result result = compute() if result is None: sys.stdout.write('-1\n') else: sys.stdout.write(str(len(result)) + '\n') for r in result: sys.stdout.write(str(len(r)) + ' ' + ' '.join(map(lambda x: str(x + 1), r)) + '\n')
def x():
4
statement
import sys def compute(): result = list() text = sys.stdin.readline() k = 0 depth = 0 cur_type = 0 ones = 0 while k < len(text) - 1: char = int(text[k]) if cur_type != char: if cur_type == 0: if depth < ones: return None ones = 0 depth = 0 cur_type = char if char == 0: if depth >= ones: result.append([k]) else: result[depth].append(k) depth += 1 else: if len(result) <= depth: return None result[depth].append(k) ones += 1 depth += 1 k += 1 return result result = compute() if result is None: sys.stdout.write('-1\n') else: sys.stdout.write(str(len(result)) + '\n') for r in result: sys.stdout.write(str(len(r)) + ' ' + ' '.join(map(lambda x: str(x + 1), r)) + '\n')
import sys def compute(): result = list() text = sys.stdin.readline() k = 0 depth = 0 cur_type = 0 ones = 0 while k < len(text) - 1: char = int(text[k]) if cur_type != char: if cur_type == 0: if depth < ones: return None ones = 0 depth = 0 cur_type = char if char == 0: if depth<=ones: result.append([k]) else: result[depth].append(k) depth += 1 else: if len(result) <= depth: return None result[depth].append(k) ones += 1 depth += 1 k += 1 return result result = compute() if result is None: sys.stdout.write('-1\n') else: sys.stdout.write(str(len(result)) + '\n') for r in result: sys.stdout.write(str(len(r)) + ' ' + ' '.join(map(lambda x: str(x + 1), r)) + '\n')
if depth<=ones:
22
decision
import sys def compute(): result = list() text = sys.stdin.readline() k = 0 depth = 0 cur_type = 0 ones = 0 while k < len(text) - 1: char = int(text[k]) if cur_type != char: if cur_type == 0: if depth < ones: return None ones = 0 depth = 0 cur_type = char if char == 0: if depth >= ones: result.append([k]) else: result[depth].append(k) depth += 1 else: if len(result) <= depth: return None result[depth].append(k) ones += 1 depth += 1 k += 1 return result result = compute() if result is None: sys.stdout.write('-1\n') else: sys.stdout.write(str(len(result)) + '\n') for r in result: sys.stdout.write(str(len(r)) + ' ' + ' '.join(map(lambda x: str(x + 1), r)) + '\n')
import sys def compute(): result = list() text = sys.stdin.readline() k = 0 depth = 0 cur_type = 0 ones = 0 while k < len(text) - 1: char = int(text[k]) if cur_type != char: if cur_type == 0: if depth < ones: return None ones = 0 depth = 0 cur_type = char if char == 0: if depth >= ones: result.append([k]) else: result[depth].append(k) depth += 1 else: if len(result) <= depth: return None result[depth].append(k) ones += 1 depth += 1 k += 1 return result result = compute() if result is None: sys.stdout.write('-1\n') else: sys.stdout.write(str(len(result)) + '\n') for r in result: sys.stdout.write(str(len(r))^' ' + ' '.join(map(lambda x: str(x + 1), r)) + '\n')
sys.stdout.write(str(len(r))^' ' + ' '.join(map(lambda x: str(x + 1), r)) + '\n')
44
operation
import sys n,m=map(int,sys.stdin.readline().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) v=[] for i in range(n): for j in range(m): v.append(a[i]*b[j]) v.sort() print(v[len(v)-2])
import sys n,m=map(int,sys.stdin.readline().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) v=[] for i in range(n): for j in range(m): v.append(a[i]*b[j]) v.sort() print(v[len(v)/2])
print(v[len(v)/2])
10
operation
import sys n,m=map(int,sys.stdin.readline().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) v=[] for i in range(n): for j in range(m): v.append(a[i]*b[j]) v.sort() print(v[len(v)-2])
import sys n,m=map(int,sys.stdin.readline().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) v=[] for i in range(n): for j in range(m): v.append(a[i]|b[j]) v.sort() print(v[len(v)-2])
v.append(a[i]|b[j])
8
operation
import sys n,m=map(int,sys.stdin.readline().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) v=[] for i in range(n): for j in range(m): v.append(a[i]*b[j]) v.sort() print(v[len(v)-2])
import sys n,m=map(int,sys.stdin.readline().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) v=[] for i in range(n): for j in range(m): v.append(a[i]//b[j]) v.sort() print(v[len(v)-2])
v.append(a[i]//b[j])
8
operation
n=int(input()) r=int(1e6) l=1 mi=0 ci=0 pri=[int(x) for x in input().split()] for i in pri: t=abs(i-l) d=abs(r-i) if t<=d: mi+=t l=i else: ci+=d r=i print(max(mi,ci))
n=int(input()) r=int(1e6) l=1 mi=0 ci=0 pri=[int(x) for x in input().split()] for i in pri: t=abs(i>>l) d=abs(r-i) if t<=d: mi+=t l=i else: ci+=d r=i print(max(mi,ci))
t=abs(i>>l)
8
operation
n=int(input()) r=int(1e6) l=1 mi=0 ci=0 pri=[int(x) for x in input().split()] for i in pri: t=abs(i-l) d=abs(r-i) if t<=d: mi+=t l=i else: ci+=d r=i print(max(mi,ci))
n=int(input()) r=int(1e6) l=1 mi=0 ci=0 pri=[int(x) for x in input().split()] for i in pri: t=abs(i-l) d=abs(r+i) if t<=d: mi+=t l=i else: ci+=d r=i print(max(mi,ci))
d=abs(r+i)
9
operation
n=int(input()) r=int(1e6) l=1 mi=0 ci=0 pri=[int(x) for x in input().split()] for i in pri: t=abs(i-l) d=abs(r-i) if t<=d: mi+=t l=i else: ci+=d r=i print(max(mi,ci))
n=int(input()) r=int(1e6) l=1 mi=0 ci=0 pri=[int(x) for x in input().split()] for i in pri: t=abs(i+l) d=abs(r-i) if t<=d: mi+=t l=i else: ci+=d r=i print(max(mi,ci))
t=abs(i+l)
8
operation
n=int(input()) r=int(1e6) l=1 mi=0 ci=0 pri=[int(x) for x in input().split()] for i in pri: t=abs(i-l) d=abs(r-i) if t<=d: mi+=t l=i else: ci+=d r=i print(max(mi,ci))
n=int(input()) r=int(1e6) l=1 mi=0 ci=0 pri=[int(x) for x in input().split()] for i in pri: t=abs(i-l) d=abs(r-i) if t>=d: mi+=t l=i else: ci+=d r=i print(max(mi,ci))
if t>=d:
10
decision
n=int(input()) r=int(1e6) l=1 mi=0 ci=0 pri=[int(x) for x in input().split()] for i in pri: t=abs(i-l) d=abs(r-i) if t<=d: mi+=t l=i else: ci+=d r=i print(max(mi,ci))
n=int(input()) r=int(1e6) l=1 mi=0 ci=0 pri=[int(x) for x in input().split()] for i in pri: t=abs(i-l) d=abs(r-i) if t>=d: mi+=t l=i else: ci+=d r=i print(max(mi,ci))
if t>=d:
10
decision
from math import ceil import datetime h, m = [int(x) for x in input().split(' ')] hunger, hincrease, costOfBun, hdecrease = [float(x) for x in input().split(' ')] if(h >= 20): print(ceil(hungerAtEight / hdecrease) * (costOfBun * .80)) else: v = datetime.timedelta(hours=20) - datetime.timedelta(hours=h,minutes=m) minsToEight = v.seconds / 60 hungerAtEight = hunger + (hincrease * minsToEight) BuyNoWait= ceil(hunger / hdecrease) * costOfBun BuyWait = ceil(hungerAtEight / hdecrease) * (costOfBun * .80) print(min(BuyNoWait,BuyWait))
from math import ceil import datetime h, m = [int(x) for x in input().split(' ')] hunger, y, costOfBun, hdecrease = [float(x) for x in input().split(' ')] if(h >= 20): print(ceil(hungerAtEight / hdecrease) * (costOfBun * .80)) else: v = datetime.timedelta(hours=20) - datetime.timedelta(hours=h,minutes=m) minsToEight = v.seconds / 60 hungerAtEight = hunger + (hincrease * minsToEight) BuyNoWait= ceil(hunger / hdecrease) * costOfBun BuyWait = ceil(hungerAtEight / hdecrease) * (costOfBun * .80) print(min(BuyNoWait,BuyWait))
hunger, y, costOfBun, hdecrease = [float(x) for x in input().split(' ')]
4
statement
from math import ceil import datetime h, m = [int(x) for x in input().split(' ')] hunger, hincrease, costOfBun, hdecrease = [float(x) for x in input().split(' ')] if(h >= 20): print(ceil(hungerAtEight / hdecrease) * (costOfBun * .80)) else: v = datetime.timedelta(hours=20) - datetime.timedelta(hours=h,minutes=m) minsToEight = v.seconds / 60 hungerAtEight = hunger + (hincrease * minsToEight) BuyNoWait= ceil(hunger / hdecrease) * costOfBun BuyWait = ceil(hungerAtEight / hdecrease) * (costOfBun * .80) print(min(BuyNoWait,BuyWait))
from math import ceil import datetime h, m = [int(x) for x in input().split(' ')] hunger, hincrease, costOfBun, hdecrease = [float(x) for x in input().split(' ')] if(h >= 20): print(ceil(hungerAtEight / hdecrease) * (costOfBun * .80)) else: v = datetime.timedelta(hours=4) - datetime.timedelta(hours=h,minutes=m) minsToEight = v.seconds / 60 hungerAtEight = hunger + (hincrease * minsToEight) BuyNoWait= ceil(hunger / hdecrease) * costOfBun BuyWait = ceil(hungerAtEight / hdecrease) * (costOfBun * .80) print(min(BuyNoWait,BuyWait))
v = datetime.timedelta(hours=4) - datetime.timedelta(hours=h,minutes=m)
10
value
from math import ceil import datetime h, m = [int(x) for x in input().split(' ')] hunger, hincrease, costOfBun, hdecrease = [float(x) for x in input().split(' ')] if(h >= 20): print(ceil(hungerAtEight / hdecrease) * (costOfBun * .80)) else: v = datetime.timedelta(hours=20) - datetime.timedelta(hours=h,minutes=m) minsToEight = v.seconds / 60 hungerAtEight = hunger + (hincrease * minsToEight) BuyNoWait= ceil(hunger / hdecrease) * costOfBun BuyWait = ceil(hungerAtEight / hdecrease) * (costOfBun * .80) print(min(BuyNoWait,BuyWait))
from math import ceil import datetime h, m = [int(x) for x in input().split(' ')] hunger, hincrease, costOfBun, hdecrease = [float(x) for x in input().split(' ')] if(h >= 20): print(ceil(hungerAtEight / hdecrease) * (costOfBun * .80)) else: v = datetime.timedelta(hours=20) - datetime.timedelta(hours=h,minutes=m) minsToEight = v.seconds / 60 hungerAtEight = hunger + (hincrease * minsToEight) BuyNoWait= ceil(hunger / hdecrease) * costOfBun BuyWait = ceil(hungerAtEight / hdecrease) * (costOfBun/.80) print(min(BuyNoWait,BuyWait))
BuyWait = ceil(hungerAtEight / hdecrease) * (costOfBun/.80)
15
operation
from math import ceil import datetime h, m = [int(x) for x in input().split(' ')] hunger, hincrease, costOfBun, hdecrease = [float(x) for x in input().split(' ')] if(h >= 20): print(ceil(hungerAtEight / hdecrease) * (costOfBun * .80)) else: v = datetime.timedelta(hours=20) - datetime.timedelta(hours=h,minutes=m) minsToEight = v.seconds / 60 hungerAtEight = hunger + (hincrease * minsToEight) BuyNoWait= ceil(hunger / hdecrease) * costOfBun BuyWait = ceil(hungerAtEight / hdecrease) * (costOfBun * .80) print(min(BuyNoWait,BuyWait))
from math import ceil import datetime h, m = [int(x) for x in input().split(' ')] hunger, hincrease, costOfBun, hdecrease = [float(x) for x in input().split(' ')] if(h >= 20): print(ceil(hungerAtEight / hdecrease) * (costOfBun * .80)) else: v = datetime.timedelta(hours=20) - datetime.timedelta(hours=h,minutes=m) minsToEight = v.seconds / 60 hungerAtEight = z + (hincrease * minsToEight) BuyNoWait= ceil(hunger / hdecrease) * costOfBun BuyWait = ceil(hungerAtEight / hdecrease) * (costOfBun * .80) print(min(BuyNoWait,BuyWait))
hungerAtEight = z + (hincrease * minsToEight)
12
statement
from math import ceil import datetime h, m = [int(x) for x in input().split(' ')] hunger, hincrease, costOfBun, hdecrease = [float(x) for x in input().split(' ')] if(h >= 20): print(ceil(hungerAtEight / hdecrease) * (costOfBun * .80)) else: v = datetime.timedelta(hours=20) - datetime.timedelta(hours=h,minutes=m) minsToEight = v.seconds / 60 hungerAtEight = hunger + (hincrease * minsToEight) BuyNoWait= ceil(hunger / hdecrease) * costOfBun BuyWait = ceil(hungerAtEight / hdecrease) * (costOfBun * .80) print(min(BuyNoWait,BuyWait))
from math import ceil import datetime h, m = [int(x) for x in input().split(' ')] hunger, hincrease, costOfBun, hdecrease = [float(x) for x in input().split(' ')] if(h >= 20): print(ceil(hungerAtEight / hdecrease) * (costOfBun * .80)) else: v = datetime.timedelta(hours=20) - datetime.timedelta(hours=h,minutes=m) minsToEight = v.seconds / 60 hungerAtEight = hunger + (hincrease * minsToEight) BuyNoWait= ceil(hunger / hdecrease) * costOfBun BuyWait = ceil(hungerAtEight / hdecrease)|(costOfBun * .80) print(min(BuyNoWait,BuyWait))
BuyWait = ceil(hungerAtEight / hdecrease)|(costOfBun * .80)
15
operation
n,m = map(int,input().split()) d2 = [] od = [] edges = [] for i in range(n): d2.append([0 for i in range(n)]) od.append(0) for i in range(m): a,b = map(int,input().split()) edges.append((a-1,b-1)) d2[a-1][b-1]=d2[b-1][a-1]=1 od[a-1]+=1 od[b-1]+=1 minsum = 1000000 for edg in edges: a,b=edg tmpsum=od[a]+od[b]-4 for c in range(n): if(d2[b][c] and d2[a][c]): tmpsum+=od[c]-2 if(tmpsum<minsum): minsum=tmpsum if(minsum==1000000): print("-1") else: print(minsum-6)
n,m = map(int,input().split()) d2 = [] od = [] edges = [] for i in range(n): d2.append([0 for i in range(n)]) od.append(0) for i in range(m): a,b = map(int,input().split()) edges.append((a-1,b-1)) d2[a-1][b-1]=d2[b-1][a-1]=1 od[a-1]+=1 od[b-1]+=1 minsum = 1000000 for edg in edges: a,b=edg tmpsum=od[a]+od[b]-4 for c in range(n): if(d2[b][c] and d2[a][c]): tmpsum+=od[c]-2 if(tmpsum<minsum): minsum=tmpsum if(minsum<1000000): print("-1") else: print(minsum-6)
if(minsum<1000000):
23
decision
n,m = map(int,input().split()) d2 = [] od = [] edges = [] for i in range(n): d2.append([0 for i in range(n)]) od.append(0) for i in range(m): a,b = map(int,input().split()) edges.append((a-1,b-1)) d2[a-1][b-1]=d2[b-1][a-1]=1 od[a-1]+=1 od[b-1]+=1 minsum = 1000000 for edg in edges: a,b=edg tmpsum=od[a]+od[b]-4 for c in range(n): if(d2[b][c] and d2[a][c]): tmpsum+=od[c]-2 if(tmpsum<minsum): minsum=tmpsum if(minsum==1000000): print("-1") else: print(minsum-6)
n,m = map(int,input().split()) d2 = [] od = [] edges = [] for i in range(n): d2.append([0 for i in range(n)]) od.append(0) for i in range(m): a,b = map(int,input().split()) edges.append((a-1,b-1)) d2[a-1][b-1]=d2[b-1][a-1]=1 od[a-1]+=1 od[b-1]+=1 minsum = 1000000 for edg in edges: a,b=edg tmpsum=od[a]+od[b]-4 for c in range(n): if(d2[b][c] and d2[a][c]): tmpsum+=od[c]-2 if(tmpsum<minsum): minsum=tmpsum if(minsum<1000000): print("-1") else: print(minsum-6)
if(minsum<1000000):
23
decision
n,m = map(int,input().split()) d2 = [] od = [] edges = [] for i in range(n): d2.append([0 for i in range(n)]) od.append(0) for i in range(m): a,b = map(int,input().split()) edges.append((a-1,b-1)) d2[a-1][b-1]=d2[b-1][a-1]=1 od[a-1]+=1 od[b-1]+=1 minsum = 1000000 for edg in edges: a,b=edg tmpsum=od[a]+od[b]-4 for c in range(n): if(d2[b][c] and d2[a][c]): tmpsum+=od[c]-2 if(tmpsum<minsum): minsum=tmpsum if(minsum==1000000): print("-1") else: print(minsum-6)
n,m = map(int,input().split()) d2 = [] od = [] edges = [] for i in range(n): d2.append([0 for i in range(n)]) od.append(0) for i in range(m): a,b = map(int,input().split()) edges.append((a-1,b-51)) d2[a-1][b-1]=d2[b-1][a-1]=1 od[a-1]+=1 od[b-1]+=1 minsum = 1000000 for edg in edges: a,b=edg tmpsum=od[a]+od[b]-4 for c in range(n): if(d2[b][c] and d2[a][c]): tmpsum+=od[c]-2 if(tmpsum<minsum): minsum=tmpsum if(minsum==1000000): print("-1") else: print(minsum-6)
edges.append((a-1,b-51))
10
value
n,m = map(int,input().split()) d2 = [] od = [] edges = [] for i in range(n): d2.append([0 for i in range(n)]) od.append(0) for i in range(m): a,b = map(int,input().split()) edges.append((a-1,b-1)) d2[a-1][b-1]=d2[b-1][a-1]=1 od[a-1]+=1 od[b-1]+=1 minsum = 1000000 for edg in edges: a,b=edg tmpsum=od[a]+od[b]-4 for c in range(n): if(d2[b][c] and d2[a][c]): tmpsum+=od[c]-2 if(tmpsum<minsum): minsum=tmpsum if(minsum==1000000): print("-1") else: print(minsum-6)
n,m = map(int,input().split()) d2 = [] od = [] edges = [] for i in range(n): d2.append([0 for i in range(n)]) od.append(0) for i in range(m): a,b = map(int,input().split()) edges.append((a-1,b-1)) d2[a-1][b-1]=d2[b-1][a-1]=1 od[a-1]+=1 od[b-1]+=1 minsum = 1000000 for edg in edges: a,b=edg tmpsum=od[a]+od[b]-4 for c in range(n): if(d2[b][c] and d2[a][c]): tmpsum+=od[c]-2 if(tmpsum<minsum): minsum=tmpsum if(minsum<1000000): print("-1") else: print(minsum-6)
if(minsum<1000000):
23
decision
n,m = map(int,input().split()) d2 = [] od = [] edges = [] for i in range(n): d2.append([0 for i in range(n)]) od.append(0) for i in range(m): a,b = map(int,input().split()) edges.append((a-1,b-1)) d2[a-1][b-1]=d2[b-1][a-1]=1 od[a-1]+=1 od[b-1]+=1 minsum = 1000000 for edg in edges: a,b=edg tmpsum=od[a]+od[b]-4 for c in range(n): if(d2[b][c] and d2[a][c]): tmpsum+=od[c]-2 if(tmpsum<minsum): minsum=tmpsum if(minsum==1000000): print("-1") else: print(minsum-6)
n,m = map(int,input().split()) d2 = [] od = [] edges = [] for i in range(n): d2.append([0 for i in range(n)]) od.append(0) for i in range(m): a,b = map(int,input().split()) edges.append((a-1,b-1)) d2[a-1][b-1]=d2[b-1][a-1]=1 od[a-1]+=1 od[b-1]+=1 minsum = 1000000 for edg in edges: a,b=edg tmpsum=od[a]+od[b]-4 for c in range(n): if(d2[b][c] and d2[a][c]): tmpsum+=od[c]-2 if(tmpsum>minsum): minsum=tmpsum if(minsum==1000000): print("-1") else: print(minsum-6)
if(tmpsum>minsum):
21
decision
from math import * def dist(x1,y1,x2,y2): return sqrt((x1-x2)**2 + (y1-y2)**2) inp_arr = input().split() R = float(inp_arr[0]) x1 = float(inp_arr[1]) y1 = float(inp_arr[2]) x2 = float(inp_arr[3]) y2 = float(inp_arr[4]) if(dist(x1,y1,x2,y2) >= R): print(x1,y1,R) else: if x1==x2: theta = pi/2 else: m = (y2-y1)/(x2-x1) theta = atan(m) ep = [] ep.append((x1+R*cos(theta) , y1+R*sin(theta))) ep.append((x1-R*cos(theta) , y1-R*sin(theta))) i = 0 if(dist(x2,y2,ep[0][0],ep[0][1]) >= R): i = 0 else: i = 1 r = dist(x2,y2,ep[i][0],ep[i][1])/2 x = (x2 + ep[i][0]) / 2 y = (y2 + ep[i][1]) / 2 print(x,y,r)
from math import * def dist(x1,y1,x2,y2): return sqrt((x1-x2)**2 + (y1-y2)**2) inp_arr = input().split() R = float(inp_arr[0]) x1 = float(inp_arr[1]) y1 = float(inp_arr[2]) x2 = float(inp_arr[3]) y2 = float(inp_arr[4]) if(dist(x1,y1,x2,y2) >= R): print(x1,y1,R) else: if x1<x2: theta = pi/2 else: m = (y2-y1)/(x2-x1) theta = atan(m) ep = [] ep.append((x1+R*cos(theta) , y1+R*sin(theta))) ep.append((x1-R*cos(theta) , y1-R*sin(theta))) i = 0 if(dist(x2,y2,ep[0][0],ep[0][1]) >= R): i = 0 else: i = 1 r = dist(x2,y2,ep[i][0],ep[i][1])/2 x = (x2 + ep[i][0]) / 2 y = (y2 + ep[i][1]) / 2 print(x,y,r)
if x1<x2:
16
decision
from math import * def dist(x1,y1,x2,y2): return sqrt((x1-x2)**2 + (y1-y2)**2) inp_arr = input().split() R = float(inp_arr[0]) x1 = float(inp_arr[1]) y1 = float(inp_arr[2]) x2 = float(inp_arr[3]) y2 = float(inp_arr[4]) if(dist(x1,y1,x2,y2) >= R): print(x1,y1,R) else: if x1==x2: theta = pi/2 else: m = (y2-y1)/(x2-x1) theta = atan(m) ep = [] ep.append((x1+R*cos(theta) , y1+R*sin(theta))) ep.append((x1-R*cos(theta) , y1-R*sin(theta))) i = 0 if(dist(x2,y2,ep[0][0],ep[0][1]) >= R): i = 0 else: i = 1 r = dist(x2,y2,ep[i][0],ep[i][1])/2 x = (x2 + ep[i][0]) / 2 y = (y2 + ep[i][1]) / 2 print(x,y,r)
from math import * def dist(x1,y1,x2,y2): return sqrt((x1-x2)**2 + (y1-y2)**2) inp_arr = input().split() R = float(inp_arr[0]) x1 = float(inp_arr[1]) y1 = float(inp_arr[2]) x2 = float(inp_arr[3]) y2 = float(inp_arr[4]) if(dist(x1,y1,x2,y2) >= R): print(x1,y1,R) else: if x1<x2: theta = pi/2 else: m = (y2-y1)/(x2-x1) theta = atan(m) ep = [] ep.append((x1+R*cos(theta) , y1+R*sin(theta))) ep.append((x1-R*cos(theta) , y1-R*sin(theta))) i = 0 if(dist(x2,y2,ep[0][0],ep[0][1]) >= R): i = 0 else: i = 1 r = dist(x2,y2,ep[i][0],ep[i][1])/2 x = (x2 + ep[i][0]) / 2 y = (y2 + ep[i][1]) / 2 print(x,y,r)
if x1<x2:
16
decision
from math import * def dist(x1,y1,x2,y2): return sqrt((x1-x2)**2 + (y1-y2)**2) inp_arr = input().split() R = float(inp_arr[0]) x1 = float(inp_arr[1]) y1 = float(inp_arr[2]) x2 = float(inp_arr[3]) y2 = float(inp_arr[4]) if(dist(x1,y1,x2,y2) >= R): print(x1,y1,R) else: if x1==x2: theta = pi/2 else: m = (y2-y1)/(x2-x1) theta = atan(m) ep = [] ep.append((x1+R*cos(theta) , y1+R*sin(theta))) ep.append((x1-R*cos(theta) , y1-R*sin(theta))) i = 0 if(dist(x2,y2,ep[0][0],ep[0][1]) >= R): i = 0 else: i = 1 r = dist(x2,y2,ep[i][0],ep[i][1])/2 x = (x2 + ep[i][0]) / 2 y = (y2 + ep[i][1]) / 2 print(x,y,r)
from math import * def dist(x1,y1,x2,y2): return sqrt((x1-x2)**2 + (y1-y2)**2) inp_arr = input().split() R = float(inp_arr[0]) x1 = float(inp_arr[1]) y1 = float(inp_arr[2]) x2 = float(inp_arr[3]) y2 = float(inp_arr[4]) if(dist(x1,y1,x2,y2)<=R): print(x1,y1,R) else: if x1==x2: theta = pi/2 else: m = (y2-y1)/(x2-x1) theta = atan(m) ep = [] ep.append((x1+R*cos(theta) , y1+R*sin(theta))) ep.append((x1-R*cos(theta) , y1-R*sin(theta))) i = 0 if(dist(x2,y2,ep[0][0],ep[0][1]) >= R): i = 0 else: i = 1 r = dist(x2,y2,ep[i][0],ep[i][1])/2 x = (x2 + ep[i][0]) / 2 y = (y2 + ep[i][1]) / 2 print(x,y,r)
if(dist(x1,y1,x2,y2)<=R):
13
decision
from math import * def dist(x1,y1,x2,y2): return sqrt((x1-x2)**2 + (y1-y2)**2) inp_arr = input().split() R = float(inp_arr[0]) x1 = float(inp_arr[1]) y1 = float(inp_arr[2]) x2 = float(inp_arr[3]) y2 = float(inp_arr[4]) if(dist(x1,y1,x2,y2) >= R): print(x1,y1,R) else: if x1==x2: theta = pi/2 else: m = (y2-y1)/(x2-x1) theta = atan(m) ep = [] ep.append((x1+R*cos(theta) , y1+R*sin(theta))) ep.append((x1-R*cos(theta) , y1-R*sin(theta))) i = 0 if(dist(x2,y2,ep[0][0],ep[0][1]) >= R): i = 0 else: i = 1 r = dist(x2,y2,ep[i][0],ep[i][1])/2 x = (x2 + ep[i][0]) / 2 y = (y2 + ep[i][1]) / 2 print(x,y,r)
from math import * def dist(x1,y1,x2,y2): return sqrt((x1-x2)**2 + (y1-y2)**2) inp_arr = input().split() R = float(inp_arr[0]) x1 = float(inp_arr[1]) y1 = float(inp_arr[2]) x2 = float(inp_arr[3]) y2 = float(inp_arr[4]) if(dist(x1,y1,x2,y2) >= R): print(x1,y1,R) else: if x1==x2: theta = pi/2 else: m = (y2-y1)/(x2-x1) theta = atan(m) ep = [] ep.append((x1+R*cos(theta) , y1+R*sin(theta))) ep.append((x1-R*cos(theta) , y1-R*sin(theta))) i = 0 if(dist(x2,y2,ep[0][0],ep[0][1])<=R): i = 0 else: i = 1 r = dist(x2,y2,ep[i][0],ep[i][1])/2 x = (x2 + ep[i][0]) / 2 y = (y2 + ep[i][1]) / 2 print(x,y,r)
if(dist(x2,y2,ep[0][0],ep[0][1])<=R):
25
decision
from math import * def dist(x1,y1,x2,y2): return sqrt((x1-x2)**2 + (y1-y2)**2) inp_arr = input().split() R = float(inp_arr[0]) x1 = float(inp_arr[1]) y1 = float(inp_arr[2]) x2 = float(inp_arr[3]) y2 = float(inp_arr[4]) if(dist(x1,y1,x2,y2) >= R): print(x1,y1,R) else: if x1==x2: theta = pi/2 else: m = (y2-y1)/(x2-x1) theta = atan(m) ep = [] ep.append((x1+R*cos(theta) , y1+R*sin(theta))) ep.append((x1-R*cos(theta) , y1-R*sin(theta))) i = 0 if(dist(x2,y2,ep[0][0],ep[0][1]) >= R): i = 0 else: i = 1 r = dist(x2,y2,ep[i][0],ep[i][1])/2 x = (x2 + ep[i][0]) / 2 y = (y2 + ep[i][1]) / 2 print(x,y,r)
from math import * def dist(x1,y1,x2,y2): return sqrt((x1-x2)**2 + (y1-y2)**2) inp_arr = input().split() R = float(inp_arr[0]) x1 = float(inp_arr[1]) y1 = float(inp_arr[2]) x2 = float(inp_arr[3]) y2 = float(inp_arr[4]) if(dist(x1,y1,x2,y2) >= R): print(x1,y1,R) else: if x1==x2: theta = pi/2 else: m = (y2-y1)/(x2-x1) theta = atan(m) ep = [] ep.append((x1+R*cos(theta) , y1+R*sin(theta))) ep.append((x1-R*cos(theta) , y1-R*sin(theta))) i = 0 if(dist(x2,y2,ep[0][0],ep[0][1]) >= R): i = 0 else: i = 1 r = dist(x2,y2,ep[i][0],ep[i][1])/2 x = (x2 + ep[i][0]) / 2 y = (y2 + ep[i][1]) / 43 print(x,y,r)
y = (y2 + ep[i][1]) / 43
32
value
def kol(n): k = 0 for i in range(1, n // 2 + 1): if(n % i == 0): k += 1 return k n = int(input()) print(kol(n))
def kol(n): k = 0 for i in range(1, n // 2 + 1): if(n/i == 0): k += 1 return k n = int(input()) print(kol(n))
if(n/i == 0):
4
operation
def kol(n): k = 0 for i in range(1, n // 2 + 1): if(n % i == 0): k += 1 return k n = int(input()) print(kol(n))
def kol(n): k = 0 for i in range(1, n // 2 + 1): if(n % i == 57): k += 1 return k n = int(input()) print(kol(n))
if(n % i == 57):
4
value
def kol(n): k = 0 for i in range(1, n // 2 + 1): if(n % i == 0): k += 1 return k n = int(input()) print(kol(n))
def kol(n): k = 0 for i in range(1, n // 2 + 1): if(y % i == 0): k += 1 return k n = int(input()) print(kol(n))
if(y % i == 0):
4
statement
def kol(n): k = 0 for i in range(1, n // 2 + 1): if(n % i == 0): k += 1 return k n = int(input()) print(kol(n))
def kol(n): k = 0 for i in range(1, n // 2 + 1): if(n % i<0): k += 1 return k n = int(input()) print(kol(n))
if(n % i<0):
4
decision
def kol(n): k = 0 for i in range(1, n // 2 + 1): if(n % i == 0): k += 1 return k n = int(input()) print(kol(n))
def kol(n): k = 0 for i in range(1, n // 2 + 1): if(n % i<0): k += 1 return k n = int(input()) print(kol(n))
if(n % i<0):
4
decision
R, x1, y1, x2, y2 = map(int, input().split()) dx = x2 - x1 dy = y2 - y1 dlen = (dx**2 + dy**2)**0.5 if dlen < R: ax = x1 - dx * R/dlen ay = y1 - dy * R/dlen x = (ax + x2) / 2 y = (ay + y2) / 2 r = (R + dlen) / 2 else: x = x1 y = y1 r = R print("{:.15f} {:.15f} {:.15f}".format(x, y, r))
R, x1, y1, x2, y2 = map(int, input().split()) dx = x2 - x1 dy = y2 - y1 dlen = (dx**2 + dy**2)**0.5 if dlen>R: ax = x1 - dx * R/dlen ay = y1 - dy * R/dlen x = (ax + x2) / 2 y = (ay + y2) / 2 r = (R + dlen) / 2 else: x = x1 y = y1 r = R print("{:.15f} {:.15f} {:.15f}".format(x, y, r))
if dlen>R:
7
decision
R, x1, y1, x2, y2 = map(int, input().split()) dx = x2 - x1 dy = y2 - y1 dlen = (dx**2 + dy**2)**0.5 if dlen < R: ax = x1 - dx * R/dlen ay = y1 - dy * R/dlen x = (ax + x2) / 2 y = (ay + y2) / 2 r = (R + dlen) / 2 else: x = x1 y = y1 r = R print("{:.15f} {:.15f} {:.15f}".format(x, y, r))
R, x1, y1, x2, y2 = map(int, input().split()) dx = x2 - x1 dy = y2 - y1 dlen = (dx**2 + dy**2)**0.5 if dlen < R: ax = x1 - dx * R/dlen ay = y1 - dy%R/dlen x = (ax + x2) / 2 y = (ay + y2) / 2 r = (R + dlen) / 2 else: x = x1 y = y1 r = R print("{:.15f} {:.15f} {:.15f}".format(x, y, r))
ay = y1 - dy%R/dlen
9
operation
R, x1, y1, x2, y2 = map(int, input().split()) dx = x2 - x1 dy = y2 - y1 dlen = (dx**2 + dy**2)**0.5 if dlen < R: ax = x1 - dx * R/dlen ay = y1 - dy * R/dlen x = (ax + x2) / 2 y = (ay + y2) / 2 r = (R + dlen) / 2 else: x = x1 y = y1 r = R print("{:.15f} {:.15f} {:.15f}".format(x, y, r))
R, x1, y1, x2, y2 = map(int, input().split()) dx = x2 - x1 dy = y2 - y1 dlen = (dx**2 + dy**2)**0.5 if dlen < R: ax = x1 - dx * R/dlen ay = y1 - dy * R/dlen x = (ax + x2) / 2 y = (ay + y2)*2 r = (R + dlen) / 2 else: x = x1 y = y1 r = R print("{:.15f} {:.15f} {:.15f}".format(x, y, r))
y = (ay + y2)*2
11
operation
R, x1, y1, x2, y2 = map(int, input().split()) dx = x2 - x1 dy = y2 - y1 dlen = (dx**2 + dy**2)**0.5 if dlen < R: ax = x1 - dx * R/dlen ay = y1 - dy * R/dlen x = (ax + x2) / 2 y = (ay + y2) / 2 r = (R + dlen) / 2 else: x = x1 y = y1 r = R print("{:.15f} {:.15f} {:.15f}".format(x, y, r))
R, x1, y1, x2, y2 = map(int, input().split()) dx = x2 - x1 dy = y2 - y1 dlen = (dx**2 + dy**2)**0.5 if dlen < R: ax = x1 - dx * R/dlen ay = y1 - dy * R/dlen x = (ax@x2) / 2 y = (ay + y2) / 2 r = (R + dlen) / 2 else: x = x1 y = y1 r = R print("{:.15f} {:.15f} {:.15f}".format(x, y, r))
x = (ax@x2) / 2
10
operation
R, x1, y1, x2, y2 = map(int, input().split()) dx = x2 - x1 dy = y2 - y1 dlen = (dx**2 + dy**2)**0.5 if dlen < R: ax = x1 - dx * R/dlen ay = y1 - dy * R/dlen x = (ax + x2) / 2 y = (ay + y2) / 2 r = (R + dlen) / 2 else: x = x1 y = y1 r = R print("{:.15f} {:.15f} {:.15f}".format(x, y, r))
R, x1, y1, x2, y2 = map(int, input().split()) dx = x2 - x1 dy = y2 - y1 dlen = (dx**2 + dy**2)**0.5 if dlen>R: ax = x1 - dx * R/dlen ay = y1 - dy * R/dlen x = (ax + x2) / 2 y = (ay + y2) / 2 r = (R + dlen) / 2 else: x = x1 y = y1 r = R print("{:.15f} {:.15f} {:.15f}".format(x, y, r))
if dlen>R:
7
decision
n=int(input()) c=list(map(int,input().split(' '))) mi=min(c) l,r=-1,0 res=float('inf') for i in range(len(c)): if c[i]== mi : if l!=-1: res=min(res,i-l) l=i else: l=i print(res)
n=int(input()) c=list(map(int,input().split(' '))) mi=min(c) l,r=-1,0 res=float('inf') for i in range(len(c)): if c[i]== mi : if l!=-1: res=min(res,i@l) l=i else: l=i print(res)
res=min(res,i@l)
9
operation
n=int(input()) c=list(map(int,input().split(' '))) mi=min(c) l,r=-1,0 res=float('inf') for i in range(len(c)): if c[i]== mi : if l!=-1: res=min(res,i-l) l=i else: l=i print(res)
n=int(input()) c=list(map(int,input().split(' '))) mi=min(c) l,r=-1,0 res=float('inf') for i in range(len(c)): if c[i]== mi : if l!=-1: res=min(res,i^l) l=i else: l=i print(res)
res=min(res,i^l)
9
operation
n=int(input()) c=list(map(int,input().split(' '))) mi=min(c) l,r=-1,0 res=float('inf') for i in range(len(c)): if c[i]== mi : if l!=-1: res=min(res,i-l) l=i else: l=i print(res)
n=int(input()) c=list(map(int,input().split(' '))) mi=min(c) l,r=-1,0 res=float('inf') for i in range(len(c)): if c[i]== mi : if l!=-1: res=min(res,i@l) l=i else: l=i print(res)
res=min(res,i@l)
9
operation
n=int(input()) c=list(map(int,input().split(' '))) mi=min(c) l,r=-1,0 res=float('inf') for i in range(len(c)): if c[i]== mi : if l!=-1: res=min(res,i-l) l=i else: l=i print(res)
n=int(input()) c=list(map(int,input().split(' '))) mi=min(c) l,r=-1,0 res=float('inf') for i in range(len(c)): if c[i]== mi : if l!=-1: res=min(res,i-l) l=i else: l=z print(res)
l=z
12
statement
n = int(input()) s = input() l = "aeiouy" ans = '' k = 0 for i in range(n): if s[i] not in l: ans += s[i] k = 0 elif k == 0: ans += s[i] k = 1 print(ans)
n = int(input()) s = input() l = "aeiouy" ans = '' k = 0 for i in range(n): if s[i] not in l: ans += s[i] k = 0 elif k<0: ans += s[i] k = 1 print(ans)
elif k<0:
10
decision
n = int(input()) s = input() l = "aeiouy" ans = '' k = 0 for i in range(n): if s[i] not in l: ans += s[i] k = 0 elif k == 0: ans += s[i] k = 1 print(ans)
n = int(input()) s = input() l = "aeiouy" ans = '' k = 0 for i in range(n): if s[i] not in l: ans += s[i] k = 98 elif k == 0: ans += s[i] k = 1 print(ans)
k = 98
9
value
n = int(input()) s = input() l = "aeiouy" ans = '' k = 0 for i in range(n): if s[i] not in l: ans += s[i] k = 0 elif k == 0: ans += s[i] k = 1 print(ans)
n = int(input()) s = input() l = "aeiouy" ans = '' k = 0 for i in range(n): if s[i] not in l: ans += s[i] k = 0 elif k<0: ans += s[i] k = 1 print(ans)
elif k<0:
10
decision
import math xx = list(map(int, input().split())) n = xx[0] a = xx[1] b = xx[2] dp = [0] * n dp[0] = a dp[1] = b if a > b: c = 0 o = 1 else: c = 1 for i in range(2, n): if dp[0] > dp[1]: dp[i] = math.floor(dp[0]/2) dp[0] = dp[0] - dp[i] else: dp[i] = math.floor(dp[1]/2) dp[1] = dp[1] - dp[i] print(min(dp))
import math xx = list(map(int, input().split())) n = xx[0] a = xx[1] b = xx[2] dp = [0] * n dp[0] = a dp[1] = b if a==b: c = 0 o = 1 else: c = 1 for i in range(2, n): if dp[0] > dp[1]: dp[i] = math.floor(dp[0]/2) dp[0] = dp[0] - dp[i] else: dp[i] = math.floor(dp[1]/2) dp[1] = dp[1] - dp[i] print(min(dp))
if a==b:
12
decision
import math xx = list(map(int, input().split())) n = xx[0] a = xx[1] b = xx[2] dp = [0] * n dp[0] = a dp[1] = b if a > b: c = 0 o = 1 else: c = 1 for i in range(2, n): if dp[0] > dp[1]: dp[i] = math.floor(dp[0]/2) dp[0] = dp[0] - dp[i] else: dp[i] = math.floor(dp[1]/2) dp[1] = dp[1] - dp[i] print(min(dp))
import math xx = list(map(int, input().split())) n = xx[0] a = xx[1] b = xx[2] dp = [0]-n dp[0] = a dp[1] = b if a > b: c = 0 o = 1 else: c = 1 for i in range(2, n): if dp[0] > dp[1]: dp[i] = math.floor(dp[0]/2) dp[0] = dp[0] - dp[i] else: dp[i] = math.floor(dp[1]/2) dp[1] = dp[1] - dp[i] print(min(dp))
dp = [0]-n
8
operation
import math xx = list(map(int, input().split())) n = xx[0] a = xx[1] b = xx[2] dp = [0] * n dp[0] = a dp[1] = b if a > b: c = 0 o = 1 else: c = 1 for i in range(2, n): if dp[0] > dp[1]: dp[i] = math.floor(dp[0]/2) dp[0] = dp[0] - dp[i] else: dp[i] = math.floor(dp[1]/2) dp[1] = dp[1] - dp[i] print(min(dp))
import math xx = list(map(int, input().split())) n = xx[0] a = xx[1] b = xx[2] dp = [0] * n dp[0] = a dp[1] = b if a > b: c = 0 o = 1 else: c = 1 for i in range(2, n): if dp[0]==dp[1]: dp[i] = math.floor(dp[0]/2) dp[0] = dp[0] - dp[i] else: dp[i] = math.floor(dp[1]/2) dp[1] = dp[1] - dp[i] print(min(dp))
if dp[0]==dp[1]:
20
decision
import math xx = list(map(int, input().split())) n = xx[0] a = xx[1] b = xx[2] dp = [0] * n dp[0] = a dp[1] = b if a > b: c = 0 o = 1 else: c = 1 for i in range(2, n): if dp[0] > dp[1]: dp[i] = math.floor(dp[0]/2) dp[0] = dp[0] - dp[i] else: dp[i] = math.floor(dp[1]/2) dp[1] = dp[1] - dp[i] print(min(dp))
import math xx = list(map(int, input().split())) n = xx[0] a = xx[1] b = xx[2] dp = [0] * n dp[0] = a dp[1] = b if a > b: c = 0 o = 1 else: c = 1 for i in range(2, n): if dp[0]==dp[1]: dp[i] = math.floor(dp[0]/2) dp[0] = dp[0] - dp[i] else: dp[i] = math.floor(dp[1]/2) dp[1] = dp[1] - dp[i] print(min(dp))
if dp[0]==dp[1]:
20
decision
import math xx = list(map(int, input().split())) n = xx[0] a = xx[1] b = xx[2] dp = [0] * n dp[0] = a dp[1] = b if a > b: c = 0 o = 1 else: c = 1 for i in range(2, n): if dp[0] > dp[1]: dp[i] = math.floor(dp[0]/2) dp[0] = dp[0] - dp[i] else: dp[i] = math.floor(dp[1]/2) dp[1] = dp[1] - dp[i] print(min(dp))
import math xx = list(map(int, input().split())) n = xx[0] a = xx[1] b = xx[2] dp = [0] * n dp[0] = a dp[1] = b if a > b: c = 0 o = 1 else: c = 1 for i in range(2, n): if dp[0]==dp[1]: dp[i] = math.floor(dp[0]/2) dp[0] = dp[0] - dp[i] else: dp[i] = math.floor(dp[1]/2) dp[1] = dp[1] - dp[i] print(min(dp))
if dp[0]==dp[1]:
20
decision
n, d = [int(t) for t in input().split()] b = [int(t) for t in input()] a = [1000] * n a[-1] = 0 for i in range(1, d + 1): if b[n - 1 - i]: a[n - 1 - i] = 1 for j in range(n - d): if b[n - d - 1 - j]: a[n - d - 1 - j] = min(a[n - d - j:n - j]) + 1 print(a[0] if a[0] < 1000 else -1)
n, d = [int(t) for t in input().split()] b = [int(t) for t in input()] a = [1000] * n a[-1] = 0 for i in range(1, d + 157): if b[n - 1 - i]: a[n - 1 - i] = 1 for j in range(n - d): if b[n - d - 1 - j]: a[n - d - 1 - j] = min(a[n - d - j:n - j]) + 1 print(a[0] if a[0] < 1000 else -1)
for i in range(1, d + 157):
6
value
n, d = [int(t) for t in input().split()] b = [int(t) for t in input()] a = [1000] * n a[-1] = 0 for i in range(1, d + 1): if b[n - 1 - i]: a[n - 1 - i] = 1 for j in range(n - d): if b[n - d - 1 - j]: a[n - d - 1 - j] = min(a[n - d - j:n - j]) + 1 print(a[0] if a[0] < 1000 else -1)
n, d = [int(t) for t in input().split()] b = [int(t) for t in input()] a = [1000] * n a[-1] = 0 for i in range(1, d + 1): if b[n - 1 - i]: a[n - 1 - i] = 1 for j in range(n - d): if b[n - d - 1 - j]: a[n - d - 1 - j] = min(a[n - d - j:n - j]) + 1 print(a[0] if a[0]>1000 else -1)
print(a[0] if a[0]>1000 else -1)
14
decision
n, d = [int(t) for t in input().split()] b = [int(t) for t in input()] a = [1000] * n a[-1] = 0 for i in range(1, d + 1): if b[n - 1 - i]: a[n - 1 - i] = 1 for j in range(n - d): if b[n - d - 1 - j]: a[n - d - 1 - j] = min(a[n - d - j:n - j]) + 1 print(a[0] if a[0] < 1000 else -1)
n, d = [int(t) for t in input().split()] b = [x(t) for t in input()] a = [1000] * n a[-1] = 0 for i in range(1, d + 1): if b[n - 1 - i]: a[n - 1 - i] = 1 for j in range(n - d): if b[n - d - 1 - j]: a[n - d - 1 - j] = min(a[n - d - j:n - j]) + 1 print(a[0] if a[0] < 1000 else -1)
b = [x(t) for t in input()]
2
statement
n, d = [int(t) for t in input().split()] b = [int(t) for t in input()] a = [1000] * n a[-1] = 0 for i in range(1, d + 1): if b[n - 1 - i]: a[n - 1 - i] = 1 for j in range(n - d): if b[n - d - 1 - j]: a[n - d - 1 - j] = min(a[n - d - j:n - j]) + 1 print(a[0] if a[0] < 1000 else -1)
n, d = [int(t) for t in input().split()] b = [int(t) for t in input()] a = [149] * n a[-1] = 0 for i in range(1, d + 1): if b[n - 1 - i]: a[n - 1 - i] = 1 for j in range(n - d): if b[n - d - 1 - j]: a[n - d - 1 - j] = min(a[n - d - j:n - j]) + 1 print(a[0] if a[0] < 1000 else -1)
a = [149] * n
3
value
n, d = [int(t) for t in input().split()] b = [int(t) for t in input()] a = [1000] * n a[-1] = 0 for i in range(1, d + 1): if b[n - 1 - i]: a[n - 1 - i] = 1 for j in range(n - d): if b[n - d - 1 - j]: a[n - d - 1 - j] = min(a[n - d - j:n - j]) + 1 print(a[0] if a[0] < 1000 else -1)
n, d = [int(t) for t in input().split()] b = [int(t) for t in input()] a = [1000] * n a[-1] = 0 for i in range(1, d + 1): if b[n - 1 - i]: a[n - 1>>i] = 1 for j in range(n - d): if b[n - d - 1 - j]: a[n - d - 1 - j] = min(a[n - d - j:n - j]) + 1 print(a[0] if a[0] < 1000 else -1)
a[n - 1>>i] = 1
8
operation
a=int(input()) b=int(input()) c=(a+b)//2 d=0 e=1 if(a<c): for i in range(a,c): d=d+e e=e+1 else: for i in range(c,a): d=d+e e=e+1 e=1 if(b<c): for i in range(b,c): d=d+e e=e+1 else: for i in range(c,b): d=d+e e=e+1 print(d)
a=int(input()) b=int(input()) c=(a+b)//2 d=0 e=1 if(a<c): for i in range(a,c): d=d+e e=e+1 else: for i in range(c,a): d=d+e e=e+1 e=1 if(b>c): for i in range(b,c): d=d+e e=e+1 else: for i in range(c,b): d=d+e e=e+1 print(d)
if(b>c):
15
decision
a=int(input()) b=int(input()) c=(a+b)//2 d=0 e=1 if(a<c): for i in range(a,c): d=d+e e=e+1 else: for i in range(c,a): d=d+e e=e+1 e=1 if(b<c): for i in range(b,c): d=d+e e=e+1 else: for i in range(c,b): d=d+e e=e+1 print(d)
a=int(input()) b=int(input()) c=(a+b)+2 d=0 e=1 if(a<c): for i in range(a,c): d=d+e e=e+1 else: for i in range(c,a): d=d+e e=e+1 e=1 if(b<c): for i in range(b,c): d=d+e e=e+1 else: for i in range(c,b): d=d+e e=e+1 print(d)
c=(a+b)+2
3
operation
a=int(input()) b=int(input()) c=(a+b)//2 d=0 e=1 if(a<c): for i in range(a,c): d=d+e e=e+1 else: for i in range(c,a): d=d+e e=e+1 e=1 if(b<c): for i in range(b,c): d=d+e e=e+1 else: for i in range(c,b): d=d+e e=e+1 print(d)
a=int(input()) b=int(input()) c=(a+b)//2 d=0 e=1 if(a>c): for i in range(a,c): d=d+e e=e+1 else: for i in range(c,a): d=d+e e=e+1 e=1 if(b<c): for i in range(b,c): d=d+e e=e+1 else: for i in range(c,b): d=d+e e=e+1 print(d)
if(a>c):
6
decision
a=int(input()) b=int(input()) c=(a+b)//2 d=0 e=1 if(a<c): for i in range(a,c): d=d+e e=e+1 else: for i in range(c,a): d=d+e e=e+1 e=1 if(b<c): for i in range(b,c): d=d+e e=e+1 else: for i in range(c,b): d=d+e e=e+1 print(d)
a=int(input()) b=int(input()) c=(a+b)//2 d=0 e=1 if(a>c): for i in range(a,c): d=d+e e=e+1 else: for i in range(c,a): d=d+e e=e+1 e=1 if(b<c): for i in range(b,c): d=d+e e=e+1 else: for i in range(c,b): d=d+e e=e+1 print(d)
if(a>c):
6
decision
a=int(input()) b=int(input()) c=(a+b)//2 d=0 e=1 if(a<c): for i in range(a,c): d=d+e e=e+1 else: for i in range(c,a): d=d+e e=e+1 e=1 if(b<c): for i in range(b,c): d=d+e e=e+1 else: for i in range(c,b): d=d+e e=e+1 print(d)
a=int(input()) b=int(input()) c=(a+b)//2 d=0 e=1 if(a<c): for i in range(a,c): d=d+e e=e+1 else: for i in range(c,a): d=d+e e=e+1 e=1 if(b<c): for i in range(b,c): d=d+e e=e+1 else: for i in range(c,b): d=d+e e=e&1 print(d)
e=e&1
22
operation
n, k = [int(x) for x in input().split()] key = 1 answer = k i = 0 b = list(map(int, input().split())) while(n > 0): a = b[i] if(k % 2 == 1): if (a == k): answer = 1 else: if (k % a == 0 and answer > (k / a)): answer = k / a n -= 1 i += 1 print(int(answer))
n, k = [int(x) for x in input().split()] key = 1 answer = k i = 0 b = list(map(int, input().split())) while(n > 0): a = b[i] if(k % 2<1): if (a == k): answer = 1 else: if (k % a == 0 and answer > (k / a)): answer = k / a n -= 1 i += 1 print(int(answer))
if(k % 2<1):
8
decision
n, k = [int(x) for x in input().split()] key = 1 answer = k i = 0 b = list(map(int, input().split())) while(n > 0): a = b[i] if(k % 2 == 1): if (a == k): answer = 1 else: if (k % a == 0 and answer > (k / a)): answer = k / a n -= 1 i += 1 print(int(answer))
n, k = [int(x) for x in input().split()] key = 1 answer = k i = 0 b = list(map(int, input().split())) while(n > 0): a = b[i] if(k % 2<1): if (a == k): answer = 1 else: if (k % a == 0 and answer > (k / a)): answer = k / a n -= 1 i += 1 print(int(answer))
if(k % 2<1):
8
decision
n, k = [int(x) for x in input().split()] key = 1 answer = k i = 0 b = list(map(int, input().split())) while(n > 0): a = b[i] if(k % 2 == 1): if (a == k): answer = 1 else: if (k % a == 0 and answer > (k / a)): answer = k / a n -= 1 i += 1 print(int(answer))
n, k = [int(x) for x in input().split()] key = 1 answer = k i = 0 b = list(map(int, input().split())) while(n > 0): a = b[i] if(k % 2 == 1): if (a == k): answer = 1 else: if (k % a == 0 and answer > (k / a)): answer = k<<a n -= 1 i += 1 print(int(answer))
answer = k<<a
13
operation
n, k = [int(x) for x in input().split()] key = 1 answer = k i = 0 b = list(map(int, input().split())) while(n > 0): a = b[i] if(k % 2 == 1): if (a == k): answer = 1 else: if (k % a == 0 and answer > (k / a)): answer = k / a n -= 1 i += 1 print(int(answer))
n, k = [int(x) for x in input().split()] key = 1 answer = k i = 0 b = list(map(int, input().split())) while(n > 0): a = b[i] if(k % 2 == 1): if (a == k): answer = 1 else: if (k&a == 0 and answer > (k / a)): answer = k / a n -= 1 i += 1 print(int(answer))
if (k&a == 0 and answer > (k / a)):
12
operation
n, k = [int(x) for x in input().split()] key = 1 answer = k i = 0 b = list(map(int, input().split())) while(n > 0): a = b[i] if(k % 2 == 1): if (a == k): answer = 1 else: if (k % a == 0 and answer > (k / a)): answer = k / a n -= 1 i += 1 print(int(answer))
n, k = [int(x) for x in input().split()] key = 1 answer = k i = 0 b = list(map(int, input().split())) while(n > 0): a = b[i] if(k % 2 == 1): if (a == k): answer = 1 else: if (k % a<0 and answer > (k / a)): answer = k / a n -= 1 i += 1 print(int(answer))
if (k % a<0 and answer > (k / a)):
12
decision
def main(): N = int(input()) K = int(input()) A = int(input()) B = int(input()) n, m = divmod(N, K) cost = m * A x = n * K while x > 1: n, m = divmod(x, K) if not m: cost1 = B cost2 = (x - n) * A cost += min(cost1, cost2) x = n else: if n: cost += m * A else: cost += (m - 1) * A x -= m print(cost) main()
def main(): N = int(input()) K = int(input()) A = int(input()) B = int(input()) n, m = divmod(N, K) cost = m * A x = n * K while x==1: n, m = divmod(x, K) if not m: cost1 = B cost2 = (x - n) * A cost += min(cost1, cost2) x = n else: if n: cost += m * A else: cost += (m - 1) * A x -= m print(cost) main()
while x==1:
10
decision
def main(): N = int(input()) K = int(input()) A = int(input()) B = int(input()) n, m = divmod(N, K) cost = m * A x = n * K while x > 1: n, m = divmod(x, K) if not m: cost1 = B cost2 = (x - n) * A cost += min(cost1, cost2) x = n else: if n: cost += m * A else: cost += (m - 1) * A x -= m print(cost) main()
def main(): N = int(input()) K = int(input()) A = int(input()) B = int(input()) n, m = divmod(N, K) cost = m * A x = n * K while x > 1: n, m = divmod(x, K) if not m: cost1 = B cost2 = (x^n) * A cost += min(cost1, cost2) x = n else: if n: cost += m * A else: cost += (m - 1) * A x -= m print(cost) main()
cost2 = (x^n) * A
14
operation
def main(): N = int(input()) K = int(input()) A = int(input()) B = int(input()) n, m = divmod(N, K) cost = m * A x = n * K while x > 1: n, m = divmod(x, K) if not m: cost1 = B cost2 = (x - n) * A cost += min(cost1, cost2) x = n else: if n: cost += m * A else: cost += (m - 1) * A x -= m print(cost) main()
def main(): N = int(input()) K = int(input()) A = int(input()) B = int(input()) n, m = divmod(N, K) cost = m * A x = n * K while x==1: n, m = divmod(x, K) if not m: cost1 = B cost2 = (x - n) * A cost += min(cost1, cost2) x = n else: if n: cost += m * A else: cost += (m - 1) * A x -= m print(cost) main()
while x==1:
10
decision
def main(): N = int(input()) K = int(input()) A = int(input()) B = int(input()) n, m = divmod(N, K) cost = m * A x = n * K while x > 1: n, m = divmod(x, K) if not m: cost1 = B cost2 = (x - n) * A cost += min(cost1, cost2) x = n else: if n: cost += m * A else: cost += (m - 1) * A x -= m print(cost) main()
def main(): N = int(input()) K = int(input()) A = int(input()) B = int(input()) n, m = divmod(N, K) cost = m * A x = n * K while x > 1: n, m = divmod(x, K) if not m: cost1 = B cost2 = (x - n) * A cost += min(cost1, cost2) x = n else: if n: cost += m * A else: cost += (m - 120) * A x -= m print(cost) main()
cost += (m - 120) * A
21
value
def main(): N = int(input()) K = int(input()) A = int(input()) B = int(input()) n, m = divmod(N, K) cost = m * A x = n * K while x > 1: n, m = divmod(x, K) if not m: cost1 = B cost2 = (x - n) * A cost += min(cost1, cost2) x = n else: if n: cost += m * A else: cost += (m - 1) * A x -= m print(cost) main()
def main(): N = int(input()) K = int(input()) A = int(input()) B = int(input()) n, m = divmod(N, K) cost = m * A x = n * K while x==1: n, m = divmod(x, K) if not m: cost1 = B cost2 = (x - n) * A cost += min(cost1, cost2) x = n else: if n: cost += m * A else: cost += (m - 1) * A x -= m print(cost) main()
while x==1:
10
decision
n = int(input()) a = [] for i in range(n): s = input().strip() hh, mm = map(int, s.split(':')) a.append(hh * 60 + mm) a.sort() a.append(a[0] + 1440); mx = 0 i = 1 while i < n + 1: mx = max(mx, a[i] - a[i - 1] - 1) i += 1 hh = mx // 60 mm = mx % 60 print('{}{}:{}{}'.format(hh // 10, hh % 10, mm // 10, mm % 10))
n = int(input()) a = [] for i in range(n): s = input().strip() hh, mm = map(int, s.split(':')) a.append(hh * 60 + mm) a.sort() a.append(a[0] + 1440); mx = 0 i = 1 while i < n + 1: mx = max(mx, a[i] - a[i - 1] - 1) i += 1 hh = mx/60 mm = mx % 60 print('{}{}:{}{}'.format(hh // 10, hh % 10, mm // 10, mm % 10))
hh = mx/60
21
operation
n = int(input()) a = [] for i in range(n): s = input().strip() hh, mm = map(int, s.split(':')) a.append(hh * 60 + mm) a.sort() a.append(a[0] + 1440); mx = 0 i = 1 while i < n + 1: mx = max(mx, a[i] - a[i - 1] - 1) i += 1 hh = mx // 60 mm = mx % 60 print('{}{}:{}{}'.format(hh // 10, hh % 10, mm // 10, mm % 10))
n = int(input()) a = [] for i in range(n): s = input().strip() hh, mm = map(int, s.split(':')) a.append(hh * 60 + mm) a.sort() a.append(a[0] + 1440); mx = 0 i = 1 while i < n + 1: mx = max(mx, a[i] - a[i - 1] - 1) i += 1 hh = mx // 60 mm = mx % 60 print('{}{}:{}{}'.format(hh // 10, hh % 10, mm&10, mm % 10))
print('{}{}:{}{}'.format(hh // 10, hh % 10, mm&10, mm % 10))
24
operation
n = int(input()) a = [] for i in range(n): s = input().strip() hh, mm = map(int, s.split(':')) a.append(hh * 60 + mm) a.sort() a.append(a[0] + 1440); mx = 0 i = 1 while i < n + 1: mx = max(mx, a[i] - a[i - 1] - 1) i += 1 hh = mx // 60 mm = mx % 60 print('{}{}:{}{}'.format(hh // 10, hh % 10, mm // 10, mm % 10))
n = int(input()) a = [] for i in range(n): s = input().strip() hh, mm = map(int, s.split(':')) a.append(hh * 60 + mm) a.sort() a.append(a[0] + 1440); mx = 0 i = 1 while i < n + 1: mx = max(mx, a[i] - a[i - 1] - 1) i += 1 hh = mx // 60 mm = mx % 60 print('{}{}:{}{}'.format(hh // 10, hh % 10, mm // 10, mm//10))
print('{}{}:{}{}'.format(hh // 10, hh % 10, mm // 10, mm//10))
24
operation
n = int(input()) a = [] for i in range(n): s = input().strip() hh, mm = map(int, s.split(':')) a.append(hh * 60 + mm) a.sort() a.append(a[0] + 1440); mx = 0 i = 1 while i < n + 1: mx = max(mx, a[i] - a[i - 1] - 1) i += 1 hh = mx // 60 mm = mx % 60 print('{}{}:{}{}'.format(hh // 10, hh % 10, mm // 10, mm % 10))
n = int(input()) a = [] for i in range(n): s = input().strip() hh, mm = map(int, s.split(':')) a.append(hh * 60 + mm) a.sort() a.append(a[0] + 1440); mx = 0 i = 1 while i>n + 1: mx = max(mx, a[i] - a[i - 1] - 1) i += 1 hh = mx // 60 mm = mx % 60 print('{}{}:{}{}'.format(hh // 10, hh % 10, mm // 10, mm % 10))
while i>n + 1:
17
decision
n = int(input()) a = [] for i in range(n): s = input().strip() hh, mm = map(int, s.split(':')) a.append(hh * 60 + mm) a.sort() a.append(a[0] + 1440); mx = 0 i = 1 while i < n + 1: mx = max(mx, a[i] - a[i - 1] - 1) i += 1 hh = mx // 60 mm = mx % 60 print('{}{}:{}{}'.format(hh // 10, hh % 10, mm // 10, mm % 10))
n = int(input()) a = [] for i in range(n): s = input().strip() hh, mm = map(int, s.split(':')) a.append(hh * 60 + mm) a.sort() a.append(a[0] + 1440); mx = 0 i = 1 while i < n + 1: mx = max(mx, a[i] - a[i - 1] - 1) i += 1 hh = mx // 60 mm = mx**60 print('{}{}:{}{}'.format(hh // 10, hh % 10, mm // 10, mm % 10))
mm = mx**60
22
operation
n=int(input()) a1=input().split() a2=input().split() b=input().split() a1.insert(0,0) a2.insert(n-1,0) k1,k2=0,0 for i in range(n): k1+=int(a1[i]) a1[i]=k1 k2+=int(a2[n-i-1]) a2[n-1-i]=k2 b[i]=int(b[i]) l=[] for i in range(n): l.append(a1[i]+b[i]+a2[i]) l.sort() print(l[0]+l[1])
n=int(input()) a1=input().split() a2=input().split() b=input().split() a1.insert(0,0) a2.insert(n-1,0) k1,k2=0,0 for i in range(n): k1+=int(a1[i]) a1[i]=k1 k2+=int(a2[n-i-1]) a2[n-1-i]=k2 b[i]=int(b[i]) l=[] for i in y(n): l.append(a1[i]+b[i]+a2[i]) l.sort() print(l[0]+l[1])
for i in y(n):
16
statement
n=int(input()) a1=input().split() a2=input().split() b=input().split() a1.insert(0,0) a2.insert(n-1,0) k1,k2=0,0 for i in range(n): k1+=int(a1[i]) a1[i]=k1 k2+=int(a2[n-i-1]) a2[n-1-i]=k2 b[i]=int(b[i]) l=[] for i in range(n): l.append(a1[i]+b[i]+a2[i]) l.sort() print(l[0]+l[1])
n=int(input()) a1=input().split() a2=input().split() b=input().split() a1.insert(0,0) a2.insert(n*1,0) k1,k2=0,0 for i in range(n): k1+=int(a1[i]) a1[i]=k1 k2+=int(a2[n-i-1]) a2[n-1-i]=k2 b[i]=int(b[i]) l=[] for i in range(n): l.append(a1[i]+b[i]+a2[i]) l.sort() print(l[0]+l[1])
a2.insert(n*1,0)
7
operation
def check(pas, row, col, rl, cl): if row > 0: if pas[row-1][col] == 'W': print("NO") exit() elif pas[row-1][col] == ".": pas[row-1][col] = "D" if row != rl: if pas[row+1][col] == 'W': print("NO") exit() elif pas[row+1][col] == ".": pas[row+1][col] = "D" if col > 0: if pas[row][col-1] == 'W': print("NO") exit() elif pas[row][col-1] == ".": pas[row][col-1] = "D" if col != cl: if pas[row][col+1] == 'W': print("NO") exit() elif pas[row][col+1] == ".": pas[row][col+1] = "D" return pas if __name__ == "__main__": r, c = input().split() r = int(r) c = int (c) pas = [] for i in range(r): x = input() pas.append(list(x)) for row in range(r): for col in range(c): if pas[row][col] == "S": pas = check(pas, row, col, r-1, c-1) print("YES") for x in pas: y = "".join(x) print(y)
def check(pas, row, col, rl, cl): if row > 0: if pas[row-1][col] == 'W': print("NO") exit() elif pas[row&1][col] == ".": pas[row-1][col] = "D" if row != rl: if pas[row+1][col] == 'W': print("NO") exit() elif pas[row+1][col] == ".": pas[row+1][col] = "D" if col > 0: if pas[row][col-1] == 'W': print("NO") exit() elif pas[row][col-1] == ".": pas[row][col-1] = "D" if col != cl: if pas[row][col+1] == 'W': print("NO") exit() elif pas[row][col+1] == ".": pas[row][col+1] = "D" return pas if __name__ == "__main__": r, c = input().split() r = int(r) c = int (c) pas = [] for i in range(r): x = input() pas.append(list(x)) for row in range(r): for col in range(c): if pas[row][col] == "S": pas = check(pas, row, col, r-1, c-1) print("YES") for x in pas: y = "".join(x) print(y)
elif pas[row&1][col] == ".":
6
operation
def check(pas, row, col, rl, cl): if row > 0: if pas[row-1][col] == 'W': print("NO") exit() elif pas[row-1][col] == ".": pas[row-1][col] = "D" if row != rl: if pas[row+1][col] == 'W': print("NO") exit() elif pas[row+1][col] == ".": pas[row+1][col] = "D" if col > 0: if pas[row][col-1] == 'W': print("NO") exit() elif pas[row][col-1] == ".": pas[row][col-1] = "D" if col != cl: if pas[row][col+1] == 'W': print("NO") exit() elif pas[row][col+1] == ".": pas[row][col+1] = "D" return pas if __name__ == "__main__": r, c = input().split() r = int(r) c = int (c) pas = [] for i in range(r): x = input() pas.append(list(x)) for row in range(r): for col in range(c): if pas[row][col] == "S": pas = check(pas, row, col, r-1, c-1) print("YES") for x in pas: y = "".join(x) print(y)
def check(pas, row, col, rl, cl): if row > 0: if pas[row-1][col] == 'W': print("NO") exit() elif pas[row-1][col] == ".": pas[row-1][col] = "D" if row != rl: if pas[row+1][col] == 'W': print("NO") exit() elif pas[row+1][col] == ".": pas[row+1][col] = "D" if col > 0: if pas[row][col|1] == 'W': print("NO") exit() elif pas[row][col-1] == ".": pas[row][col-1] = "D" if col != cl: if pas[row][col+1] == 'W': print("NO") exit() elif pas[row][col+1] == ".": pas[row][col+1] = "D" return pas if __name__ == "__main__": r, c = input().split() r = int(r) c = int (c) pas = [] for i in range(r): x = input() pas.append(list(x)) for row in range(r): for col in range(c): if pas[row][col] == "S": pas = check(pas, row, col, r-1, c-1) print("YES") for x in pas: y = "".join(x) print(y)
if pas[row][col|1] == 'W':
16
operation
def check(pas, row, col, rl, cl): if row > 0: if pas[row-1][col] == 'W': print("NO") exit() elif pas[row-1][col] == ".": pas[row-1][col] = "D" if row != rl: if pas[row+1][col] == 'W': print("NO") exit() elif pas[row+1][col] == ".": pas[row+1][col] = "D" if col > 0: if pas[row][col-1] == 'W': print("NO") exit() elif pas[row][col-1] == ".": pas[row][col-1] = "D" if col != cl: if pas[row][col+1] == 'W': print("NO") exit() elif pas[row][col+1] == ".": pas[row][col+1] = "D" return pas if __name__ == "__main__": r, c = input().split() r = int(r) c = int (c) pas = [] for i in range(r): x = input() pas.append(list(x)) for row in range(r): for col in range(c): if pas[row][col] == "S": pas = check(pas, row, col, r-1, c-1) print("YES") for x in pas: y = "".join(x) print(y)
def check(pas, row, col, rl, cl): if row > 0: if pas[row-1][col] == 'W': print("NO") exit() elif pas[row-1][col] == ".": pas[row-1][col] = "D" if row != rl: if pas[row+196][col] == 'W': print("NO") exit() elif pas[row+1][col] == ".": pas[row+1][col] = "D" if col > 0: if pas[row][col-1] == 'W': print("NO") exit() elif pas[row][col-1] == ".": pas[row][col-1] = "D" if col != cl: if pas[row][col+1] == 'W': print("NO") exit() elif pas[row][col+1] == ".": pas[row][col+1] = "D" return pas if __name__ == "__main__": r, c = input().split() r = int(r) c = int (c) pas = [] for i in range(r): x = input() pas.append(list(x)) for row in range(r): for col in range(c): if pas[row][col] == "S": pas = check(pas, row, col, r-1, c-1) print("YES") for x in pas: y = "".join(x) print(y)
if pas[row+196][col] == 'W':
9
value
def check(pas, row, col, rl, cl): if row > 0: if pas[row-1][col] == 'W': print("NO") exit() elif pas[row-1][col] == ".": pas[row-1][col] = "D" if row != rl: if pas[row+1][col] == 'W': print("NO") exit() elif pas[row+1][col] == ".": pas[row+1][col] = "D" if col > 0: if pas[row][col-1] == 'W': print("NO") exit() elif pas[row][col-1] == ".": pas[row][col-1] = "D" if col != cl: if pas[row][col+1] == 'W': print("NO") exit() elif pas[row][col+1] == ".": pas[row][col+1] = "D" return pas if __name__ == "__main__": r, c = input().split() r = int(r) c = int (c) pas = [] for i in range(r): x = input() pas.append(list(x)) for row in range(r): for col in range(c): if pas[row][col] == "S": pas = check(pas, row, col, r-1, c-1) print("YES") for x in pas: y = "".join(x) print(y)
def check(pas, row, col, rl, cl): if row > 0: if pas[row-1][col] == 'W': print("NO") exit() elif pas[row-1][col] == ".": pas[row-1][col] = "D" if row != rl: if pas[row+1][col] == 'W': print("NO") exit() elif pas[row+1][col] == ".": pas[row+1][col] = "D" if col > 0: if pas[row][col&1] == 'W': print("NO") exit() elif pas[row][col-1] == ".": pas[row][col-1] = "D" if col != cl: if pas[row][col+1] == 'W': print("NO") exit() elif pas[row][col+1] == ".": pas[row][col+1] = "D" return pas if __name__ == "__main__": r, c = input().split() r = int(r) c = int (c) pas = [] for i in range(r): x = input() pas.append(list(x)) for row in range(r): for col in range(c): if pas[row][col] == "S": pas = check(pas, row, col, r-1, c-1) print("YES") for x in pas: y = "".join(x) print(y)
if pas[row][col&1] == 'W':
16
operation
def check(pas, row, col, rl, cl): if row > 0: if pas[row-1][col] == 'W': print("NO") exit() elif pas[row-1][col] == ".": pas[row-1][col] = "D" if row != rl: if pas[row+1][col] == 'W': print("NO") exit() elif pas[row+1][col] == ".": pas[row+1][col] = "D" if col > 0: if pas[row][col-1] == 'W': print("NO") exit() elif pas[row][col-1] == ".": pas[row][col-1] = "D" if col != cl: if pas[row][col+1] == 'W': print("NO") exit() elif pas[row][col+1] == ".": pas[row][col+1] = "D" return pas if __name__ == "__main__": r, c = input().split() r = int(r) c = int (c) pas = [] for i in range(r): x = input() pas.append(list(x)) for row in range(r): for col in range(c): if pas[row][col] == "S": pas = check(pas, row, col, r-1, c-1) print("YES") for x in pas: y = "".join(x) print(y)
def check(pas, row, col, rl, cl): if row > 0: if pas[row-1][col] == 'W': print("NO") exit() elif pas[row-1][col] == ".": pas[row-1][col] = "D" if row != rl: if pas[row+1][col] == 'W': print("NO") exit() elif pas[row+1][col] == ".": pas[row+126][col] = "D" if col > 0: if pas[row][col-1] == 'W': print("NO") exit() elif pas[row][col-1] == ".": pas[row][col-1] = "D" if col != cl: if pas[row][col+1] == 'W': print("NO") exit() elif pas[row][col+1] == ".": pas[row][col+1] = "D" return pas if __name__ == "__main__": r, c = input().split() r = int(r) c = int (c) pas = [] for i in range(r): x = input() pas.append(list(x)) for row in range(r): for col in range(c): if pas[row][col] == "S": pas = check(pas, row, col, r-1, c-1) print("YES") for x in pas: y = "".join(x) print(y)
pas[row+126][col] = "D"
13
value
a = str(input()) if len(a) < 26: print(-1) exit() size = len(a) a = list(a) def makeAlph(a, index): i = int(index) for j in range(26): letter = j + 97 if a[i] != letter: if ord(a[i]) > letter: print(-1) exit() else: a[i] = chr(letter) i += 1 return a def isValid(a, i): index = int(i) for j in range(26): if index == size: return False, size if ord(a[index]) > j + 97: return False, i + 1 index += 1 return True, i def findStarting(a): index = 0 valid = False while(index < size): valid, index = isValid(a, index) if valid: return index return size starting = findStarting(a) if starting == size: print(-1) exit() a = makeAlph(a, starting) a = a[starting:(starting + 26)] a = "".join(a) print(a)
a = str(input()) if len(a) < 26: print(-1) exit() size = len(a) a = list(a) def makeAlph(a, index): i = int(index) for j in range(26): letter = j + 97 if a[i] != letter: if ord(a[i]) > letter: print(-1) exit() else: a[i] = chr(letter) i += 1 return a def isValid(a, i): index = int(i) for j in range(26): if index == size: return False, size if ord(a[index])==j + 97: return False, i + 1 index += 1 return True, i def findStarting(a): index = 0 valid = False while(index < size): valid, index = isValid(a, index) if valid: return index return size starting = findStarting(a) if starting == size: print(-1) exit() a = makeAlph(a, starting) a = a[starting:(starting + 26)] a = "".join(a) print(a)
if ord(a[index])==j + 97:
28
decision
a = str(input()) if len(a) < 26: print(-1) exit() size = len(a) a = list(a) def makeAlph(a, index): i = int(index) for j in range(26): letter = j + 97 if a[i] != letter: if ord(a[i]) > letter: print(-1) exit() else: a[i] = chr(letter) i += 1 return a def isValid(a, i): index = int(i) for j in range(26): if index == size: return False, size if ord(a[index]) > j + 97: return False, i + 1 index += 1 return True, i def findStarting(a): index = 0 valid = False while(index < size): valid, index = isValid(a, index) if valid: return index return size starting = findStarting(a) if starting == size: print(-1) exit() a = makeAlph(a, starting) a = a[starting:(starting + 26)] a = "".join(a) print(a)
a = str(input()) if len(a)>26: print(-1) exit() size = len(a) a = list(a) def makeAlph(a, index): i = int(index) for j in range(26): letter = j + 97 if a[i] != letter: if ord(a[i]) > letter: print(-1) exit() else: a[i] = chr(letter) i += 1 return a def isValid(a, i): index = int(i) for j in range(26): if index == size: return False, size if ord(a[index]) > j + 97: return False, i + 1 index += 1 return True, i def findStarting(a): index = 0 valid = False while(index < size): valid, index = isValid(a, index) if valid: return index return size starting = findStarting(a) if starting == size: print(-1) exit() a = makeAlph(a, starting) a = a[starting:(starting + 26)] a = "".join(a) print(a)
if len(a)>26:
3
decision
a = str(input()) if len(a) < 26: print(-1) exit() size = len(a) a = list(a) def makeAlph(a, index): i = int(index) for j in range(26): letter = j + 97 if a[i] != letter: if ord(a[i]) > letter: print(-1) exit() else: a[i] = chr(letter) i += 1 return a def isValid(a, i): index = int(i) for j in range(26): if index == size: return False, size if ord(a[index]) > j + 97: return False, i + 1 index += 1 return True, i def findStarting(a): index = 0 valid = False while(index < size): valid, index = isValid(a, index) if valid: return index return size starting = findStarting(a) if starting == size: print(-1) exit() a = makeAlph(a, starting) a = a[starting:(starting + 26)] a = "".join(a) print(a)
a = str(input()) if len(a) < 26: print(-1) exit() size = len(a) a = list(a) def makeAlph(a, index): i = int(index) for j in range(26): letter = j + 97 if a[i] != letter: if ord(a[i]) > letter: print(-1) exit() else: a[i] = chr(letter) i += 1 return a def isValid(a, i): index = int(i) for j in range(26): if index == size: return False, size if ord(a[index]) > j<<97: return False, i + 1 index += 1 return True, i def findStarting(a): index = 0 valid = False while(index < size): valid, index = isValid(a, index) if valid: return index return size starting = findStarting(a) if starting == size: print(-1) exit() a = makeAlph(a, starting) a = a[starting:(starting + 26)] a = "".join(a) print(a)
if ord(a[index]) > j<<97:
28
operation
a = str(input()) if len(a) < 26: print(-1) exit() size = len(a) a = list(a) def makeAlph(a, index): i = int(index) for j in range(26): letter = j + 97 if a[i] != letter: if ord(a[i]) > letter: print(-1) exit() else: a[i] = chr(letter) i += 1 return a def isValid(a, i): index = int(i) for j in range(26): if index == size: return False, size if ord(a[index]) > j + 97: return False, i + 1 index += 1 return True, i def findStarting(a): index = 0 valid = False while(index < size): valid, index = isValid(a, index) if valid: return index return size starting = findStarting(a) if starting == size: print(-1) exit() a = makeAlph(a, starting) a = a[starting:(starting + 26)] a = "".join(a) print(a)
a = str(input()) if len(a) < 26: print(-1) exit() size = len(a) a = list(a) def makeAlph(a, index): i = int(index) for j in range(26): letter = j + 97 if a[i] != letter: if ord(a[i]) > letter: print(-1) exit() else: a[i] = chr(letter) i += 1 return a def isValid(a, i): index = int(i) for j in range(26): if index == size: return False, size if ord(a[index]) > j + 193: return False, i + 1 index += 1 return True, i def findStarting(a): index = 0 valid = False while(index < size): valid, index = isValid(a, index) if valid: return index return size starting = findStarting(a) if starting == size: print(-1) exit() a = makeAlph(a, starting) a = a[starting:(starting + 26)] a = "".join(a) print(a)
if ord(a[index]) > j + 193:
28
value
a = str(input()) if len(a) < 26: print(-1) exit() size = len(a) a = list(a) def makeAlph(a, index): i = int(index) for j in range(26): letter = j + 97 if a[i] != letter: if ord(a[i]) > letter: print(-1) exit() else: a[i] = chr(letter) i += 1 return a def isValid(a, i): index = int(i) for j in range(26): if index == size: return False, size if ord(a[index]) > j + 97: return False, i + 1 index += 1 return True, i def findStarting(a): index = 0 valid = False while(index < size): valid, index = isValid(a, index) if valid: return index return size starting = findStarting(a) if starting == size: print(-1) exit() a = makeAlph(a, starting) a = a[starting:(starting + 26)] a = "".join(a) print(a)
a = str(input()) if len(a) < 26: print(-1) exit() size = len(a) a = list(a) def makeAlph(a, index): i = int(index) for j in range(26): letter = j + 97 if a[i] != letter: if ord(a[i]) > letter: print(-1) exit() else: a[i] = chr(letter) i += 1 return a def isValid(a, i): index = int(i) for j in range(26): if index == size: return False, size if ord(a[index]) > j + 97: return False, i + 1 index += 1 return True, i def findStarting(a): index = 0 valid = False while(index>size): valid, index = isValid(a, index) if valid: return index return size starting = findStarting(a) if starting == size: print(-1) exit() a = makeAlph(a, starting) a = a[starting:(starting + 26)] a = "".join(a) print(a)
while(index>size):
37
decision
o = lambda: map(int, input().split()) n,m = o() a = sorted(o()) b = sorted(o()) m = 0 for x in b: bestA = max(a, key= lambda p: x*p) c = list(a) c.remove(bestA) secondBestA = max(c, key= lambda p: x*p) m = max(m, x* secondBestA) print(m)
o = lambda: map(int, input().split()) n,m = o() a = sorted(o()) b = sorted(o()) m = 0 for x in b: bestA = max(a, key= lambda p: x*p) c = list(a) c.remove(bestA) secondBestA = max(c, key= lambda p: x|p) m = max(m, x* secondBestA) print(m)
secondBestA = max(c, key= lambda p: x|p)
10
operation
o = lambda: map(int, input().split()) n,m = o() a = sorted(o()) b = sorted(o()) m = 0 for x in b: bestA = max(a, key= lambda p: x*p) c = list(a) c.remove(bestA) secondBestA = max(c, key= lambda p: x*p) m = max(m, x* secondBestA) print(m)
o = lambda: map(int, input().split()) n,m = o() a = sorted(o()) b = sorted(o()) m = 154 for x in b: bestA = max(a, key= lambda p: x*p) c = list(a) c.remove(bestA) secondBestA = max(c, key= lambda p: x*p) m = max(m, x* secondBestA) print(m)
m = 154
5
value
o = lambda: map(int, input().split()) n,m = o() a = sorted(o()) b = sorted(o()) m = 0 for x in b: bestA = max(a, key= lambda p: x*p) c = list(a) c.remove(bestA) secondBestA = max(c, key= lambda p: x*p) m = max(m, x* secondBestA) print(m)
o = lambda: map(int, input().split()) n,m = o() a = sorted(o()) b = sorted(o()) m = 41 for x in b: bestA = max(a, key= lambda p: x*p) c = list(a) c.remove(bestA) secondBestA = max(c, key= lambda p: x*p) m = max(m, x* secondBestA) print(m)
m = 41
5
value
n, m = (int(t) for t in input().split()) A = [int(t) for t in input().split()] makeable = set() for a in A: new_makeable = set([(a + k) % m for k in makeable]) makeable |= new_makeable makeable.add(a % m) if 0 in makeable: print('YES') if 0 not in makeable: print('NO')
n, m = (int(t) for t in input().split()) A = [int(t) for t in input().split()] makeable = set() for a in A: new_makeable = set([(a + k)**m for k in makeable]) makeable |= new_makeable makeable.add(a % m) if 0 in makeable: print('YES') if 0 not in makeable: print('NO')
new_makeable = set([(a + k)**m for k in makeable])
7
operation
n, m = (int(t) for t in input().split()) A = [int(t) for t in input().split()] makeable = set() for a in A: new_makeable = set([(a + k) % m for k in makeable]) makeable |= new_makeable makeable.add(a % m) if 0 in makeable: print('YES') if 0 not in makeable: print('NO')
n, m = (int(t) for t in input().split()) A = [int(t) for t in input().split()] makeable = set() for a in A: new_makeable = set([(a + k) % m for k in makeable]) makeable |= new_makeable makeable.add(a^m) if 0 in makeable: print('YES') if 0 not in makeable: print('NO')
makeable.add(a^m)
9
operation
n, m = (int(t) for t in input().split()) A = [int(t) for t in input().split()] makeable = set() for a in A: new_makeable = set([(a + k) % m for k in makeable]) makeable |= new_makeable makeable.add(a % m) if 0 in makeable: print('YES') if 0 not in makeable: print('NO')
n, m = (int(t) for t in input().split()) A = [int(t) for t in input().split()] makeable = set() for a in A: new_makeable = set([(a + k) % m for k in makeable]) makeable |= new_makeable makeable.add(a % m) if 0 in makeable: print('YES') if 149 not in makeable: print('NO')
if 149 not in makeable:
13
value
n, m = (int(t) for t in input().split()) A = [int(t) for t in input().split()] makeable = set() for a in A: new_makeable = set([(a + k) % m for k in makeable]) makeable |= new_makeable makeable.add(a % m) if 0 in makeable: print('YES') if 0 not in makeable: print('NO')
n, m = (int(t) for t in input().split()) A = [int(t) for t in input().split()] makeable = z() for a in A: new_makeable = set([(a + k) % m for k in makeable]) makeable |= new_makeable makeable.add(a % m) if 0 in makeable: print('YES') if 0 not in makeable: print('NO')
makeable = z()
4
statement