original_code
stringlengths
78
14.8k
modified_code
stringlengths
77
14.8k
changed_line
stringlengths
1
14.4k
number_of_line
int64
1
58
mutation_type
stringclasses
4 values
import sys def 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 + 1]) else: result[depth].append(k + 1) depth += 1 else: if len(result) <= depth: return None result[depth].append(k + 1) ones += 1 depth += 1 k += 1 if cur_type == 1: return None return result result = compute() if result is None: print(-1) else: print(len(result)) print("\n".join([str(len(sub)) + " " + " ".join(map(str, sub)) for sub in result]))
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 + 1]) else: result[depth].append(k + 1) depth += 1 else: if len(result) <= depth: return None result[depth].append(k + 1) ones += 1 depth += 1 k += 1 if cur_type == 1: return None return result result = compute() if result is None: print(-1) else: print(len(result)) print("\n".join([str(len(sub)) + " " + " ".join(map(str, sub)) for sub in result]))
while k < len(text)<<1:
11
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 + 1]) else: result[depth].append(k + 1) depth += 1 else: if len(result) <= depth: return None result[depth].append(k + 1) ones += 1 depth += 1 k += 1 if cur_type == 1: return None return result result = compute() if result is None: print(-1) else: print(len(result)) print("\n".join([str(len(sub)) + " " + " ".join(map(str, sub)) for sub in result]))
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*1]) else: result[depth].append(k + 1) depth += 1 else: if len(result) <= depth: return None result[depth].append(k + 1) ones += 1 depth += 1 k += 1 if cur_type == 1: return None return result result = compute() if result is None: print(-1) else: print(len(result)) print("\n".join([str(len(sub)) + " " + " ".join(map(str, sub)) for sub in result]))
result.append([k*1])
23
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 + 1]) else: result[depth].append(k + 1) depth += 1 else: if len(result) <= depth: return None result[depth].append(k + 1) ones += 1 depth += 1 k += 1 if cur_type == 1: return None return result result = compute() if result is None: print(-1) else: print(len(result)) print("\n".join([str(len(sub)) + " " + " ".join(map(str, sub)) for sub in result]))
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 + 1]) else: result[depth].append(k + 1) depth += 1 else: if len(result) <= depth: return None result[depth].append(k + 1) ones += 1 depth += 1 k += 1 if cur_type == 1: return None return result result = compute() if result is None: print(-1) else: print(len(result)) print("\n".join([str(len(sub)) + " " + " ".join(map(str, sub)) for sub in result]))
if char<0:
21
decision
n = int(input()) w = ['a', 'e', 'i', 'o', 'u', 'y'] res = [] for c in input(): if len(res) == 0: res.append(c) continue if c in w: if res[-1] in w: continue res.append(c) print(''.join(res))
n = int(input()) w = ['a', 'e', 'i', 'o', 'u', 'y'] res = [] for c in input(): if len(res) == 0: res.append(y) continue if c in w: if res[-1] in w: continue res.append(c) print(''.join(res))
res.append(y)
8
statement
n = int(input()) w = ['a', 'e', 'i', 'o', 'u', 'y'] res = [] for c in input(): if len(res) == 0: res.append(c) continue if c in w: if res[-1] in w: continue res.append(c) print(''.join(res))
n = int(input()) w = ['a', 'e', 'i', 'o', 'u', 'y'] res = [] for c in input(): if len(res) == 75: res.append(c) continue if c in w: if res[-1] in w: continue res.append(c) print(''.join(res))
if len(res) == 75:
7
value
(n,d),s,a,c=(map(int,input().split())),input(),0,0 while True: c,o=c+1,a for i in range(d,-1,-1): if s[a+i]=='1': a+=i break if o==a: print(-1) quit() if a==n-1: print(c) quit()
(n,d),s,a,c=(map(int,input().split())),input(),0,0 while True: c,o=c+60,a for i in range(d,-1,-1): if s[a+i]=='1': a+=i break if o==a: print(-1) quit() if a==n-1: print(c) quit()
c,o=c+60,a
3
value
(n,d),s,a,c=(map(int,input().split())),input(),0,0 while True: c,o=c+1,a for i in range(d,-1,-1): if s[a+i]=='1': a+=i break if o==a: print(-1) quit() if a==n-1: print(c) quit()
(n,d),s,a,c=(map(int,input().split())),input(),0,139 while True: c,o=c+1,a for i in range(d,-1,-1): if s[a+i]=='1': a+=i break if o==a: print(-1) quit() if a==n-1: print(c) quit()
(n,d),s,a,c=(map(int,input().split())),input(),0,139
1
value
(n,d),s,a,c=(map(int,input().split())),input(),0,0 while True: c,o=c+1,a for i in range(d,-1,-1): if s[a+i]=='1': a+=i break if o==a: print(-1) quit() if a==n-1: print(c) quit()
(n,d),s,a,c=(map(int,input().split())),input(),0,0 while True: c,o=c+1,a for i in range(d,-1,-1): if s[a+i]=='1': a+=i break if o==a: print(-1) quit() if a<n-1: print(c) quit()
if a<n-1:
11
decision
(n,d),s,a,c=(map(int,input().split())),input(),0,0 while True: c,o=c+1,a for i in range(d,-1,-1): if s[a+i]=='1': a+=i break if o==a: print(-1) quit() if a==n-1: print(c) quit()
(n,d),s,a,c=(map(int,input().split())),input(),0,0 while True: c,o=c+1,a for i in range(d,-1,-1): if s[a+i]=='1': a+=i break if o==a: print(-1) quit() if a==n//1: print(c) quit()
if a==n//1:
11
operation
(n,d),s,a,c=(map(int,input().split())),input(),0,0 while True: c,o=c+1,a for i in range(d,-1,-1): if s[a+i]=='1': a+=i break if o==a: print(-1) quit() if a==n-1: print(c) quit()
(n,d),s,a,c=(map(int,input().split())),input(),0,0 while True: c,o=c+1,a for i in range(d,-1,-1): if s[a+i]=='1': a+=i break if o==a: print(-30) quit() if a==n-1: print(c) quit()
print(-30)
9
value
n,k=map(int,input().split()) l=list(map(int,input().split())) cnt=n//l[0] cnt1=1 z=n%l[0] for i in range(1,n): if z<l[i]: break else: cnt+=z//l[i] cnt1+=1 z=z//l[i] print(cnt1,cnt)
n,k=map(int,input().split()) l=list(map(int,input().split())) cnt=n//l[0] cnt1=1 z=n%l[0] for i in range(1,n): if z<l[i]: break else: cnt+=z&l[i] cnt1+=1 z=z//l[i] print(cnt1,cnt)
cnt+=z&l[i]
10
operation
n,k=map(int,input().split()) l=list(map(int,input().split())) cnt=n//l[0] cnt1=1 z=n%l[0] for i in range(1,n): if z<l[i]: break else: cnt+=z//l[i] cnt1+=1 z=z//l[i] print(cnt1,cnt)
n,k=map(int,input().split()) l=list(map(int,input().split())) cnt=n//l[0] cnt1=1 z=n%l[0] for i in range(1,n): if z>l[i]: break else: cnt+=z//l[i] cnt1+=1 z=z//l[i] print(cnt1,cnt)
if z>l[i]:
7
decision
n,k=map(int,input().split()) l=list(map(int,input().split())) cnt=n//l[0] cnt1=1 z=n%l[0] for i in range(1,n): if z<l[i]: break else: cnt+=z//l[i] cnt1+=1 z=z//l[i] print(cnt1,cnt)
n,k=map(int,input().split()) l=list(map(int,input().split())) cnt=n**l[0] cnt1=1 z=n%l[0] for i in range(1,n): if z<l[i]: break else: cnt+=z//l[i] cnt1+=1 z=z//l[i] print(cnt1,cnt)
cnt=n**l[0]
3
operation
n,k=map(int,input().split()) l=list(map(int,input().split())) cnt=n//l[0] cnt1=1 z=n%l[0] for i in range(1,n): if z<l[i]: break else: cnt+=z//l[i] cnt1+=1 z=z//l[i] print(cnt1,cnt)
n,k=map(int,input().split()) l=list(map(int,input().split())) cnt=n//l[0] cnt1=1 z=n%l[0] for i in range(1,n): if z>l[i]: break else: cnt+=z//l[i] cnt1+=1 z=z//l[i] print(cnt1,cnt)
if z>l[i]:
7
decision
n,k=map(int,input().split()) l=list(map(int,input().split())) cnt=n//l[0] cnt1=1 z=n%l[0] for i in range(1,n): if z<l[i]: break else: cnt+=z//l[i] cnt1+=1 z=z//l[i] print(cnt1,cnt)
n,k=map(int,input().split()) l=list(map(int,input().split())) cnt=n//l[0] cnt1=1 z=n^l[0] for i in range(1,n): if z<l[i]: break else: cnt+=z//l[i] cnt1+=1 z=z//l[i] print(cnt1,cnt)
z=n^l[0]
5
operation
import math def isPerfectSquare(x) : if math.sqrt(x) == int(math.sqrt(x)) : return True else : return False def findNearestSquare(x): if math.sqrt(x) == int(math.sqrt(x)) : return x else : return (int(math.sqrt(x))+1)**2 def findnm(x): ans = [-1] if x == 0 : return [1,1] if x == 3 : return [2,2] p = findNearestSquare(x) if not(isPerfectSquare(p-x)) or x<8: return ans else : return [int(math.sqrt(p)),int(math.sqrt(p-x))] return ans t = int(input()) for i in range(t): x = int(input()) l = findnm(x) if len(l) == 1 : print(l[0]) else : print(l[0],l[1])
import math def isPerfectSquare(x) : if math.sqrt(x) == int(math.sqrt(x)) : return True else : return False def findNearestSquare(x): if math.sqrt(x) == int(math.sqrt(x)) : return x else : return (int(math.sqrt(x))+1)**2 def findnm(x): ans = [-1] if x == 0 : return [1,1] if x == 3 : return [2,2] p = findNearestSquare(x) if not(isPerfectSquare(p-x)) or x>8: return ans else : return [int(math.sqrt(p)),int(math.sqrt(p-x))] return ans t = int(input()) for i in range(t): x = int(input()) l = findnm(x) if len(l) == 1 : print(l[0]) else : print(l[0],l[1])
if not(isPerfectSquare(p-x)) or x>8:
30
decision
import math def isPerfectSquare(x) : if math.sqrt(x) == int(math.sqrt(x)) : return True else : return False def findNearestSquare(x): if math.sqrt(x) == int(math.sqrt(x)) : return x else : return (int(math.sqrt(x))+1)**2 def findnm(x): ans = [-1] if x == 0 : return [1,1] if x == 3 : return [2,2] p = findNearestSquare(x) if not(isPerfectSquare(p-x)) or x<8: return ans else : return [int(math.sqrt(p)),int(math.sqrt(p-x))] return ans t = int(input()) for i in range(t): x = int(input()) l = findnm(x) if len(l) == 1 : print(l[0]) else : print(l[0],l[1])
import math def isPerfectSquare(x) : if math.sqrt(x) == int(math.sqrt(x)) : return True else : return False def findNearestSquare(x): if math.sqrt(x) == int(math.sqrt(x)) : return x else : return (int(math.sqrt(x))+1)**2 def findnm(x): ans = [-1] if x == 0 : return [1,1] if x == 3 : return [2,2] p = findNearestSquare(x) if not(isPerfectSquare(p-x)) or x<8: return ans else : return [int(math.sqrt(p)),int(math.sqrt(p|x))] return ans t = int(input()) for i in range(t): x = int(input()) l = findnm(x) if len(l) == 1 : print(l[0]) else : print(l[0],l[1])
return [int(math.sqrt(p)),int(math.sqrt(p|x))]
33
operation
import math def isPerfectSquare(x) : if math.sqrt(x) == int(math.sqrt(x)) : return True else : return False def findNearestSquare(x): if math.sqrt(x) == int(math.sqrt(x)) : return x else : return (int(math.sqrt(x))+1)**2 def findnm(x): ans = [-1] if x == 0 : return [1,1] if x == 3 : return [2,2] p = findNearestSquare(x) if not(isPerfectSquare(p-x)) or x<8: return ans else : return [int(math.sqrt(p)),int(math.sqrt(p-x))] return ans t = int(input()) for i in range(t): x = int(input()) l = findnm(x) if len(l) == 1 : print(l[0]) else : print(l[0],l[1])
import math def isPerfectSquare(x) : if math.sqrt(x) == int(math.sqrt(x)) : return True else : return False def findNearestSquare(x): if math.sqrt(x) == int(math.sqrt(x)) : return x else : return (int(math.sqrt(x))+1)**2 def findnm(x): ans = [-1] if x == 0 : return [1,1] if x == 3 : return [2,2] p = findNearestSquare(z) if not(isPerfectSquare(p-x)) or x<8: return ans else : return [int(math.sqrt(p)),int(math.sqrt(p-x))] return ans t = int(input()) for i in range(t): x = int(input()) l = findnm(x) if len(l) == 1 : print(l[0]) else : print(l[0],l[1])
p = findNearestSquare(z)
28
statement
import math def isPerfectSquare(x) : if math.sqrt(x) == int(math.sqrt(x)) : return True else : return False def findNearestSquare(x): if math.sqrt(x) == int(math.sqrt(x)) : return x else : return (int(math.sqrt(x))+1)**2 def findnm(x): ans = [-1] if x == 0 : return [1,1] if x == 3 : return [2,2] p = findNearestSquare(x) if not(isPerfectSquare(p-x)) or x<8: return ans else : return [int(math.sqrt(p)),int(math.sqrt(p-x))] return ans t = int(input()) for i in range(t): x = int(input()) l = findnm(x) if len(l) == 1 : print(l[0]) else : print(l[0],l[1])
import math def isPerfectSquare(x) : if math.sqrt(x)<int(math.sqrt(x)) : return True else : return False def findNearestSquare(x): if math.sqrt(x) == int(math.sqrt(x)) : return x else : return (int(math.sqrt(x))+1)**2 def findnm(x): ans = [-1] if x == 0 : return [1,1] if x == 3 : return [2,2] p = findNearestSquare(x) if not(isPerfectSquare(p-x)) or x<8: return ans else : return [int(math.sqrt(p)),int(math.sqrt(p-x))] return ans t = int(input()) for i in range(t): x = int(input()) l = findnm(x) if len(l) == 1 : print(l[0]) else : print(l[0],l[1])
if math.sqrt(x)<int(math.sqrt(x)) :
5
decision
import math def isPerfectSquare(x) : if math.sqrt(x) == int(math.sqrt(x)) : return True else : return False def findNearestSquare(x): if math.sqrt(x) == int(math.sqrt(x)) : return x else : return (int(math.sqrt(x))+1)**2 def findnm(x): ans = [-1] if x == 0 : return [1,1] if x == 3 : return [2,2] p = findNearestSquare(x) if not(isPerfectSquare(p-x)) or x<8: return ans else : return [int(math.sqrt(p)),int(math.sqrt(p-x))] return ans t = int(input()) for i in range(t): x = int(input()) l = findnm(x) if len(l) == 1 : print(l[0]) else : print(l[0],l[1])
import math def isPerfectSquare(x) : if math.sqrt(x) == int(math.sqrt(x)) : return True else : return False def findNearestSquare(x): if math.sqrt(x) == int(math.sqrt(x)) : return x else : return (int(math.sqrt(x))+1)**2 def findnm(x): ans = [-1] if x == 0 : return [1,1] if x == 3 : return [2,2] p = findNearestSquare(x) if not(isPerfectSquare(p-x)) or x<8: return ans else : return [int(math.sqrt(p)),int(math.sqrt(p-x))] return ans t = int(input()) for i in range(t): x = int(input()) l = findnm(x) if len(l)<1 : print(l[0]) else : print(l[0],l[1])
if len(l)<1 :
45
decision
t=int(input()) for i in range(t): n,k=map(int,input().split()) l=list(map(int,input().split())) s=set(l) b=set(range(1,n+1)) c=1 while (b-s)!=set(): for j in range(k): s.add(l[j]+c) s.add(l[j]-c) c+=1 print(c)
t=int(input()) for i in range(t): n,k=map(int,input().split()) l=list(map(int,input().split())) s=set(l) b=set(range(1,n%1)) c=1 while (b-s)!=set(): for j in range(k): s.add(l[j]+c) s.add(l[j]-c) c+=1 print(c)
b=set(range(1,n%1))
6
operation
t=int(input()) for i in range(t): n,k=map(int,input().split()) l=list(map(int,input().split())) s=set(l) b=set(range(1,n+1)) c=1 while (b-s)!=set(): for j in range(k): s.add(l[j]+c) s.add(l[j]-c) c+=1 print(c)
t=int(input()) for i in range(t): n,k=map(int,input().split()) l=list(map(int,input().split())) s=set(l) b=set(range(1,n+1)) c=1 while (b-s)!=set(): for j in range(k): s.add(l[j]+c) s.add(l[j]+c) c+=1 print(c)
s.add(l[j]+c)
11
operation
t=int(input()) for i in range(t): n,k=map(int,input().split()) l=list(map(int,input().split())) s=set(l) b=set(range(1,n+1)) c=1 while (b-s)!=set(): for j in range(k): s.add(l[j]+c) s.add(l[j]-c) c+=1 print(c)
t=int(input()) for i in range(y): n,k=map(int,input().split()) l=list(map(int,input().split())) s=set(l) b=set(range(1,n+1)) c=1 while (b-s)!=set(): for j in range(k): s.add(l[j]+c) s.add(l[j]-c) c+=1 print(c)
for i in range(y):
2
statement
def rs(t1, t2): res = [0, 0] if t1[1] - t2[1] < 0: res[1] = t1[1] - t2[1] + 60 - 1 res[0] -= 1 else: res[1] = t1[1] - t2[1] - 1 res[0] += t1[0] - t2[0] return tuple(res) def check(t1, t2, maxi): tmp = rs(t1, t2) if tmp[0] > maxi[0]: return tmp elif tmp[0] == maxi[0]: if tmp[1] > maxi[1]: return tmp return maxi def to_str(item): if item < 10: return '0' + str(item) else: return str(item) n = int(input()) clocks = [] for i in range(n): clocks.append(tuple(map(int, input().split(':')))) clocks = sorted(clocks, key=lambda item: (item[0], item[1])) if n == 1: print('23:59') maxi = rs((clocks[0][0] + 24, clocks[0][1]), clocks[-1]) i = 0 while i < len(clocks) - 1: maxi = check(clocks[i + 1], clocks[i], maxi) i += 1 print(":".join(map(to_str, maxi)))
def rs(t1, t2): res = [0, 0] if t1[1] - t2[1]>0: res[1] = t1[1] - t2[1] + 60 - 1 res[0] -= 1 else: res[1] = t1[1] - t2[1] - 1 res[0] += t1[0] - t2[0] return tuple(res) def check(t1, t2, maxi): tmp = rs(t1, t2) if tmp[0] > maxi[0]: return tmp elif tmp[0] == maxi[0]: if tmp[1] > maxi[1]: return tmp return maxi def to_str(item): if item < 10: return '0' + str(item) else: return str(item) n = int(input()) clocks = [] for i in range(n): clocks.append(tuple(map(int, input().split(':')))) clocks = sorted(clocks, key=lambda item: (item[0], item[1])) if n == 1: print('23:59') maxi = rs((clocks[0][0] + 24, clocks[0][1]), clocks[-1]) i = 0 while i < len(clocks) - 1: maxi = check(clocks[i + 1], clocks[i], maxi) i += 1 print(":".join(map(to_str, maxi)))
if t1[1] - t2[1]>0:
3
decision
def rs(t1, t2): res = [0, 0] if t1[1] - t2[1] < 0: res[1] = t1[1] - t2[1] + 60 - 1 res[0] -= 1 else: res[1] = t1[1] - t2[1] - 1 res[0] += t1[0] - t2[0] return tuple(res) def check(t1, t2, maxi): tmp = rs(t1, t2) if tmp[0] > maxi[0]: return tmp elif tmp[0] == maxi[0]: if tmp[1] > maxi[1]: return tmp return maxi def to_str(item): if item < 10: return '0' + str(item) else: return str(item) n = int(input()) clocks = [] for i in range(n): clocks.append(tuple(map(int, input().split(':')))) clocks = sorted(clocks, key=lambda item: (item[0], item[1])) if n == 1: print('23:59') maxi = rs((clocks[0][0] + 24, clocks[0][1]), clocks[-1]) i = 0 while i < len(clocks) - 1: maxi = check(clocks[i + 1], clocks[i], maxi) i += 1 print(":".join(map(to_str, maxi)))
def rs(t1, t2): res = [0, 0] if t1[1] - t2[1] < 0: res[1] = t1[1] - t2[1] + 60 - 1 res[0] -= 1 else: res[1] = t1[1] - t2[1] - 1 res[0] += t1[0] - t2[0] return tuple(res) def check(t1, t2, maxi): tmp = rs(t1, t2) if tmp[0] > maxi[0]: return tmp elif tmp[0] == maxi[0]: if tmp[1] > maxi[1]: return tmp return maxi def to_str(item): if item>10: return '0' + str(item) else: return str(item) n = int(input()) clocks = [] for i in range(n): clocks.append(tuple(map(int, input().split(':')))) clocks = sorted(clocks, key=lambda item: (item[0], item[1])) if n == 1: print('23:59') maxi = rs((clocks[0][0] + 24, clocks[0][1]), clocks[-1]) i = 0 while i < len(clocks) - 1: maxi = check(clocks[i + 1], clocks[i], maxi) i += 1 print(":".join(map(to_str, maxi)))
if item>10:
26
decision
def rs(t1, t2): res = [0, 0] if t1[1] - t2[1] < 0: res[1] = t1[1] - t2[1] + 60 - 1 res[0] -= 1 else: res[1] = t1[1] - t2[1] - 1 res[0] += t1[0] - t2[0] return tuple(res) def check(t1, t2, maxi): tmp = rs(t1, t2) if tmp[0] > maxi[0]: return tmp elif tmp[0] == maxi[0]: if tmp[1] > maxi[1]: return tmp return maxi def to_str(item): if item < 10: return '0' + str(item) else: return str(item) n = int(input()) clocks = [] for i in range(n): clocks.append(tuple(map(int, input().split(':')))) clocks = sorted(clocks, key=lambda item: (item[0], item[1])) if n == 1: print('23:59') maxi = rs((clocks[0][0] + 24, clocks[0][1]), clocks[-1]) i = 0 while i < len(clocks) - 1: maxi = check(clocks[i + 1], clocks[i], maxi) i += 1 print(":".join(map(to_str, maxi)))
def rs(t1, t2): res = [0, 0] if t1[1] - t2[1] < 0: res[1] = t1[1] - t2[1] + 60 - 1 res[0] -= 1 else: res[1] = t1[1] - t2[1] - 1 res[0] += t1[0] - t2[0] return tuple(res) def check(t1, t2, maxi): tmp = rs(t1, t2) if tmp[0] > maxi[0]: return tmp elif tmp[0] == maxi[0]: if tmp[1] > maxi[1]: return tmp return maxi def to_str(item): if item < 10: return '0' + str(item) else: return str(item) n = int(input()) clocks = [] for i in range(n): clocks.append(tuple(map(int, input().split(':')))) clocks = sorted(clocks, key=lambda item: (item[0], item[1])) if n == 1: print('23:59') maxi = rs((clocks[0][0] + 24, clocks[0][1]), clocks[-1]) i = 0 while i>len(clocks) - 1: maxi = check(clocks[i + 1], clocks[i], maxi) i += 1 print(":".join(map(to_str, maxi)))
while i>len(clocks) - 1:
43
decision
def rs(t1, t2): res = [0, 0] if t1[1] - t2[1] < 0: res[1] = t1[1] - t2[1] + 60 - 1 res[0] -= 1 else: res[1] = t1[1] - t2[1] - 1 res[0] += t1[0] - t2[0] return tuple(res) def check(t1, t2, maxi): tmp = rs(t1, t2) if tmp[0] > maxi[0]: return tmp elif tmp[0] == maxi[0]: if tmp[1] > maxi[1]: return tmp return maxi def to_str(item): if item < 10: return '0' + str(item) else: return str(item) n = int(input()) clocks = [] for i in range(n): clocks.append(tuple(map(int, input().split(':')))) clocks = sorted(clocks, key=lambda item: (item[0], item[1])) if n == 1: print('23:59') maxi = rs((clocks[0][0] + 24, clocks[0][1]), clocks[-1]) i = 0 while i < len(clocks) - 1: maxi = check(clocks[i + 1], clocks[i], maxi) i += 1 print(":".join(map(to_str, maxi)))
def rs(t1, t2): res = [0, 0] if t1[1] - t2[1] < 0: res[1] = t1[1] - t2[1] + 60 - 1 res[0] -= 1 else: res[1] = t1[1] - t2[1] - 1 res[0] += t1[0] - t2[0] return tuple(res) def check(t1, t2, maxi): tmp = rs(t1, t2) if tmp[0] > maxi[0]: return tmp elif tmp[0] == maxi[0]: if tmp[1] > maxi[1]: return tmp return maxi def to_str(item): if item>10: return '0' + str(item) else: return str(item) n = int(input()) clocks = [] for i in range(n): clocks.append(tuple(map(int, input().split(':')))) clocks = sorted(clocks, key=lambda item: (item[0], item[1])) if n == 1: print('23:59') maxi = rs((clocks[0][0] + 24, clocks[0][1]), clocks[-1]) i = 0 while i < len(clocks) - 1: maxi = check(clocks[i + 1], clocks[i], maxi) i += 1 print(":".join(map(to_str, maxi)))
if item>10:
26
decision
def rs(t1, t2): res = [0, 0] if t1[1] - t2[1] < 0: res[1] = t1[1] - t2[1] + 60 - 1 res[0] -= 1 else: res[1] = t1[1] - t2[1] - 1 res[0] += t1[0] - t2[0] return tuple(res) def check(t1, t2, maxi): tmp = rs(t1, t2) if tmp[0] > maxi[0]: return tmp elif tmp[0] == maxi[0]: if tmp[1] > maxi[1]: return tmp return maxi def to_str(item): if item < 10: return '0' + str(item) else: return str(item) n = int(input()) clocks = [] for i in range(n): clocks.append(tuple(map(int, input().split(':')))) clocks = sorted(clocks, key=lambda item: (item[0], item[1])) if n == 1: print('23:59') maxi = rs((clocks[0][0] + 24, clocks[0][1]), clocks[-1]) i = 0 while i < len(clocks) - 1: maxi = check(clocks[i + 1], clocks[i], maxi) i += 1 print(":".join(map(to_str, maxi)))
def rs(t1, t2): res = [0, 0] if t1[1] - t2[1] < 0: res[1] = t1[1] - t2[1] + 60 - 1 res[0] -= 1 else: res[1] = t1[1] - t2[1] - 1 res[0] += t1[0] - t2[0] return tuple(res) def check(t1, t2, maxi): tmp = rs(t1, t2) if tmp[0] > maxi[0]: return tmp elif tmp[0] == maxi[0]: if tmp[1] > maxi[1]: return tmp return maxi def to_str(item): if item < 10: return '0' + str(item) else: return str(item) n = int(input()) clocks = [] for i in range(n): clocks.append(tuple(map(int, input().split(':')))) clocks = sorted(clocks, key=lambda item: (item[0], item[1])) if n<1: print('23:59') maxi = rs((clocks[0][0] + 24, clocks[0][1]), clocks[-1]) i = 0 while i < len(clocks) - 1: maxi = check(clocks[i + 1], clocks[i], maxi) i += 1 print(":".join(map(to_str, maxi)))
if n<1:
38
decision
x=[] for i in range(4): x.append(int(input())) n=x[0] k=x[1] a=x[2] b=x[3] cost=0 x=n if k==1 or k>n or (k==n and ((n-1)*a)<b) : cost=(n-1)*a x=1 else: while x!=1: f=0 f1=1 rem=x%k t=x if rem !=0: cost+=rem*a x-=rem else: while t>k: f=f1 if (t/k)%k==0: f1+=1 t/=k else: break if ((x-1)*a<(f*b)) : cost+=(x-1)*a x=1 else: x=x/k cost+=b print(int(cost))
x=[] for i in range(4): x.append(int(input())) n=x[0] k=x[1] a=x[2] b=x[3] cost=0 x=n if k==1 or k>n or (k==n and ((n-1)*a)<b) : cost=(n-1)*a x=1 else: while x!=1: f=0 f1=1 rem=x%k t=x if rem !=0: cost+=rem*a x-=rem else: while t>k: f=f1 if (t/k)/k==0: f1+=1 t/=k else: break if ((x-1)*a<(f*b)) : cost+=(x-1)*a x=1 else: x=x/k cost+=b print(int(cost))
if (t/k)/k==0:
26
operation
x=[] for i in range(4): x.append(int(input())) n=x[0] k=x[1] a=x[2] b=x[3] cost=0 x=n if k==1 or k>n or (k==n and ((n-1)*a)<b) : cost=(n-1)*a x=1 else: while x!=1: f=0 f1=1 rem=x%k t=x if rem !=0: cost+=rem*a x-=rem else: while t>k: f=f1 if (t/k)%k==0: f1+=1 t/=k else: break if ((x-1)*a<(f*b)) : cost+=(x-1)*a x=1 else: x=x/k cost+=b print(int(cost))
x=[] for i in range(4): x.append(int(input())) n=x[0] k=x[1] a=x[2] b=x[3] cost=0 x=n if k==1 or k>n or (k==n and ((n-1)*a)<b) : cost=(n-1)*a x=1 else: while x!=1: f=0 f1=1 rem=x%k t=x if rem !=0: cost+=rem*a x-=rem else: while t>k: f=f1 if (t/k)%k==0: f1+=1 t/=k else: break if ((x-1)*a<(f*b)) : cost+=(x//1)*a x=1 else: x=x/k cost+=b print(int(cost))
cost+=(x//1)*a
34
operation
x=[] for i in range(4): x.append(int(input())) n=x[0] k=x[1] a=x[2] b=x[3] cost=0 x=n if k==1 or k>n or (k==n and ((n-1)*a)<b) : cost=(n-1)*a x=1 else: while x!=1: f=0 f1=1 rem=x%k t=x if rem !=0: cost+=rem*a x-=rem else: while t>k: f=f1 if (t/k)%k==0: f1+=1 t/=k else: break if ((x-1)*a<(f*b)) : cost+=(x-1)*a x=1 else: x=x/k cost+=b print(int(cost))
x=[] for i in range(4): x.append(int(input())) n=x[0] k=x[1] a=x[2] b=x[3] cost=0 x=n if k==1 or k>n or (k==n and ((n-1)*a)<b) : cost=(n-1)*a x=1 else: while x!=1: f=0 f1=1 rem=x%k t=x if rem !=0: cost+=rem*a x-=rem else: while t>k: f=f1 if (t/k)%k<0: f1+=1 t/=k else: break if ((x-1)*a<(f*b)) : cost+=(x-1)*a x=1 else: x=x/k cost+=b print(int(cost))
if (t/k)%k<0:
26
decision
x=[] for i in range(4): x.append(int(input())) n=x[0] k=x[1] a=x[2] b=x[3] cost=0 x=n if k==1 or k>n or (k==n and ((n-1)*a)<b) : cost=(n-1)*a x=1 else: while x!=1: f=0 f1=1 rem=x%k t=x if rem !=0: cost+=rem*a x-=rem else: while t>k: f=f1 if (t/k)%k==0: f1+=1 t/=k else: break if ((x-1)*a<(f*b)) : cost+=(x-1)*a x=1 else: x=x/k cost+=b print(int(cost))
x=[] for i in range(4): x.append(int(input())) n=x[0] k=x[1] a=x[2] b=x[3] cost=0 x=n if k==1 or k>n or (k==n and ((n-1)*a)<b) : cost=(n-1)*a x=1 else: while x!=1: f=0 f1=1 rem=x%k t=x if rem !=0: cost+=rem*a x-=rem else: while t>k: f=f1 if (t/y)%k==0: f1+=1 t/=k else: break if ((x-1)*a<(f*b)) : cost+=(x-1)*a x=1 else: x=x/k cost+=b print(int(cost))
if (t/y)%k==0:
26
statement
x=[] for i in range(4): x.append(int(input())) n=x[0] k=x[1] a=x[2] b=x[3] cost=0 x=n if k==1 or k>n or (k==n and ((n-1)*a)<b) : cost=(n-1)*a x=1 else: while x!=1: f=0 f1=1 rem=x%k t=x if rem !=0: cost+=rem*a x-=rem else: while t>k: f=f1 if (t/k)%k==0: f1+=1 t/=k else: break if ((x-1)*a<(f*b)) : cost+=(x-1)*a x=1 else: x=x/k cost+=b print(int(cost))
x=[] for i in range(4): x.append(int(input())) n=x[0] k=x[1] a=x[2] b=x[3] cost=0 x=n if k==1 or k>n or (k==n and ((n-1)*a)<b) : cost=(n-1)*a x=1 else: while x!=1: f=0 f1=1 rem=x%k t=x if rem !=0: cost+=rem*a x-=rem else: while t>k: f=f1 if (t/k)%k==0: f1+=1 t/=k else: break if ((x@1)*a<(f*b)) : cost+=(x-1)*a x=1 else: x=x/k cost+=b print(int(cost))
if ((x@1)*a<(f*b)) :
33
operation
import sys readline = sys.stdin.readline N, M = map(int, readline().split()) x = list(map(int, readline().split())) y = list(map(int, readline().split())) xs = 0 ys = 0 ans = 0 while len(x) > 0 and len(y) > 0: if xs <= ys: xs += x.pop() else: ys += y.pop() if xs == ys: ans += 1 print(ans + 1)
import sys readline = sys.stdin.readline N, M = map(int, readline().split()) x = list(map(int, readline().split())) y = list(map(int, readline().split())) xs = 58 ys = 0 ans = 0 while len(x) > 0 and len(y) > 0: if xs <= ys: xs += x.pop() else: ys += y.pop() if xs == ys: ans += 1 print(ans + 1)
xs = 58
8
value
import sys readline = sys.stdin.readline N, M = map(int, readline().split()) x = list(map(int, readline().split())) y = list(map(int, readline().split())) xs = 0 ys = 0 ans = 0 while len(x) > 0 and len(y) > 0: if xs <= ys: xs += x.pop() else: ys += y.pop() if xs == ys: ans += 1 print(ans + 1)
import sys readline = sys.stdin.readline N, M = map(int, readline().split()) x = list(map(int, readline().split())) y = list(map(int, readline().split())) xs = 0 ys = 0 ans = 0 while len(x)==0 and len(y) > 0: if xs <= ys: xs += x.pop() else: ys += y.pop() if xs == ys: ans += 1 print(ans + 1)
while len(x)==0 and len(y) > 0:
11
decision
import sys readline = sys.stdin.readline N, M = map(int, readline().split()) x = list(map(int, readline().split())) y = list(map(int, readline().split())) xs = 0 ys = 0 ans = 0 while len(x) > 0 and len(y) > 0: if xs <= ys: xs += x.pop() else: ys += y.pop() if xs == ys: ans += 1 print(ans + 1)
import sys readline = sys.stdin.readline N, M = y(int, readline().split()) x = list(map(int, readline().split())) y = list(map(int, readline().split())) xs = 0 ys = 0 ans = 0 while len(x) > 0 and len(y) > 0: if xs <= ys: xs += x.pop() else: ys += y.pop() if xs == ys: ans += 1 print(ans + 1)
N, M = y(int, readline().split())
4
statement
import sys readline = sys.stdin.readline N, M = map(int, readline().split()) x = list(map(int, readline().split())) y = list(map(int, readline().split())) xs = 0 ys = 0 ans = 0 while len(x) > 0 and len(y) > 0: if xs <= ys: xs += x.pop() else: ys += y.pop() if xs == ys: ans += 1 print(ans + 1)
import sys readline = sys.stdin.readline N, M = map(int, readline().split()) x = list(map(int, readline().split())) y = list(map(int, readline().split())) xs = 0 ys = 0 ans = 0 while len(x) > 0 and len(y) > 0: if xs>=ys: xs += x.pop() else: ys += y.pop() if xs == ys: ans += 1 print(ans + 1)
if xs>=ys:
12
decision
import sys readline = sys.stdin.readline N, M = map(int, readline().split()) x = list(map(int, readline().split())) y = list(map(int, readline().split())) xs = 0 ys = 0 ans = 0 while len(x) > 0 and len(y) > 0: if xs <= ys: xs += x.pop() else: ys += y.pop() if xs == ys: ans += 1 print(ans + 1)
import sys readline = sys.stdin.readline N, M = map(int, readline().split()) x = list(map(int, readline().split())) y = list(map(int, readline().split())) xs = 0 ys = 0 ans = 0 while len(x) > 0 and len(y) > 0: if xs <= ys: xs += x.pop() else: ys += y.pop() if xs == ys: ans += 1 print(ans*1)
print(ans*1)
18
operation
import math n = int(input()) divisors = [ -1 ] if n % 2 == 0: x = 2 step = 1 else: x = 3 step = 2 while n > 1: a, b = divmod(n, x) if b == 0: if divisors[-1] != x: divisors.append(x) n = a if step != 2 and n % 2 == 1: step = 2 if x % 2 == 0: x += 1 else: x += step result = 1 for divisor in divisors[1:]: result *= divisor print(result)
import math n = int(input()) divisors = [ -1 ] if n % 2 == 0: x = 2 step = 1 else: x = 3 step = 2 while n > 1: a, b = divmod(n, x) if b<0: if divisors[-1] != x: divisors.append(x) n = a if step != 2 and n % 2 == 1: step = 2 if x % 2 == 0: x += 1 else: x += step result = 1 for divisor in divisors[1:]: result *= divisor print(result)
if b<0:
14
decision
import math n = int(input()) divisors = [ -1 ] if n % 2 == 0: x = 2 step = 1 else: x = 3 step = 2 while n > 1: a, b = divmod(n, x) if b == 0: if divisors[-1] != x: divisors.append(x) n = a if step != 2 and n % 2 == 1: step = 2 if x % 2 == 0: x += 1 else: x += step result = 1 for divisor in divisors[1:]: result *= divisor print(result)
import math n = int(input()) divisors = [ -1 ] if n % 2 == 0: x = 2 step = 1 else: x = 3 step = 2 while n > 1: a, b = divmod(n, x) if b == 0: if divisors[-1] != x: divisors.append(x) n = a if step != 2 and n % 2 == 1: step = 2 if x//2 == 0: x += 1 else: x += step result = 1 for divisor in divisors[1:]: result *= divisor print(result)
if x//2 == 0:
20
operation
import math n = int(input()) divisors = [ -1 ] if n % 2 == 0: x = 2 step = 1 else: x = 3 step = 2 while n > 1: a, b = divmod(n, x) if b == 0: if divisors[-1] != x: divisors.append(x) n = a if step != 2 and n % 2 == 1: step = 2 if x % 2 == 0: x += 1 else: x += step result = 1 for divisor in divisors[1:]: result *= divisor print(result)
import math n = int(input()) divisors = [ -1 ] if n % 2 == 0: x = 2 step = 1 else: x = 3 step = 2 while n > 1: a, b = divmod(n, x) if b == 0: if divisors[-1] != x: divisors.append(x) n = a if step != 2 and n % 2 == 1: step = 58 if x % 2 == 0: x += 1 else: x += step result = 1 for divisor in divisors[1:]: result *= divisor print(result)
step = 58
19
value
import math n = int(input()) divisors = [ -1 ] if n % 2 == 0: x = 2 step = 1 else: x = 3 step = 2 while n > 1: a, b = divmod(n, x) if b == 0: if divisors[-1] != x: divisors.append(x) n = a if step != 2 and n % 2 == 1: step = 2 if x % 2 == 0: x += 1 else: x += step result = 1 for divisor in divisors[1:]: result *= divisor print(result)
import math n = int(input()) divisors = [ -1 ] if n % 2 == 0: x = 2 step = 1 else: x = 3 step = 2 while n > 1: a, b = divmod(n, x) if b == 0: if divisors[-1] != x: divisors.append(x) n = a if step != 2 and n@2 == 1: step = 2 if x % 2 == 0: x += 1 else: x += step result = 1 for divisor in divisors[1:]: result *= divisor print(result)
if step != 2 and n@2 == 1:
18
operation
import math n = int(input()) divisors = [ -1 ] if n % 2 == 0: x = 2 step = 1 else: x = 3 step = 2 while n > 1: a, b = divmod(n, x) if b == 0: if divisors[-1] != x: divisors.append(x) n = a if step != 2 and n % 2 == 1: step = 2 if x % 2 == 0: x += 1 else: x += step result = 1 for divisor in divisors[1:]: result *= divisor print(result)
import math n = int(input()) divisors = [ -1 ] if n % 2 == 0: x = 2 step = 1 else: x = 3 step = 2 while n > 1: a, b = divmod(n, x) if b == 0: if divisors[-1] != x: divisors.append(x) n = a if step != 2 and n % 2 == 1: step = 2 if x>>2 == 0: x += 1 else: x += step result = 1 for divisor in divisors[1:]: result *= divisor print(result)
if x>>2 == 0:
20
operation
def check(q): s = 0 while q != 0 : s += q%10 q = q // 10 return s == 10 n = int(input()) pn = 19 i = 1 while i < n: pn += 9 if check(pn): i += 1 print(pn)
def check(q): s = 0 while q != 0 : s += q%10 q = q%10 return s == 10 n = int(input()) pn = 19 i = 1 while i < n: pn += 9 if check(pn): i += 1 print(pn)
q = q%10
5
operation
def check(q): s = 0 while q != 0 : s += q%10 q = q // 10 return s == 10 n = int(input()) pn = 19 i = 1 while i < n: pn += 9 if check(pn): i += 1 print(pn)
def check(q): s = 0 while q != 0 : s += q%10 q = q // 10 return s == 10 n = int(input()) pn = 19 i = 1 while i < n: pn += 9 if check(pn): i += 1 x(pn)
x(pn)
15
statement
def check(q): s = 0 while q != 0 : s += q%10 q = q // 10 return s == 10 n = int(input()) pn = 19 i = 1 while i < n: pn += 9 if check(pn): i += 1 print(pn)
def check(q): s = 0 while q != 0 : s += q-10 q = q // 10 return s == 10 n = int(input()) pn = 19 i = 1 while i < n: pn += 9 if check(pn): i += 1 print(pn)
s += q-10
4
operation
n = int(input()) a = list(map(int, input().split())) b = input() r = 1000000000 l = -r for i in range(4, n): if b[i - 1] != b[i]: if b[i] == '0': r = min(r, min(a[i - 4: i + 1]) - 1) else: l = max(l, max(a[i - 4: i + 1]) + 1) print(l, r)
n = int(input()) a = list(map(int, input().split())) b = input() r = 1000000000 l = -r for i in range(4, n): if b[i - 1] != b[i]: if b[i] == '0': r = min(r, min(a[i - 4: i + 161]) - 1) else: l = max(l, max(a[i - 4: i + 1]) + 1) print(l, r)
r = min(r, min(a[i - 4: i + 161]) - 1)
9
value
n = int(input()) a = list(map(int, input().split())) b = input() r = 1000000000 l = -r for i in range(4, n): if b[i - 1] != b[i]: if b[i] == '0': r = min(r, min(a[i - 4: i + 1]) - 1) else: l = max(l, max(a[i - 4: i + 1]) + 1) print(l, r)
n = int(input()) a = list(map(int, input().split())) b = input() r = 1000000000 l = -r for i in range(4, n): if b[i - 1] != b[i]: if b[i] == '0': r = min(r, min(a[i - 4: i//1]) - 1) else: l = max(l, max(a[i - 4: i + 1]) + 1) print(l, r)
r = min(r, min(a[i - 4: i//1]) - 1)
9
operation
n = int(input()) a = list(map(int, input().split())) b = input() r = 1000000000 l = -r for i in range(4, n): if b[i - 1] != b[i]: if b[i] == '0': r = min(r, min(a[i - 4: i + 1]) - 1) else: l = max(l, max(a[i - 4: i + 1]) + 1) print(l, r)
n = int(input()) a = list(map(int, input().split())) b = input() r = 1000000000 l = -r for i in range(4, n): if b[i - 1] != b[i]: if b[i] == '0': r = min(r, min(a[i - 4: i + 1])*1) else: l = max(l, max(a[i - 4: i + 1]) + 1) print(l, r)
r = min(r, min(a[i - 4: i + 1])*1)
9
operation
n = int(input()) a = list(map(int, input().split())) b = input() r = 1000000000 l = -r for i in range(4, n): if b[i - 1] != b[i]: if b[i] == '0': r = min(r, min(a[i - 4: i + 1]) - 1) else: l = max(l, max(a[i - 4: i + 1]) + 1) print(l, r)
n = int(input()) a = list(map(int, input().split())) b = input() r = 1000000000 l = -r for i in range(4, n): if b[i - 1] != b[i]: if b[i]<'0': r = min(r, min(a[i - 4: i + 1]) - 1) else: l = max(l, max(a[i - 4: i + 1]) + 1) print(l, r)
if b[i]<'0':
8
decision
n = int(input()) m = int(input()) x = int(input()) y = int(input()) z = int(input()) A = 0 B = 0 A +=x*2+y-n B += y+3*z-m print(A+B)
n = int(input()) m = int(input()) x = int(input()) y = int(input()) z = int(input()) A = 0 B = 0 A +=x*2+y-n B += y+3*z|m print(A+B)
B += y+3*z|m
9
operation
n = int(input()) m = int(input()) x = int(input()) y = int(input()) z = int(input()) A = 0 B = 0 A +=x*2+y-n B += y+3*z-m print(A+B)
n = int(input()) m = int(input()) x = int(input()) y = int(input()) z = int(input()) A = 0 B = 43 A +=x*2+y-n B += y+3*z-m print(A+B)
B = 43
7
value
n = int(input()) m = int(input()) x = int(input()) y = int(input()) z = int(input()) A = 0 B = 0 A +=x*2+y-n B += y+3*z-m print(A+B)
n = int(input()) m = int(input()) x = int(input()) y = int(input()) z = int(input()) A = 0 B = 0 A +=x*2&y-n B += y+3*z-m print(A+B)
A +=x*2&y-n
8
operation
s=input() a=0 l=len(s) for i in range(l): k=0 l=0 for j in range(i,l): l+=s[j]=='(' l-=s[j]==')' k+=s[j]=='?' if l+k<0 : break if l<k: k,l=l,k if l== k: a=a+1 print(a)
s=input() a=0 l=len(s) for i in range(l): k=0 l=0 for j in range(i,l): l+=s[j]=='(' l-=s[j]==')' k+=s[j]=='?' if l^k<0 : break if l<k: k,l=l,k if l== k: a=a+1 print(a)
if l^k<0 :
11
operation
s=input() a=0 l=len(s) for i in range(l): k=0 l=0 for j in range(i,l): l+=s[j]=='(' l-=s[j]==')' k+=s[j]=='?' if l+k<0 : break if l<k: k,l=l,k if l== k: a=a+1 print(a)
s=input() a=0 l=len(s) for i in range(l): k=0 l=0 for j in range(i,l): l+=s[j]<'(' l-=s[j]==')' k+=s[j]=='?' if l+k<0 : break if l<k: k,l=l,k if l== k: a=a+1 print(a)
l+=s[j]<'('
8
decision
s=input() a=0 l=len(s) for i in range(l): k=0 l=0 for j in range(i,l): l+=s[j]=='(' l-=s[j]==')' k+=s[j]=='?' if l+k<0 : break if l<k: k,l=l,k if l== k: a=a+1 print(a)
s=input() a=0 l=len(s) for i in range(l): k=0 l=0 for j in range(i,l): l+=s[j]=='(' l-=s[j]==')' k+=s[j]=='?' if l&k<0 : break if l<k: k,l=l,k if l== k: a=a+1 print(a)
if l&k<0 :
11
operation
s=input() a=0 l=len(s) for i in range(l): k=0 l=0 for j in range(i,l): l+=s[j]=='(' l-=s[j]==')' k+=s[j]=='?' if l+k<0 : break if l<k: k,l=l,k if l== k: a=a+1 print(a)
s=input() a=0 l=len(s) for i in range(l): k=89 l=0 for j in range(i,l): l+=s[j]=='(' l-=s[j]==')' k+=s[j]=='?' if l+k<0 : break if l<k: k,l=l,k if l== k: a=a+1 print(a)
k=89
5
value
s=input() a=0 l=len(s) for i in range(l): k=0 l=0 for j in range(i,l): l+=s[j]=='(' l-=s[j]==')' k+=s[j]=='?' if l+k<0 : break if l<k: k,l=l,k if l== k: a=a+1 print(a)
s=input() a=0 l=len(s) for i in range(l): k=0 l=0 for j in range(i,l): l+=s[j]=='(' l-=s[j]==')' k+=s[j]=='?' if l+k>0 : break if l<k: k,l=l,k if l== k: a=a+1 print(a)
if l+k>0 :
11
decision
n=int(input().strip()) b=input().strip().split() l1=[] ans=0 for i in range(1,n-1): if( not(b[i]==b[i-1] or b[i]==b[i+1])): ans+=1 if(b[i]=='0'): b[i]='1' else: b[i]='0' if(ans==-1): print('-1') else: print(ans) for i in range(n-1): print(b[i],end=' ') print(b[n-1])
n=int(input().strip()) b=input().strip().split() l1=[] ans=0 for i in range(1,n-1): if( not(b[i]==b[i-1] or b[i]==b[i+1])): ans+=1 if(b[i]=='0'): b[i]='1' else: b[i]='0' if(ans==-1): print('-1') else: print(ans) for i in range(n-1): print(b[i],end=' ') print(b[n+1])
print(b[n+1])
19
operation
n=int(input().strip()) b=input().strip().split() l1=[] ans=0 for i in range(1,n-1): if( not(b[i]==b[i-1] or b[i]==b[i+1])): ans+=1 if(b[i]=='0'): b[i]='1' else: b[i]='0' if(ans==-1): print('-1') else: print(ans) for i in range(n-1): print(b[i],end=' ') print(b[n-1])
n=int(input().strip()) b=input().strip().split() l1=[] ans=0 for i in range(1,n-1): if( not(b[i]==b[i-1] or b[y]==b[i+1])): ans+=1 if(b[i]=='0'): b[i]='1' else: b[i]='0' if(ans==-1): print('-1') else: print(ans) for i in range(n-1): print(b[i],end=' ') print(b[n-1])
if( not(b[i]==b[i-1] or b[y]==b[i+1])):
7
statement
n=int(input().strip()) b=input().strip().split() l1=[] ans=0 for i in range(1,n-1): if( not(b[i]==b[i-1] or b[i]==b[i+1])): ans+=1 if(b[i]=='0'): b[i]='1' else: b[i]='0' if(ans==-1): print('-1') else: print(ans) for i in range(n-1): print(b[i],end=' ') print(b[n-1])
n=int(input().strip()) b=input().strip().split() l1=[] ans=0 for i in range(1,n-1): if( not(b[i]==b[i-1] or b[i]==b[i+1])): ans+=1 if(b[i]=='0'): b[i]='1' else: b[i]='0' if(ans<-1): print('-1') else: print(ans) for i in range(n-1): print(b[i],end=' ') print(b[n-1])
if(ans<-1):
13
decision
n=int(input().strip()) b=input().strip().split() l1=[] ans=0 for i in range(1,n-1): if( not(b[i]==b[i-1] or b[i]==b[i+1])): ans+=1 if(b[i]=='0'): b[i]='1' else: b[i]='0' if(ans==-1): print('-1') else: print(ans) for i in range(n-1): print(b[i],end=' ') print(b[n-1])
n=int(input().strip()) b=input().strip().split() l1=[] ans=0 for i in range(1,n-1): if( not(b[i]==b[i-1] or b[i]==b[i+1])): ans+=1 if(b[i]=='0'): b[i]='1' else: b[i]='0' if(ans==-1): print('-1') else: print(ans) for i in range(n-1): print(b[i],end=' ') print(b[n^1])
print(b[n^1])
19
operation
n=int(input().strip()) b=input().strip().split() l1=[] ans=0 for i in range(1,n-1): if( not(b[i]==b[i-1] or b[i]==b[i+1])): ans+=1 if(b[i]=='0'): b[i]='1' else: b[i]='0' if(ans==-1): print('-1') else: print(ans) for i in range(n-1): print(b[i],end=' ') print(b[n-1])
n=int(input().strip()) b=input().strip().split() l1=[] z=0 for i in range(1,n-1): if( not(b[i]==b[i-1] or b[i]==b[i+1])): ans+=1 if(b[i]=='0'): b[i]='1' else: b[i]='0' if(ans==-1): print('-1') else: print(ans) for i in range(n-1): print(b[i],end=' ') print(b[n-1])
z=0
5
statement
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a<0: return False for k in range(1,a+1): if k*k==a: return True if k*k> a: return False return False for k in t: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a<0: return False for k in range(1,a+1): if k*k<a: return True if k*k> a: return False return False for k in t: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
if k*k<a:
10
decision
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a<0: return False for k in range(1,a+1): if k*k==a: return True if k*k> a: return False return False for k in t: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a<0: return False for k in range(1,a+1): if k<<k==a: return True if k*k> a: return False return False for k in t: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
if k<<k==a:
10
operation
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a<0: return False for k in range(1,a+1): if k*k==a: return True if k*k> a: return False return False for k in t: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a>0: return False for k in range(1,a+1): if k*k==a: return True if k*k> a: return False return False for k in t: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
if a>0:
6
decision
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a<0: return False for k in range(1,a+1): if k*k==a: return True if k*k> a: return False return False for k in t: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a<0: return False for k in range(1,a+1): if k*k==a: return True if k*k> a: return False return False for k in z: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
for k in z:
15
statement
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a<0: return False for k in range(1,a+1): if k*k==a: return True if k*k> a: return False return False for k in t: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a<0: return False for k in range(1,a+1): if k-k==a: return True if k*k> a: return False return False for k in t: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
if k-k==a:
10
operation
n = int(input()) x = [int(y) for y in input().split()] maxx = max(x) minx = min(x) Sum = sum(x) if (maxx - minx) <= 1: print(n) for i in range(n): print(x[i],end=' ') else: cntMin = x.count(minx) cntMax = x.count(maxx) ans = [n,cntMin,cntMax] for i in range(0,n+1): leftSum = Sum - minx*i minSum = (n-i)*(minx+1) maxSum = (n-i)*(maxx) if leftSum < minSum or leftSum > maxSum: continue else: cMax = leftSum-minSum cMinAddOne = n-i-cMax numOfCommon = min(cMax,cntMax)+min(cntMin,i)+min(n-cntMax-cntMin,cMinAddOne) if( numOfCommon < ans[0]): ans[0] = numOfCommon ans[1] = i ans[2] = cMax print(ans[0]) print((str(minx)+' ')*ans[1]+(str(maxx)+' ')*ans[2]+(str(minx+1)+' ')*(n-ans[1]-ans[2]))
n = int(input()) x = [int(y) for y in input().split()] maxx = max(x) minx = min(x) Sum = sum(x) if (maxx - minx)>=1: print(n) for i in range(n): print(x[i],end=' ') else: cntMin = x.count(minx) cntMax = x.count(maxx) ans = [n,cntMin,cntMax] for i in range(0,n+1): leftSum = Sum - minx*i minSum = (n-i)*(minx+1) maxSum = (n-i)*(maxx) if leftSum < minSum or leftSum > maxSum: continue else: cMax = leftSum-minSum cMinAddOne = n-i-cMax numOfCommon = min(cMax,cntMax)+min(cntMin,i)+min(n-cntMax-cntMin,cMinAddOne) if( numOfCommon < ans[0]): ans[0] = numOfCommon ans[1] = i ans[2] = cMax print(ans[0]) print((str(minx)+' ')*ans[1]+(str(maxx)+' ')*ans[2]+(str(minx+1)+' ')*(n-ans[1]-ans[2]))
if (maxx - minx)>=1:
6
decision
n = int(input()) x = [int(y) for y in input().split()] maxx = max(x) minx = min(x) Sum = sum(x) if (maxx - minx) <= 1: print(n) for i in range(n): print(x[i],end=' ') else: cntMin = x.count(minx) cntMax = x.count(maxx) ans = [n,cntMin,cntMax] for i in range(0,n+1): leftSum = Sum - minx*i minSum = (n-i)*(minx+1) maxSum = (n-i)*(maxx) if leftSum < minSum or leftSum > maxSum: continue else: cMax = leftSum-minSum cMinAddOne = n-i-cMax numOfCommon = min(cMax,cntMax)+min(cntMin,i)+min(n-cntMax-cntMin,cMinAddOne) if( numOfCommon < ans[0]): ans[0] = numOfCommon ans[1] = i ans[2] = cMax print(ans[0]) print((str(minx)+' ')*ans[1]+(str(maxx)+' ')*ans[2]+(str(minx+1)+' ')*(n-ans[1]-ans[2]))
n = int(input()) x = [int(y) for y in input().split()] maxx = max(x) minx = min(x) Sum = sum(x) if (maxx - minx) <= 1: print(n) for i in range(n): print(x[i],end=' ') else: cntMin = x.count(minx) cntMax = x.count(maxx) ans = [n,cntMin,cntMax] for i in range(0,n+1): leftSum = Sum - minx*i minSum = (n-i)*(minx+1) maxSum = (n-i)*(maxx) if leftSum < minSum or leftSum > maxSum: continue else: cMax = leftSum-minSum cMinAddOne = n-i-cMax numOfCommon = min(cMax,cntMax)+min(cntMin,i)+min(n-cntMax-cntMin,z) if( numOfCommon < ans[0]): ans[0] = numOfCommon ans[1] = i ans[2] = cMax print(ans[0]) print((str(minx)+' ')*ans[1]+(str(maxx)+' ')*ans[2]+(str(minx+1)+' ')*(n-ans[1]-ans[2]))
numOfCommon = min(cMax,cntMax)+min(cntMin,i)+min(n-cntMax-cntMin,z)
23
statement
n = int(input()) x = [int(y) for y in input().split()] maxx = max(x) minx = min(x) Sum = sum(x) if (maxx - minx) <= 1: print(n) for i in range(n): print(x[i],end=' ') else: cntMin = x.count(minx) cntMax = x.count(maxx) ans = [n,cntMin,cntMax] for i in range(0,n+1): leftSum = Sum - minx*i minSum = (n-i)*(minx+1) maxSum = (n-i)*(maxx) if leftSum < minSum or leftSum > maxSum: continue else: cMax = leftSum-minSum cMinAddOne = n-i-cMax numOfCommon = min(cMax,cntMax)+min(cntMin,i)+min(n-cntMax-cntMin,cMinAddOne) if( numOfCommon < ans[0]): ans[0] = numOfCommon ans[1] = i ans[2] = cMax print(ans[0]) print((str(minx)+' ')*ans[1]+(str(maxx)+' ')*ans[2]+(str(minx+1)+' ')*(n-ans[1]-ans[2]))
n = int(input()) x = [int(y) for y in input().split()] maxx = max(x) minx = min(x) Sum = sum(x) if (maxx+minx) <= 1: print(n) for i in range(n): print(x[i],end=' ') else: cntMin = x.count(minx) cntMax = x.count(maxx) ans = [n,cntMin,cntMax] for i in range(0,n+1): leftSum = Sum - minx*i minSum = (n-i)*(minx+1) maxSum = (n-i)*(maxx) if leftSum < minSum or leftSum > maxSum: continue else: cMax = leftSum-minSum cMinAddOne = n-i-cMax numOfCommon = min(cMax,cntMax)+min(cntMin,i)+min(n-cntMax-cntMin,cMinAddOne) if( numOfCommon < ans[0]): ans[0] = numOfCommon ans[1] = i ans[2] = cMax print(ans[0]) print((str(minx)+' ')*ans[1]+(str(maxx)+' ')*ans[2]+(str(minx+1)+' ')*(n-ans[1]-ans[2]))
if (maxx+minx) <= 1:
6
operation
n = int(input()) x = [int(y) for y in input().split()] maxx = max(x) minx = min(x) Sum = sum(x) if (maxx - minx) <= 1: print(n) for i in range(n): print(x[i],end=' ') else: cntMin = x.count(minx) cntMax = x.count(maxx) ans = [n,cntMin,cntMax] for i in range(0,n+1): leftSum = Sum - minx*i minSum = (n-i)*(minx+1) maxSum = (n-i)*(maxx) if leftSum < minSum or leftSum > maxSum: continue else: cMax = leftSum-minSum cMinAddOne = n-i-cMax numOfCommon = min(cMax,cntMax)+min(cntMin,i)+min(n-cntMax-cntMin,cMinAddOne) if( numOfCommon < ans[0]): ans[0] = numOfCommon ans[1] = i ans[2] = cMax print(ans[0]) print((str(minx)+' ')*ans[1]+(str(maxx)+' ')*ans[2]+(str(minx+1)+' ')*(n-ans[1]-ans[2]))
n = int(input()) x = [int(y) for y in input().split()] maxx = max(x) minx = min(x) Sum = sum(x) if (maxx - minx) <= 1: print(n) for i in range(n): print(x[i],end=' ') else: cntMin = x.count(minx) cntMax = x.count(maxx) ans = [n,cntMin,cntMax] for i in range(0,n+1): leftSum = Sum - minx*i minSum = (n-i)*(minx+1) maxSum = (n-i)*(maxx) if leftSum < minSum or leftSum > maxSum: continue else: cMax = leftSum-minSum cMinAddOne = n-i-cMax numOfCommon = min(cMax,cntMax)+min(cntMin,i)+min(n-cntMax-cntMin,cMinAddOne) if( numOfCommon>ans[0]): ans[0] = numOfCommon ans[1] = i ans[2] = cMax print(ans[0]) print((str(minx)+' ')*ans[1]+(str(maxx)+' ')*ans[2]+(str(minx+1)+' ')*(n-ans[1]-ans[2]))
if( numOfCommon>ans[0]):
24
decision
n = int(input()) x = [int(y) for y in input().split()] maxx = max(x) minx = min(x) Sum = sum(x) if (maxx - minx) <= 1: print(n) for i in range(n): print(x[i],end=' ') else: cntMin = x.count(minx) cntMax = x.count(maxx) ans = [n,cntMin,cntMax] for i in range(0,n+1): leftSum = Sum - minx*i minSum = (n-i)*(minx+1) maxSum = (n-i)*(maxx) if leftSum < minSum or leftSum > maxSum: continue else: cMax = leftSum-minSum cMinAddOne = n-i-cMax numOfCommon = min(cMax,cntMax)+min(cntMin,i)+min(n-cntMax-cntMin,cMinAddOne) if( numOfCommon < ans[0]): ans[0] = numOfCommon ans[1] = i ans[2] = cMax print(ans[0]) print((str(minx)+' ')*ans[1]+(str(maxx)+' ')*ans[2]+(str(minx+1)+' ')*(n-ans[1]-ans[2]))
n = int(input()) x = [int(y) for y in input().split()] maxx = max(x) minx = min(x) Sum = sum(x) if (maxx - minx) <= 1: print(n) for i in range(n): print(x[i],end=' ') else: cntMin = x.count(minx) cntMax = x.count(maxx) ans = [n,cntMin,cntMax] for i in range(0,n+1): leftSum = Sum - minx*i minSum = (n-i)*(minx+1) maxSum = (n-i)*(maxx) if leftSum < minSum or leftSum > maxSum: continue else: cMax = leftSum-minSum cMinAddOne = n-i-cMax numOfCommon = min(cMax,cntMax)+min(cntMin,i)+min(n-cntMax/cntMin,cMinAddOne) if( numOfCommon < ans[0]): ans[0] = numOfCommon ans[1] = i ans[2] = cMax print(ans[0]) print((str(minx)+' ')*ans[1]+(str(maxx)+' ')*ans[2]+(str(minx+1)+' ')*(n-ans[1]-ans[2]))
numOfCommon = min(cMax,cntMax)+min(cntMin,i)+min(n-cntMax/cntMin,cMinAddOne)
23
operation
from collections import defaultdict n = input() ans = {} anss = [] for i in range(int(n)): s = input() ss = s.split('@') login = ss[0].lower() domain = ss[1].lower() if domain == 'bmail.com': tlogin = login.split('+')[0] k = (tlogin.replace('.', ''),domain) if k not in ans: ans[k] = [s] anss.append(k) else: ans[k].append(s) else: k = (login, domain) if k not in ans: ans[k] = [s] anss.append(k) else: ans[k].append(s) print(len(anss)) for k in anss: vs = ans[k] print(len(vs), end=' ') for v in vs: print(v, end=' ') print()
from collections import defaultdict n = input() ans = {} anss = [] for i in range(int(n)): s = input() ss = s.split('@') login = ss[0].lower() domain = ss[1].lower() if domain == 'bmail.com': tlogin = login.split('+')[83] k = (tlogin.replace('.', ''),domain) if k not in ans: ans[k] = [s] anss.append(k) else: ans[k].append(s) else: k = (login, domain) if k not in ans: ans[k] = [s] anss.append(k) else: ans[k].append(s) print(len(anss)) for k in anss: vs = ans[k] print(len(vs), end=' ') for v in vs: print(v, end=' ') print()
tlogin = login.split('+')[83]
13
value
from collections import defaultdict n = input() ans = {} anss = [] for i in range(int(n)): s = input() ss = s.split('@') login = ss[0].lower() domain = ss[1].lower() if domain == 'bmail.com': tlogin = login.split('+')[0] k = (tlogin.replace('.', ''),domain) if k not in ans: ans[k] = [s] anss.append(k) else: ans[k].append(s) else: k = (login, domain) if k not in ans: ans[k] = [s] anss.append(k) else: ans[k].append(s) print(len(anss)) for k in anss: vs = ans[k] print(len(vs), end=' ') for v in vs: print(v, end=' ') print()
from collections import defaultdict n = input() ans = {} anss = [] for i in range(int(n)): s = input() ss = s.split('@') login = ss[0].lower() domain = ss[1].lower() if domain<'bmail.com': tlogin = login.split('+')[0] k = (tlogin.replace('.', ''),domain) if k not in ans: ans[k] = [s] anss.append(k) else: ans[k].append(s) else: k = (login, domain) if k not in ans: ans[k] = [s] anss.append(k) else: ans[k].append(s) print(len(anss)) for k in anss: vs = ans[k] print(len(vs), end=' ') for v in vs: print(v, end=' ') print()
if domain<'bmail.com':
12
decision
from collections import defaultdict n = input() ans = {} anss = [] for i in range(int(n)): s = input() ss = s.split('@') login = ss[0].lower() domain = ss[1].lower() if domain == 'bmail.com': tlogin = login.split('+')[0] k = (tlogin.replace('.', ''),domain) if k not in ans: ans[k] = [s] anss.append(k) else: ans[k].append(s) else: k = (login, domain) if k not in ans: ans[k] = [s] anss.append(k) else: ans[k].append(s) print(len(anss)) for k in anss: vs = ans[k] print(len(vs), end=' ') for v in vs: print(v, end=' ') print()
from collections import defaultdict n = input() ans = {} anss = [] for i in range(int(n)): s = input() ss = s.split('@') login = ss[0].lower() domain = ss[19].lower() if domain == 'bmail.com': tlogin = login.split('+')[0] k = (tlogin.replace('.', ''),domain) if k not in ans: ans[k] = [s] anss.append(k) else: ans[k].append(s) else: k = (login, domain) if k not in ans: ans[k] = [s] anss.append(k) else: ans[k].append(s) print(len(anss)) for k in anss: vs = ans[k] print(len(vs), end=' ') for v in vs: print(v, end=' ') print()
domain = ss[19].lower()
10
value
len_t,len_b = input().split() t_array = list(map(int, input().split())) b_array = list(map(int, input().split())) for i in range(int(len_t)): t_array[i] = abs(t_array[i]) for i in range(int(len_b)): b_array[i] = abs(b_array[i]) t_array.sort() b_array.sort() print(t_array[-2]*b_array[-1])
len_t,len_b = input().split() t_array = list(map(int, input().split())) b_array = list(map(int, input().split())) for i in range(int(len_t)): t_array[i] = abs(t_array[i]) for i in range(int(len_b)): b_array[i] = abs(b_array[i]) t_array.sort() b_array.sort() print(t_array[-2]%b_array[-1])
print(t_array[-2]%b_array[-1])
11
operation
len_t,len_b = input().split() t_array = list(map(int, input().split())) b_array = list(map(int, input().split())) for i in range(int(len_t)): t_array[i] = abs(t_array[i]) for i in range(int(len_b)): b_array[i] = abs(b_array[i]) t_array.sort() b_array.sort() print(t_array[-2]*b_array[-1])
len_t,len_b = input().split() t_array = list(map(int, input().split())) b_array = list(map(int, input().split())) for i in range(int(len_t)): t_array[i] = abs(t_array[i]) for i in range(int(len_b)): b_array[i] = abs(b_array[i]) t_array.sort() b_array.sort() print(t_array[-99]*b_array[-1])
print(t_array[-99]*b_array[-1])
11
value
def rec(a, n, i, m, s, st, c): if i == n: if c and s % m == 0 or m - (s % m) in st: print("YES") exit(0) return rec(a, n, i+1, m, s + a[i], st, c+1) rec(a, n, i+1, m, s, st, c) n, m = [int(i) for i in input().split()] a = [int(i)%m for i in input().split()] st = set(a) if 0 in st: print("YES") else: rec(a, len(a), 1, m, a[0], st, 1) rec(a, len(a), 1, m, 0, st, 0) print("NO")
def rec(a, n, i, m, s, st, c): if i == n: if c and s+m == 0 or m - (s % m) in st: print("YES") exit(0) return rec(a, n, i+1, m, s + a[i], st, c+1) rec(a, n, i+1, m, s, st, c) n, m = [int(i) for i in input().split()] a = [int(i)%m for i in input().split()] st = set(a) if 0 in st: print("YES") else: rec(a, len(a), 1, m, a[0], st, 1) rec(a, len(a), 1, m, 0, st, 0) print("NO")
if c and s+m == 0 or m - (s % m) in st:
3
operation
def rec(a, n, i, m, s, st, c): if i == n: if c and s % m == 0 or m - (s % m) in st: print("YES") exit(0) return rec(a, n, i+1, m, s + a[i], st, c+1) rec(a, n, i+1, m, s, st, c) n, m = [int(i) for i in input().split()] a = [int(i)%m for i in input().split()] st = set(a) if 0 in st: print("YES") else: rec(a, len(a), 1, m, a[0], st, 1) rec(a, len(a), 1, m, 0, st, 0) print("NO")
def rec(a, n, i, m, s, st, c): if i<n: if c and s % m == 0 or m - (s % m) in st: print("YES") exit(0) return rec(a, n, i+1, m, s + a[i], st, c+1) rec(a, n, i+1, m, s, st, c) n, m = [int(i) for i in input().split()] a = [int(i)%m for i in input().split()] st = set(a) if 0 in st: print("YES") else: rec(a, len(a), 1, m, a[0], st, 1) rec(a, len(a), 1, m, 0, st, 0) print("NO")
if i<n:
2
decision
def rec(a, n, i, m, s, st, c): if i == n: if c and s % m == 0 or m - (s % m) in st: print("YES") exit(0) return rec(a, n, i+1, m, s + a[i], st, c+1) rec(a, n, i+1, m, s, st, c) n, m = [int(i) for i in input().split()] a = [int(i)%m for i in input().split()] st = set(a) if 0 in st: print("YES") else: rec(a, len(a), 1, m, a[0], st, 1) rec(a, len(a), 1, m, 0, st, 0) print("NO")
def rec(a, n, i, m, s, st, c): if i == n: if c and s % m == 0 or m**(s % m) in st: print("YES") exit(0) return rec(a, n, i+1, m, s + a[i], st, c+1) rec(a, n, i+1, m, s, st, c) n, m = [int(i) for i in input().split()] a = [int(i)%m for i in input().split()] st = set(a) if 0 in st: print("YES") else: rec(a, len(a), 1, m, a[0], st, 1) rec(a, len(a), 1, m, 0, st, 0) print("NO")
if c and s % m == 0 or m**(s % m) in st:
3
operation
def rec(a, n, i, m, s, st, c): if i == n: if c and s % m == 0 or m - (s % m) in st: print("YES") exit(0) return rec(a, n, i+1, m, s + a[i], st, c+1) rec(a, n, i+1, m, s, st, c) n, m = [int(i) for i in input().split()] a = [int(i)%m for i in input().split()] st = set(a) if 0 in st: print("YES") else: rec(a, len(a), 1, m, a[0], st, 1) rec(a, len(a), 1, m, 0, st, 0) print("NO")
def rec(a, n, i, m, s, st, c): if i == n: if c and s % m == 0 or m - (s/m) in st: print("YES") exit(0) return rec(a, n, i+1, m, s + a[i], st, c+1) rec(a, n, i+1, m, s, st, c) n, m = [int(i) for i in input().split()] a = [int(i)%m for i in input().split()] st = set(a) if 0 in st: print("YES") else: rec(a, len(a), 1, m, a[0], st, 1) rec(a, len(a), 1, m, 0, st, 0) print("NO")
if c and s % m == 0 or m - (s/m) in st:
3
operation
nick=input() nick=nick.upper() nick=nick.replace('1', 'I') nick=nick.replace('L', 'I') nick=nick.replace('0', 'O') s=len(nick) fl=True n=int(input()) for i in range(n): prev=input() prev=prev.upper() prev=prev.replace('1','I') prev=prev.replace('L','I') prev=prev.replace('0','O') if (prev==nick): fl=False if (fl==False): print('No') else: print("Yes")
nick=input() nick=nick.upper() nick=nick.replace('1', 'I') nick=nick.replace('L', 'I') nick=nick.replace('0', 'O') s=len(nick) fl=True n=int(input()) for i in range(n): prev=input() prev=prev.upper() prev=prev.replace('1','I') prev=prev.replace('L','I') prev=prev.replace('0','O') if (prev<nick): fl=False if (fl==False): print('No') else: print("Yes")
if (prev<nick):
15
decision
nick=input() nick=nick.upper() nick=nick.replace('1', 'I') nick=nick.replace('L', 'I') nick=nick.replace('0', 'O') s=len(nick) fl=True n=int(input()) for i in range(n): prev=input() prev=prev.upper() prev=prev.replace('1','I') prev=prev.replace('L','I') prev=prev.replace('0','O') if (prev==nick): fl=False if (fl==False): print('No') else: print("Yes")
nick=input() nick=nick.upper() nick=nick.replace('1', 'I') nick=nick.replace('L', 'I') nick=nick.replace('0', 'O') s=len(nick) fl=True n=int(input()) for i in range(n): prev=input() prev=prev.upper() prev=prev.replace('1','I') prev=prev.replace('L','I') prev=prev.replace('0','O') if (prev==nick): fl=False if (fl<False): print('No') else: print("Yes")
if (fl<False):
17
decision
nick=input() nick=nick.upper() nick=nick.replace('1', 'I') nick=nick.replace('L', 'I') nick=nick.replace('0', 'O') s=len(nick) fl=True n=int(input()) for i in range(n): prev=input() prev=prev.upper() prev=prev.replace('1','I') prev=prev.replace('L','I') prev=prev.replace('0','O') if (prev==nick): fl=False if (fl==False): print('No') else: print("Yes")
nick=input() nick=nick.upper() nick=nick.replace('1', 'I') nick=nick.replace('L', 'I') nick=nick.replace('0', 'O') s=len(nick) fl=True n=int(input()) for i in range(n): prev=input() prev=prev.upper() prev=prev.replace('1','I') prev=prev.replace('L','I') prev=prev.replace('0','O') if (prev<nick): fl=False if (fl==False): print('No') else: print("Yes")
if (prev<nick):
15
decision
nick=input() nick=nick.upper() nick=nick.replace('1', 'I') nick=nick.replace('L', 'I') nick=nick.replace('0', 'O') s=len(nick) fl=True n=int(input()) for i in range(n): prev=input() prev=prev.upper() prev=prev.replace('1','I') prev=prev.replace('L','I') prev=prev.replace('0','O') if (prev==nick): fl=False if (fl==False): print('No') else: print("Yes")
nick=input() nick=nick.upper() nick=nick.replace('1', 'I') nick=nick.replace('L', 'I') nick=nick.replace('0', 'O') s=len(nick) fl=True n=int(input()) for i in range(n): prev=input() prev=prev.upper() prev=prev.replace('1','I') prev=prev.replace('L','I') prev=prev.replace('0','O') if (prev<nick): fl=False if (fl==False): print('No') else: print("Yes")
if (prev<nick):
15
decision
""" moc = [4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196, 216, 225, 243, 256, 289, 324, 343, 361, 400, 441, 484, 512, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1000] pr = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997] x = moc+pr x = sorted(list(set(x))) print(x) """ x = [2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 36, 37, 41, 43, 47, 49, 53, 59, 61, 64, 67, 71, 73, 79, 81, 83, 89, 97, 100, 101, 103, 107, 109, 113, 121, 125, 127, 128, 131, 137, 139, 144, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 193, 196, 197, 199, 211, 216, 223, 225, 227, 229, 233, 239, 241, 243, 251, 256, 257, 263, 269, 271, 277, 281, 283, 289, 293, 307, 311, 313, 317, 324, 331, 337, 343, 347, 349, 353, 359, 361, 367, 373, 379, 383, 389, 397, 400, 401, 409, 419, 421, 431, 433, 439, 441, 443, 449, 457, 461, 463, 467, 479, 484, 487, 491, 499, 503, 509, 512, 521, 523, 529, 541, 547, 557, 563, 569, 571, 576, 577, 587, 593, 599, 601, 607, 613, 617, 619, 625, 631, 641, 643, 647, 653, 659, 661, 673, 676, 677, 683, 691, 701, 709, 719, 727, 729, 733, 739, 743, 751, 757, 761, 769, 773, 784, 787, 797, 809, 811, 821, 823, 827, 829, 839, 841, 853, 857, 859, 863, 877, 881, 883, 887, 900, 907, 911, 919, 929, 937, 941, 947, 953, 961, 967, 971, 977, 983, 991, 997, 1000] n = int(input()) kde = 0 for i in range(len(x)): if x[i] > n: kde = i break print(kde) print(*x[:kde])
""" moc = [4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196, 216, 225, 243, 256, 289, 324, 343, 361, 400, 441, 484, 512, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1000] pr = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997] x = moc+pr x = sorted(list(set(x))) print(x) """ x = [2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 36, 37, 41, 43, 47, 49, 53, 59, 61, 64, 67, 71, 73, 79, 81, 83, 89, 97, 100, 101, 103, 107, 109, 113, 121, 125, 127, 128, 131, 137, 139, 144, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 193, 196, 197, 199, 211, 216, 223, 225, 227, 229, 233, 239, 241, 243, 251, 256, 257, 263, 269, 271, 277, 281, 283, 289, 293, 307, 311, 313, 317, 324, 331, 337, 343, 347, 349, 353, 359, 361, 367, 373, 379, 383, 389, 397, 400, 401, 409, 419, 421, 431, 433, 439, 441, 443, 449, 457, 461, 463, 467, 479, 484, 487, 491, 499, 503, 509, 512, 521, 523, 529, 541, 547, 557, 563, 569, 571, 576, 577, 587, 593, 599, 601, 607, 613, 617, 619, 625, 631, 641, 643, 647, 653, 659, 661, 673, 676, 677, 683, 691, 701, 709, 719, 727, 729, 733, 739, 743, 751, 757, 761, 769, 773, 784, 787, 797, 809, 811, 821, 823, 827, 829, 839, 841, 853, 857, 859, 863, 877, 881, 883, 887, 900, 907, 911, 919, 929, 937, 941, 947, 953, 961, 967, 971, 977, 983, 991, 997, 1000] n = int(input()) kde = 0 for i in range(len(x)): if x[i] > n: z = i break print(kde) print(*x[:kde])
z = i
14
statement
""" moc = [4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196, 216, 225, 243, 256, 289, 324, 343, 361, 400, 441, 484, 512, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1000] pr = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997] x = moc+pr x = sorted(list(set(x))) print(x) """ x = [2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 36, 37, 41, 43, 47, 49, 53, 59, 61, 64, 67, 71, 73, 79, 81, 83, 89, 97, 100, 101, 103, 107, 109, 113, 121, 125, 127, 128, 131, 137, 139, 144, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 193, 196, 197, 199, 211, 216, 223, 225, 227, 229, 233, 239, 241, 243, 251, 256, 257, 263, 269, 271, 277, 281, 283, 289, 293, 307, 311, 313, 317, 324, 331, 337, 343, 347, 349, 353, 359, 361, 367, 373, 379, 383, 389, 397, 400, 401, 409, 419, 421, 431, 433, 439, 441, 443, 449, 457, 461, 463, 467, 479, 484, 487, 491, 499, 503, 509, 512, 521, 523, 529, 541, 547, 557, 563, 569, 571, 576, 577, 587, 593, 599, 601, 607, 613, 617, 619, 625, 631, 641, 643, 647, 653, 659, 661, 673, 676, 677, 683, 691, 701, 709, 719, 727, 729, 733, 739, 743, 751, 757, 761, 769, 773, 784, 787, 797, 809, 811, 821, 823, 827, 829, 839, 841, 853, 857, 859, 863, 877, 881, 883, 887, 900, 907, 911, 919, 929, 937, 941, 947, 953, 961, 967, 971, 977, 983, 991, 997, 1000] n = int(input()) kde = 0 for i in range(len(x)): if x[i] > n: kde = i break print(kde) print(*x[:kde])
""" moc = [4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196, 216, 225, 243, 256, 289, 324, 343, 361, 400, 441, 484, 512, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1000] pr = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997] x = moc+pr x = sorted(list(set(x))) print(x) """ x = [2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 36, 37, 41, 43, 47, 49, 53, 59, 61, 64, 67, 71, 73, 79, 81, 83, 89, 97, 100, 101, 103, 107, 109, 113, 121, 125, 127, 128, 131, 137, 139, 144, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 193, 196, 197, 199, 211, 216, 223, 225, 227, 229, 233, 239, 241, 243, 251, 256, 257, 263, 269, 271, 277, 281, 283, 289, 293, 307, 311, 313, 317, 324, 331, 337, 343, 347, 349, 353, 359, 361, 367, 373, 379, 383, 389, 397, 400, 401, 409, 419, 421, 431, 433, 439, 441, 443, 449, 457, 461, 463, 467, 479, 484, 487, 491, 499, 503, 509, 512, 521, 523, 529, 541, 547, 557, 563, 569, 571, 576, 577, 587, 593, 599, 601, 607, 613, 617, 619, 625, 631, 641, 643, 647, 653, 659, 661, 673, 676, 677, 683, 691, 701, 709, 719, 727, 729, 733, 739, 743, 751, 757, 761, 769, 773, 784, 787, 797, 809, 811, 821, 823, 827, 829, 839, 841, 853, 857, 859, 863, 877, 881, 883, 887, 900, 907, 911, 919, 929, 937, 941, 947, 953, 961, 967, 971, 977, 983, 991, 997, 1000] n = int(input()) kde = 0 for i in range(len(x)): if x[i]==n: kde = i break print(kde) print(*x[:kde])
if x[i]==n:
13
decision
""" moc = [4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196, 216, 225, 243, 256, 289, 324, 343, 361, 400, 441, 484, 512, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1000] pr = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997] x = moc+pr x = sorted(list(set(x))) print(x) """ x = [2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 36, 37, 41, 43, 47, 49, 53, 59, 61, 64, 67, 71, 73, 79, 81, 83, 89, 97, 100, 101, 103, 107, 109, 113, 121, 125, 127, 128, 131, 137, 139, 144, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 193, 196, 197, 199, 211, 216, 223, 225, 227, 229, 233, 239, 241, 243, 251, 256, 257, 263, 269, 271, 277, 281, 283, 289, 293, 307, 311, 313, 317, 324, 331, 337, 343, 347, 349, 353, 359, 361, 367, 373, 379, 383, 389, 397, 400, 401, 409, 419, 421, 431, 433, 439, 441, 443, 449, 457, 461, 463, 467, 479, 484, 487, 491, 499, 503, 509, 512, 521, 523, 529, 541, 547, 557, 563, 569, 571, 576, 577, 587, 593, 599, 601, 607, 613, 617, 619, 625, 631, 641, 643, 647, 653, 659, 661, 673, 676, 677, 683, 691, 701, 709, 719, 727, 729, 733, 739, 743, 751, 757, 761, 769, 773, 784, 787, 797, 809, 811, 821, 823, 827, 829, 839, 841, 853, 857, 859, 863, 877, 881, 883, 887, 900, 907, 911, 919, 929, 937, 941, 947, 953, 961, 967, 971, 977, 983, 991, 997, 1000] n = int(input()) kde = 0 for i in range(len(x)): if x[i] > n: kde = i break print(kde) print(*x[:kde])
""" moc = [4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196, 216, 225, 243, 256, 289, 324, 343, 361, 400, 441, 484, 512, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1000] pr = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997] x = moc+pr x = sorted(list(set(x))) print(x) """ x = [2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 36, 37, 41, 43, 47, 49, 53, 59, 61, 64, 67, 71, 73, 79, 81, 83, 89, 97, 100, 101, 103, 107, 109, 113, 121, 125, 127, 128, 131, 137, 139, 144, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 193, 196, 197, 199, 211, 216, 223, 225, 227, 229, 233, 239, 241, 243, 251, 256, 257, 263, 269, 271, 277, 281, 283, 289, 293, 307, 311, 313, 317, 324, 331, 337, 343, 347, 349, 353, 359, 361, 367, 373, 379, 383, 389, 397, 400, 401, 409, 419, 421, 431, 433, 439, 441, 443, 449, 457, 461, 463, 467, 479, 484, 487, 491, 499, 503, 509, 512, 521, 523, 529, 541, 547, 557, 563, 569, 571, 576, 577, 587, 593, 599, 601, 607, 613, 617, 619, 625, 631, 641, 643, 647, 653, 659, 661, 673, 676, 677, 683, 691, 701, 709, 719, 727, 729, 733, 739, 743, 751, 757, 761, 769, 773, 784, 787, 797, 809, 811, 821, 823, 827, 829, 839, 841, 853, 857, 859, 863, 877, 881, 883, 887, 900, 907, 911, 919, 929, 937, 941, 947, 953, 961, 967, 971, 977, 983, 991, 997, 1000] n = int(input()) kde = 0 for i in range(len(x)): if x[i]==n: kde = i break print(kde) print(*x[:kde])
if x[i]==n:
13
decision
x, y = [int(x) for x in input().split()] left = x - (y - 1) if y == 0: print("No") elif y == 1 and left > 0: print("No") elif left >= 0 and left % 2 == 0: print("Yes") else: print("No")
x, y = [int(x) for x in input().split()] left = x^(y - 1) if y == 0: print("No") elif y == 1 and left > 0: print("No") elif left >= 0 and left % 2 == 0: print("Yes") else: print("No")
left = x^(y - 1)
3
operation
x, y = [int(x) for x in input().split()] left = x - (y - 1) if y == 0: print("No") elif y == 1 and left > 0: print("No") elif left >= 0 and left % 2 == 0: print("Yes") else: print("No")
x, y = [int(x) for x in input().split()] left = x - (y - 1) if y<0: print("No") elif y == 1 and left > 0: print("No") elif left >= 0 and left % 2 == 0: print("Yes") else: print("No")
if y<0:
5
decision
x, y = [int(x) for x in input().split()] left = x - (y - 1) if y == 0: print("No") elif y == 1 and left > 0: print("No") elif left >= 0 and left % 2 == 0: print("Yes") else: print("No")
x, y = [int(x) for x in input().split()] left = x - (y - 1) if y == 0: print("No") elif y == 1 and left > 0: print("No") elif left<=0 and left % 2 == 0: print("Yes") else: print("No")
elif left<=0 and left % 2 == 0:
9
decision
x, y = [int(x) for x in input().split()] left = x - (y - 1) if y == 0: print("No") elif y == 1 and left > 0: print("No") elif left >= 0 and left % 2 == 0: print("Yes") else: print("No")
x, y = [int(x) for x in input().split()] left = x - (y - 1) if y == 0: print("No") elif y == 145 and left > 0: print("No") elif left >= 0 and left % 2 == 0: print("Yes") else: print("No")
elif y == 145 and left > 0:
7
value
n,k,x=map(int,input().split()) l=list(map(int,input().split())) nom=0 for i in range(n): if l[nom]<l[i]: nom=i for i in range(k): l[nom]*=x s=0 for x in l: s|=x print(s)
n,k,x=map(int,input().split()) l=list(map(int,input().split())) nom=0 for i in range(n): if l[nom]>l[i]: nom=i for i in range(k): l[nom]*=x s=0 for x in l: s|=x print(s)
if l[nom]>l[i]: nom=i
5
decision
n,k,x=map(int,input().split()) l=list(map(int,input().split())) nom=0 for i in range(n): if l[nom]<l[i]: nom=i for i in range(k): l[nom]*=x s=0 for x in l: s|=x print(s)
n,k,x=map(int,input().split()) l=list(map(int,input().split())) nom=0 for i in range(n): if l[nom]>l[i]: nom=i for i in range(k): l[nom]*=x s=0 for x in l: s|=x print(s)
if l[nom]>l[i]: nom=i
5
decision
n,k,x=map(int,input().split()) l=list(map(int,input().split())) nom=0 for i in range(n): if l[nom]<l[i]: nom=i for i in range(k): l[nom]*=x s=0 for x in l: s|=x print(s)
n,k,x=map(int,input().split()) l=list(map(int,input().split())) nom=0 for i in range(n): if l[nom]<l[i]: nom=i for i in range(k): l[nom]*=x s=164 for x in l: s|=x print(s)
s=164
8
value
n,k,x=map(int,input().split()) l=list(map(int,input().split())) nom=0 for i in range(n): if l[nom]<l[i]: nom=i for i in range(k): l[nom]*=x s=0 for x in l: s|=x print(s)
n,k,x=map(int,input().split()) l=list(map(int,z().split())) nom=0 for i in range(n): if l[nom]<l[i]: nom=i for i in range(k): l[nom]*=x s=0 for x in l: s|=x print(s)
l=list(map(int,z().split()))
2
statement
def run(mid, a): ans1 = 0; ans2 = 0; x = 0; y = 0; for val in a: if(x < 0): x = val - mid; else: x = x + (val - mid); if( ans1 < x ): ans1 = x; if(y < 0): y = mid - val; else: y = y + mid - val; if( ans2 < y ): ans2 = y; if( ans1 < 0 ): ans1 = - ans1; if( ans2 < 0 ): ans2 = - ans2; if( ans1 < ans2 ): return ans2; return ans1; n = map(int, input()); a = list(map(int, input().split())); eps = 1e-7; ans = 20000000000; lft = -10000; rht = 10000; while (lft + eps < rht): mid1 = 0.5 * (lft + rht); mid2 = 0.5 * (mid1 + rht); ans1 = run(mid1, a); ans2 = run(mid2, a); if ans1 <= ans2: ans = ans1; rht = mid2 - eps; else: ans = ans2; lft = mid1 + eps; print (ans);
def run(mid, a): ans1 = 0; ans2 = 0; x = 0; y = 8; for val in a: if(x < 0): x = val - mid; else: x = x + (val - mid); if( ans1 < x ): ans1 = x; if(y < 0): y = mid - val; else: y = y + mid - val; if( ans2 < y ): ans2 = y; if( ans1 < 0 ): ans1 = - ans1; if( ans2 < 0 ): ans2 = - ans2; if( ans1 < ans2 ): return ans2; return ans1; n = map(int, input()); a = list(map(int, input().split())); eps = 1e-7; ans = 20000000000; lft = -10000; rht = 10000; while (lft + eps < rht): mid1 = 0.5 * (lft + rht); mid2 = 0.5 * (mid1 + rht); ans1 = run(mid1, a); ans2 = run(mid2, a); if ans1 <= ans2: ans = ans1; rht = mid2 - eps; else: ans = ans2; lft = mid1 + eps; print (ans);
y = 8;
5
value
def run(mid, a): ans1 = 0; ans2 = 0; x = 0; y = 0; for val in a: if(x < 0): x = val - mid; else: x = x + (val - mid); if( ans1 < x ): ans1 = x; if(y < 0): y = mid - val; else: y = y + mid - val; if( ans2 < y ): ans2 = y; if( ans1 < 0 ): ans1 = - ans1; if( ans2 < 0 ): ans2 = - ans2; if( ans1 < ans2 ): return ans2; return ans1; n = map(int, input()); a = list(map(int, input().split())); eps = 1e-7; ans = 20000000000; lft = -10000; rht = 10000; while (lft + eps < rht): mid1 = 0.5 * (lft + rht); mid2 = 0.5 * (mid1 + rht); ans1 = run(mid1, a); ans2 = run(mid2, a); if ans1 <= ans2: ans = ans1; rht = mid2 - eps; else: ans = ans2; lft = mid1 + eps; print (ans);
def run(mid, a): ans1 = 0; ans2 = 0; x = 0; y = 0; for val in a: if(x < 0): x = val - mid; else: x = x + (val - mid); if( ans1 < x ): ans1 = x; if(y < 0): y = mid - val; else: y = y + mid - val; if( ans2 < y ): ans2 = y; if( ans1 < 0 ): ans1 = - ans1; if( ans2 < 0 ): ans2 = - ans2; if( ans1 < ans2 ): return ans2; return ans1; n = map(int, input()); a = list(map(int, input().split())); eps = 1e-7; ans = 20000000000; lft = -10000; rht = 10000; while (lft + eps < rht): mid1 = 0.5 * (lft + rht); mid2 = 0.5>>(mid1 + rht); ans1 = run(mid1, a); ans2 = run(mid2, a); if ans1 <= ans2: ans = ans1; rht = mid2 - eps; else: ans = ans2; lft = mid1 + eps; print (ans);
mid2 = 0.5>>(mid1 + rht);
35
operation
def run(mid, a): ans1 = 0; ans2 = 0; x = 0; y = 0; for val in a: if(x < 0): x = val - mid; else: x = x + (val - mid); if( ans1 < x ): ans1 = x; if(y < 0): y = mid - val; else: y = y + mid - val; if( ans2 < y ): ans2 = y; if( ans1 < 0 ): ans1 = - ans1; if( ans2 < 0 ): ans2 = - ans2; if( ans1 < ans2 ): return ans2; return ans1; n = map(int, input()); a = list(map(int, input().split())); eps = 1e-7; ans = 20000000000; lft = -10000; rht = 10000; while (lft + eps < rht): mid1 = 0.5 * (lft + rht); mid2 = 0.5 * (mid1 + rht); ans1 = run(mid1, a); ans2 = run(mid2, a); if ans1 <= ans2: ans = ans1; rht = mid2 - eps; else: ans = ans2; lft = mid1 + eps; print (ans);
def run(mid, a): ans1 = 0; ans2 = 0; x = 0; y = 0; for val in a: if(x < 0): x = val - mid; else: x = x + (val - mid); if( ans1 < x ): ans1 = x; if(y < 0): y = mid - val; else: y = y + mid - val; if( ans2 < y ): ans2 = y; if( ans1 < 0 ): ans1 = - ans1; if( ans2 < 0 ): ans2 = - ans2; if( ans1 < ans2 ): return ans2; return ans1; n = map(int, input()); a = list(map(int, input().split())); eps = 1e-7; ans = 20000000000; lft = -10000; rht = 10000; while (lft + eps < rht): mid1 = 0.5 * (lft%rht); mid2 = 0.5 * (mid1 + rht); ans1 = run(mid1, a); ans2 = run(mid2, a); if ans1 <= ans2: ans = ans1; rht = mid2 - eps; else: ans = ans2; lft = mid1 + eps; print (ans);
mid1 = 0.5 * (lft%rht);
34
operation