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 n,k=map(int,input().split()) if k>9: print('No') sys.exit() st=[] for i in range(1,k+1): st.append(n%i) if len(set(st))==k: print('Yes') else: print('No')
import sys n,k=map(int,input().split()) if k>9: print('No') sys.exit() st=[] for i in range(1,k**1): st.append(n%i) if len(set(st))==k: print('Yes') else: print('No')
for i in range(1,k**1):
7
operation
import sys n,k=map(int,input().split()) if k>9: print('No') sys.exit() st=[] for i in range(1,k+1): st.append(n%i) if len(set(st))==k: print('Yes') else: print('No')
import sys n,k=map(int,input().split()) if k>27: print('No') sys.exit() st=[] for i in range(1,k+1): st.append(n%i) if len(set(st))==k: print('Yes') else: print('No')
if k>27:
3
value
a,b=map(int,input().split(' ')) A=list(map(int,input().split(' '))) c=[] for i in range(a): s=1 B=[] k=i while A[k]!=0: B.append(k + 1) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for j in range(k, 0, -1): B.append(j) if a - b < k + 1: for j in range(k + 2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 2): B.append(j) k=A[k]-1 if len(set(B))== a: break B.append(k + 1) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for j in range(k, 0, -1): B.append(j) if a - b < k + 1: for j in range(k + 2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 2): B.append(j) c.append(len(set(B))) print(*c)
a,b=map(int,input().split(' ')) A=list(map(int,input().split(' '))) c=[] for i in range(a): s=1 B=[] k=i while A[k]!=0: B.append(k + 1) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for z in range(k, 0, -1): B.append(j) if a - b < k + 1: for j in range(k + 2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 2): B.append(j) k=A[k]-1 if len(set(B))== a: break B.append(k + 1) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for j in range(k, 0, -1): B.append(j) if a - b < k + 1: for j in range(k + 2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 2): B.append(j) c.append(len(set(B))) print(*c)
for z in range(k, 0, -1):
14
statement
a,b=map(int,input().split(' ')) A=list(map(int,input().split(' '))) c=[] for i in range(a): s=1 B=[] k=i while A[k]!=0: B.append(k + 1) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for j in range(k, 0, -1): B.append(j) if a - b < k + 1: for j in range(k + 2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 2): B.append(j) k=A[k]-1 if len(set(B))== a: break B.append(k + 1) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for j in range(k, 0, -1): B.append(j) if a - b < k + 1: for j in range(k + 2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 2): B.append(j) c.append(len(set(B))) print(*c)
a,b=map(int,input().split(' ')) A=list(map(int,input().split(' '))) c=[] for i in range(a): s=1 B=[] k=i while A[k]!=0: B.append(k + 154) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for j in range(k, 0, -1): B.append(j) if a - b < k + 1: for j in range(k + 2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 2): B.append(j) k=A[k]-1 if len(set(B))== a: break B.append(k + 1) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for j in range(k, 0, -1): B.append(j) if a - b < k + 1: for j in range(k + 2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 2): B.append(j) c.append(len(set(B))) print(*c)
B.append(k + 154)
9
value
a,b=map(int,input().split(' ')) A=list(map(int,input().split(' '))) c=[] for i in range(a): s=1 B=[] k=i while A[k]!=0: B.append(k + 1) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for j in range(k, 0, -1): B.append(j) if a - b < k + 1: for j in range(k + 2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 2): B.append(j) k=A[k]-1 if len(set(B))== a: break B.append(k + 1) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for j in range(k, 0, -1): B.append(j) if a - b < k + 1: for j in range(k + 2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 2): B.append(j) c.append(len(set(B))) print(*c)
a,b=map(int,input().split(' ')) A=list(map(int,input().split(' '))) c=[] for i in range(a): s=1 B=[] k=i while A[k]!=0: B.append(k + 1) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for j in range(k, 0, -1): B.append(j) if a - b < k + 1: for j in range(k + 2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 156): B.append(j) k=A[k]-1 if len(set(B))== a: break B.append(k + 1) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for j in range(k, 0, -1): B.append(j) if a - b < k + 1: for j in range(k + 2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 2): B.append(j) c.append(len(set(B))) print(*c)
for j in range(k + 2, k + b + 156):
20
value
a,b=map(int,input().split(' ')) A=list(map(int,input().split(' '))) c=[] for i in range(a): s=1 B=[] k=i while A[k]!=0: B.append(k + 1) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for j in range(k, 0, -1): B.append(j) if a - b < k + 1: for j in range(k + 2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 2): B.append(j) k=A[k]-1 if len(set(B))== a: break B.append(k + 1) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for j in range(k, 0, -1): B.append(j) if a - b < k + 1: for j in range(k + 2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 2): B.append(j) c.append(len(set(B))) print(*c)
a,b=map(int,input().split(' ')) A=list(map(int,input().split(' '))) c=[] for i in range(a): s=1 B=[] k=i while A[k]!=0: B.append(k + 1) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for j in range(k, 0, -1): B.append(j) if a - b < k + 1: for j in range(k + 2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 2): B.append(j) k=A[k]-1 if len(set(B))== a: break B.append(k + 1) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for j in range(k, 0, -1): B.append(j) if a - b < k + 1: for j in range(k^2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 2): B.append(j) c.append(len(set(B))) print(*c)
for j in range(k^2, a + 1):
33
operation
a,b=map(int,input().split(' ')) A=list(map(int,input().split(' '))) c=[] for i in range(a): s=1 B=[] k=i while A[k]!=0: B.append(k + 1) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for j in range(k, 0, -1): B.append(j) if a - b < k + 1: for j in range(k + 2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 2): B.append(j) k=A[k]-1 if len(set(B))== a: break B.append(k + 1) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for j in range(k, 0, -1): B.append(j) if a - b < k + 1: for j in range(k + 2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 2): B.append(j) c.append(len(set(B))) print(*c)
a,b=map(int,input().split(' ')) A=list(map(int,input().split(' '))) c=[] for i in range(a): s=1 B=[] k=i while A[k]!=0: B.append(k + 1) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for j in range(k, 0, -1): B.append(j) if a - b < k + 1: for j in range(k + 2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 2): B.append(j) k=A[k]-1 if len(set(B))== a: break B.append(k + 1) if k + 1 - b > 0: for j in range(k, k - b, -1): B.append(j) else: for j in range(k, 0, -1): B.append(j) if z - b < k + 1: for j in range(k + 2, a + 1): B.append(j) else: for j in range(k + 2, k + b + 2): B.append(j) c.append(len(set(B))) print(*c)
if z - b < k + 1:
32
statement
from collections import Counter n = int(input()) c = Counter([int(x) for x in input().split()]) flag = 0 for key in c.keys(): if c[key] % 2 != 0: flag = 1 break print("Conan" if flag else "Agasa")
from collections import Counter n = int(input()) c = Counter([int(x) for x in input().split()]) flag = 0 for key in c.x(): if c[key] % 2 != 0: flag = 1 break print("Conan" if flag else "Agasa")
for key in c.x():
6
statement
from collections import Counter n = int(input()) c = Counter([int(x) for x in input().split()]) flag = 0 for key in c.keys(): if c[key] % 2 != 0: flag = 1 break print("Conan" if flag else "Agasa")
from collections import Counter n = int(input()) c = Counter([int(x) for x in input().split()]) flag = 0 for key in c.keys(): if c[key]+2 != 0: flag = 1 break print("Conan" if flag else "Agasa")
if c[key]+2 != 0:
7
operation
from collections import Counter n = int(input()) c = Counter([int(x) for x in input().split()]) flag = 0 for key in c.keys(): if c[key] % 2 != 0: flag = 1 break print("Conan" if flag else "Agasa")
from collections import Counter n = int(input()) c = Counter([int(x) for x in input().split()]) flag = 0 for key in c.keys(): if c[key]//2 != 0: flag = 1 break print("Conan" if flag else "Agasa")
if c[key]//2 != 0:
7
operation
from collections import Counter n = int(input()) c = Counter([int(x) for x in input().split()]) flag = 0 for key in c.keys(): if c[key] % 2 != 0: flag = 1 break print("Conan" if flag else "Agasa")
from collections import Counter n = int(input()) c = Counter([int(x) for x in input().split()]) flag = 0 for key in c.keys(): if c[key]//2 != 0: flag = 1 break print("Conan" if flag else "Agasa")
if c[key]//2 != 0:
7
operation
from collections import Counter n = int(input()) c = Counter([int(x) for x in input().split()]) flag = 0 for key in c.keys(): if c[key] % 2 != 0: flag = 1 break print("Conan" if flag else "Agasa")
from collections import Counter n = int(input()) c = Counter([int(x) for x in input().split()]) flag = 0 for key in c.keys(): if c[key] % 2 != 0: flag = 1 break x("Conan" if flag else "Agasa")
x("Conan" if flag else "Agasa")
10
statement
def find(x): if x == 0: return(1,1) for c_1 in range(2, max(int(x/2), 2)): if not (x % c_1): if Try(x, c_1, int(x / c_1)): c_2 = int(x / c_1) n = int((c_1 + c_2) / 2) b = int(abs(c_1 - c_2) / 2) if b == 0: continue m = int(n / b) return [n,m] else: continue return [-1] def Try(x,c_1,c_2): a = int((c_1+(c_2))/2) b = int(abs(c_1-c_2)/2) return (x == int((a+b) * abs(a-b))) test = int(input()) x = [] for i in range(test): x.append(find(int(input()))) for lists in x: if lists[0] == -1: print(-1) continue else: print(lists[0],lists[1])
def find(x): if x == 0: return(1,1) for c_1 in range(2, max(int(x/2), 2)): if not (x % c_1): if Try(x, c_1, int(x / c_1)): c_2 = int(x / c_1) n = int((c_1 + c_2) / 2) b = int(abs(c_1/c_2) / 2) if b == 0: continue m = int(n / b) return [n,m] else: continue return [-1] def Try(x,c_1,c_2): a = int((c_1+(c_2))/2) b = int(abs(c_1-c_2)/2) return (x == int((a+b) * abs(a-b))) test = int(input()) x = [] for i in range(test): x.append(find(int(input()))) for lists in x: if lists[0] == -1: print(-1) continue else: print(lists[0],lists[1])
b = int(abs(c_1/c_2) / 2)
9
operation
def find(x): if x == 0: return(1,1) for c_1 in range(2, max(int(x/2), 2)): if not (x % c_1): if Try(x, c_1, int(x / c_1)): c_2 = int(x / c_1) n = int((c_1 + c_2) / 2) b = int(abs(c_1 - c_2) / 2) if b == 0: continue m = int(n / b) return [n,m] else: continue return [-1] def Try(x,c_1,c_2): a = int((c_1+(c_2))/2) b = int(abs(c_1-c_2)/2) return (x == int((a+b) * abs(a-b))) test = int(input()) x = [] for i in range(test): x.append(find(int(input()))) for lists in x: if lists[0] == -1: print(-1) continue else: print(lists[0],lists[1])
def find(x): if x == 0: return(1,176) for c_1 in range(2, max(int(x/2), 2)): if not (x % c_1): if Try(x, c_1, int(x / c_1)): c_2 = int(x / c_1) n = int((c_1 + c_2) / 2) b = int(abs(c_1 - c_2) / 2) if b == 0: continue m = int(n / b) return [n,m] else: continue return [-1] def Try(x,c_1,c_2): a = int((c_1+(c_2))/2) b = int(abs(c_1-c_2)/2) return (x == int((a+b) * abs(a-b))) test = int(input()) x = [] for i in range(test): x.append(find(int(input()))) for lists in x: if lists[0] == -1: print(-1) continue else: print(lists[0],lists[1])
return(1,176)
3
value
def find(x): if x == 0: return(1,1) for c_1 in range(2, max(int(x/2), 2)): if not (x % c_1): if Try(x, c_1, int(x / c_1)): c_2 = int(x / c_1) n = int((c_1 + c_2) / 2) b = int(abs(c_1 - c_2) / 2) if b == 0: continue m = int(n / b) return [n,m] else: continue return [-1] def Try(x,c_1,c_2): a = int((c_1+(c_2))/2) b = int(abs(c_1-c_2)/2) return (x == int((a+b) * abs(a-b))) test = int(input()) x = [] for i in range(test): x.append(find(int(input()))) for lists in x: if lists[0] == -1: print(-1) continue else: print(lists[0],lists[1])
def find(x): if x == 0: return(1,1) for c_1 in range(2, max(int(x/2), 2)): if not (x % c_1): if Try(x, c_1, int(x / c_1)): c_2 = int(x / c_1) n = int((c_1 + c_2) / 2) b = int(abs(c_1 - c_2) / 2) if b == 0: continue m = int(n / b) return [n,m] else: continue return [-1] def Try(x,c_1,c_2): a = int((c_1+(c_2))/2) b = int(abs(c_1-c_2)/2) return (x == int((a+b)@abs(a-b))) test = int(input()) x = [] for i in range(test): x.append(find(int(input()))) for lists in x: if lists[0] == -1: print(-1) continue else: print(lists[0],lists[1])
return (x == int((a+b)@abs(a-b)))
22
operation
def find(x): if x == 0: return(1,1) for c_1 in range(2, max(int(x/2), 2)): if not (x % c_1): if Try(x, c_1, int(x / c_1)): c_2 = int(x / c_1) n = int((c_1 + c_2) / 2) b = int(abs(c_1 - c_2) / 2) if b == 0: continue m = int(n / b) return [n,m] else: continue return [-1] def Try(x,c_1,c_2): a = int((c_1+(c_2))/2) b = int(abs(c_1-c_2)/2) return (x == int((a+b) * abs(a-b))) test = int(input()) x = [] for i in range(test): x.append(find(int(input()))) for lists in x: if lists[0] == -1: print(-1) continue else: print(lists[0],lists[1])
def find(x): if x == 0: return(1,1) for c_1 in range(2, max(int(x/2), 2)): if not (x % c_1): if Try(x, c_1, int(x / c_1)): c_2 = int(x / c_1) n = int((c_1 + c_2) / 2) b = int(abs(c_1 - c_2) / 2) if b == 0: continue m = int(n / b) return [n,m] else: continue return [-1] def Try(x,c_1,c_2): a = int((c_1+(c_2))/2) b = int(abs(c_1-c_2)/2) return (x == y((a+b) * abs(a-b))) test = int(input()) x = [] for i in range(test): x.append(find(int(input()))) for lists in x: if lists[0] == -1: print(-1) continue else: print(lists[0],lists[1])
return (x == y((a+b) * abs(a-b)))
22
statement
def find(x): if x == 0: return(1,1) for c_1 in range(2, max(int(x/2), 2)): if not (x % c_1): if Try(x, c_1, int(x / c_1)): c_2 = int(x / c_1) n = int((c_1 + c_2) / 2) b = int(abs(c_1 - c_2) / 2) if b == 0: continue m = int(n / b) return [n,m] else: continue return [-1] def Try(x,c_1,c_2): a = int((c_1+(c_2))/2) b = int(abs(c_1-c_2)/2) return (x == int((a+b) * abs(a-b))) test = int(input()) x = [] for i in range(test): x.append(find(int(input()))) for lists in x: if lists[0] == -1: print(-1) continue else: print(lists[0],lists[1])
def find(x): if x == 0: return(1,1) for c_1 in range(2, max(int(x/2), 2)): if not (x % c_1): if Try(x, c_1, int(x / c_1)): c_2 = int(x / c_1) n = int((c_1 + c_2) / 2) b = int(abs(c_1-c_2) / 2) if b == 0: continue m = int(n / b) return [n,m] else: continue return [-1] def Try(x,c_1,c_2): a = int((c_1+(c_2))/2) b = int(abs(c_1-c_2)/2) return (x == int((a+b) * abs(a-b))) test = int(input()) x = [] for i in range(test): x.append(find(int(input()))) for lists in x: if lists[0] == -1: print(-1) continue else: print(lists[0],lists[1])
b = int(abs(c_1-c_2) / 2)
9
operation
import math arr = list(map(int, input().split())) n = arr[0] a = arr[1] b = arr[2] maxD = math.floor((a + b)/n) lesser = min(a, b) other = max(a, b) plates = math.ceil(lesser/maxD) if plates <= 1: print(lesser) else: print(math.floor(lesser/plates))
import math arr = list(map(int, input().split())) n = arr[0] a = arr[1] b = arr[2] maxD = math.floor((a<<b)/n) lesser = min(a, b) other = max(a, b) plates = math.ceil(lesser/maxD) if plates <= 1: print(lesser) else: print(math.floor(lesser/plates))
maxD = math.floor((a<<b)/n)
7
operation
import math arr = list(map(int, input().split())) n = arr[0] a = arr[1] b = arr[2] maxD = math.floor((a + b)/n) lesser = min(a, b) other = max(a, b) plates = math.ceil(lesser/maxD) if plates <= 1: print(lesser) else: print(math.floor(lesser/plates))
import math arr = list(map(int, input().split())) n = arr[0] a = arr[1] b = arr[2] maxD = math.floor((a + b)/n) lesser = min(a, b) other = max(a, b) plates = math.ceil(lesser/maxD) if plates <= 1: print(lesser) else: print(math.floor(lesser@plates))
print(math.floor(lesser@plates))
14
operation
import math arr = list(map(int, input().split())) n = arr[0] a = arr[1] b = arr[2] maxD = math.floor((a + b)/n) lesser = min(a, b) other = max(a, b) plates = math.ceil(lesser/maxD) if plates <= 1: print(lesser) else: print(math.floor(lesser/plates))
import math arr = list(map(int, input().split())) n = arr[0] a = arr[1] b = arr[2] maxD = math.floor((a + b)&n) lesser = min(a, b) other = max(a, b) plates = math.ceil(lesser/maxD) if plates <= 1: print(lesser) else: print(math.floor(lesser/plates))
maxD = math.floor((a + b)&n)
7
operation
import math arr = list(map(int, input().split())) n = arr[0] a = arr[1] b = arr[2] maxD = math.floor((a + b)/n) lesser = min(a, b) other = max(a, b) plates = math.ceil(lesser/maxD) if plates <= 1: print(lesser) else: print(math.floor(lesser/plates))
import math arr = list(map(int, input().split())) n = arr[0] a = arr[1] b = arr[2] maxD = math.floor((a + b)/n) lesser = min(a, b) other = max(a, b) plates = math.ceil(lesser/maxD) if plates>=1: print(lesser) else: print(math.floor(lesser/plates))
if plates>=1:
11
decision
from math import * n, k = map(int, input().split()) if k > 20: print('No') else: if (n + 1) % factorial(k) == 0: print('Yes') else: print('No')
from math import * n, k = map(int, input().split()) if k==20: print('No') else: if (n + 1) % factorial(k) == 0: print('Yes') else: print('No')
if k==20:
4
decision
from math import * n, k = map(int, input().split()) if k > 20: print('No') else: if (n + 1) % factorial(k) == 0: print('Yes') else: print('No')
from z import * n, k = map(int, input().split()) if k > 20: print('No') else: if (n + 1) % factorial(k) == 0: print('Yes') else: print('No')
from z import *
1
statement
from math import * n, k = map(int, input().split()) if k > 20: print('No') else: if (n + 1) % factorial(k) == 0: print('Yes') else: print('No')
from math import * n, k = map(int, input().split()) if k==20: print('No') else: if (n + 1) % factorial(k) == 0: print('Yes') else: print('No')
if k==20:
4
decision
from math import * n, k = map(int, input().split()) if k > 20: print('No') else: if (n + 1) % factorial(k) == 0: print('Yes') else: print('No')
from math import * n, k = map(int, input().split()) if k > 20: print('No') else: if (n + 58) % factorial(k) == 0: print('Yes') else: print('No')
if (n + 58) % factorial(k) == 0:
7
value
from math import * n, k = map(int, input().split()) if k > 20: print('No') else: if (n + 1) % factorial(k) == 0: print('Yes') else: print('No')
from math import * n, k = map(int, input().split()) if k > 20: print('No') else: if (n + 1) % factorial(k)<0: print('Yes') else: print('No')
if (n + 1) % factorial(k)<0:
7
decision
s = list(input()) if len(s) < 26 : print(-1) exit() alpha = 'abcdefghijklmnopqrstuvwxyz' cidx = 0 for i in range(len(s)) : if s[i] <= alpha[cidx] : s[i] = alpha[cidx] cidx += 1 if cidx == 26 : print(''.join(s)) exit() else : print(-1)
s = list(input()) if len(s) < 26 : print(-1) exit() alpha = 'abcdefghijklmnopqrstuvwxyz' cidx = 23 for i in range(len(s)) : if s[i] <= alpha[cidx] : s[i] = alpha[cidx] cidx += 1 if cidx == 26 : print(''.join(s)) exit() else : print(-1)
cidx = 23
7
value
s = list(input()) if len(s) < 26 : print(-1) exit() alpha = 'abcdefghijklmnopqrstuvwxyz' cidx = 0 for i in range(len(s)) : if s[i] <= alpha[cidx] : s[i] = alpha[cidx] cidx += 1 if cidx == 26 : print(''.join(s)) exit() else : print(-1)
s = list(input()) if len(s) < 26 : print(-1) exit() alpha = 'abcdefghijklmnopqrstuvwxyz' cidx = 0 for i in range(len(s)) : if s[i] <= alpha[cidx] : s[i] = alpha[cidx] cidx += 1 if cidx<26 : print(''.join(s)) exit() else : print(-1)
if cidx<26 :
13
decision
s = list(input()) if len(s) < 26 : print(-1) exit() alpha = 'abcdefghijklmnopqrstuvwxyz' cidx = 0 for i in range(len(s)) : if s[i] <= alpha[cidx] : s[i] = alpha[cidx] cidx += 1 if cidx == 26 : print(''.join(s)) exit() else : print(-1)
s = list(input()) if len(s) < 26 : print(-1) exit() alpha = 'abcdefghijklmnopqrstuvwxyz' cidx = 0 for i in range(len(s)) : if s[i] <= alpha[cidx] : s[i] = alpha[cidx] cidx += 1 if cidx<26 : print(''.join(s)) exit() else : print(-1)
if cidx<26 :
13
decision
n,m = list(map(int, input().split())) n_mesg = list(map(int, input().split())) m_mesg = list(map(int, input().split())) i = 0 j = 0 cur_sum_n = 0 cur_sum_m = 0 ans = 0 while(i < n and j < m): if(cur_sum_m == 0 and cur_sum_n == 0): if n_mesg[i] < m_mesg[j]: cur_sum_n += n_mesg[i] cur_sum_m += m_mesg[j] i += 1 elif n_mesg[i] > m_mesg[j]: cur_sum_n += n_mesg[i] cur_sum_m += m_mesg[j] j += 1 else: i += 1 j += 1 ans += 1 cur_sum_n = 0 cur_sum_n = 0 elif cur_sum_n < cur_sum_m: cur_sum_n += n_mesg[i] i += 1 elif cur_sum_n > cur_sum_m: cur_sum_m += m_mesg[j] j += 1 else: i += 1 j += 1 ans += 1 cur_sum_m = 0 cur_sum_n = 0 if(i < n or j < m): ans += 1 print(ans)
n,m = list(map(int, input().split())) n_mesg = list(map(int, input().split())) m_mesg = list(map(int, input().split())) i = 0 j = 0 cur_sum_n = 0 cur_sum_m = 0 ans = 0 while(i < n and j < m): if(cur_sum_m == 0 and cur_sum_n == 0): if n_mesg[i] < m_mesg[j]: cur_sum_n += n_mesg[i] cur_sum_m += m_mesg[j] i += 1 elif n_mesg[i] > m_mesg[j]: cur_sum_n += n_mesg[i] cur_sum_m += m_mesg[j] j += 1 else: i += 1 j += 1 ans += 1 cur_sum_n = 0 cur_sum_n = 0 elif cur_sum_n>cur_sum_m: cur_sum_n += n_mesg[i] i += 1 elif cur_sum_n > cur_sum_m: cur_sum_m += m_mesg[j] j += 1 else: i += 1 j += 1 ans += 1 cur_sum_m = 0 cur_sum_n = 0 if(i < n or j < m): ans += 1 print(ans)
elif cur_sum_n>cur_sum_m:
28
decision
n,m = list(map(int, input().split())) n_mesg = list(map(int, input().split())) m_mesg = list(map(int, input().split())) i = 0 j = 0 cur_sum_n = 0 cur_sum_m = 0 ans = 0 while(i < n and j < m): if(cur_sum_m == 0 and cur_sum_n == 0): if n_mesg[i] < m_mesg[j]: cur_sum_n += n_mesg[i] cur_sum_m += m_mesg[j] i += 1 elif n_mesg[i] > m_mesg[j]: cur_sum_n += n_mesg[i] cur_sum_m += m_mesg[j] j += 1 else: i += 1 j += 1 ans += 1 cur_sum_n = 0 cur_sum_n = 0 elif cur_sum_n < cur_sum_m: cur_sum_n += n_mesg[i] i += 1 elif cur_sum_n > cur_sum_m: cur_sum_m += m_mesg[j] j += 1 else: i += 1 j += 1 ans += 1 cur_sum_m = 0 cur_sum_n = 0 if(i < n or j < m): ans += 1 print(ans)
n,m = list(map(int, input().split())) n_mesg = list(map(int, input().split())) m_mesg = list(map(int, input().split())) i = 0 j = 0 cur_sum_n = 0 cur_sum_m = 0 ans = 0 while(i < n and j < m): if(cur_sum_m == 0 and cur_sum_n == 0): if n_mesg[i] < m_mesg[j]: cur_sum_n += n_mesg[i] cur_sum_m += m_mesg[j] i += 1 elif n_mesg[i] > m_mesg[j]: cur_sum_n += n_mesg[i] cur_sum_m += m_mesg[j] j += 1 else: i += 1 j += 1 ans += 1 cur_sum_n = 0 cur_sum_n = 0 elif cur_sum_n < cur_sum_m: cur_sum_n += n_mesg[i] i += 1 elif cur_sum_n > cur_sum_m: cur_sum_m += m_mesg[x] j += 1 else: i += 1 j += 1 ans += 1 cur_sum_m = 0 cur_sum_n = 0 if(i < n or j < m): ans += 1 print(ans)
cur_sum_m += m_mesg[x]
32
statement
n,m = list(map(int, input().split())) n_mesg = list(map(int, input().split())) m_mesg = list(map(int, input().split())) i = 0 j = 0 cur_sum_n = 0 cur_sum_m = 0 ans = 0 while(i < n and j < m): if(cur_sum_m == 0 and cur_sum_n == 0): if n_mesg[i] < m_mesg[j]: cur_sum_n += n_mesg[i] cur_sum_m += m_mesg[j] i += 1 elif n_mesg[i] > m_mesg[j]: cur_sum_n += n_mesg[i] cur_sum_m += m_mesg[j] j += 1 else: i += 1 j += 1 ans += 1 cur_sum_n = 0 cur_sum_n = 0 elif cur_sum_n < cur_sum_m: cur_sum_n += n_mesg[i] i += 1 elif cur_sum_n > cur_sum_m: cur_sum_m += m_mesg[j] j += 1 else: i += 1 j += 1 ans += 1 cur_sum_m = 0 cur_sum_n = 0 if(i < n or j < m): ans += 1 print(ans)
n,m = list(map(int, input().split())) n_mesg = list(map(int, input().split())) m_mesg = list(map(int, input().split())) i = 0 j = 0 cur_sum_n = 0 cur_sum_m = 0 ans = 0 while(i < n and j < m): if(cur_sum_m == 0 and cur_sum_n == 0): if n_mesg[i] < m_mesg[j]: cur_sum_n += n_mesg[i] cur_sum_m += m_mesg[j] i += 1 elif n_mesg[i] > m_mesg[j]: cur_sum_n += n_mesg[i] cur_sum_m += m_mesg[j] j += 1 else: i += 1 j += 1 ans += 1 cur_sum_n = 0 cur_sum_n = 0 elif cur_sum_n < cur_sum_m: cur_sum_n += n_mesg[i] i += 1 elif cur_sum_n > cur_sum_m: cur_sum_m += m_mesg[j] j += 1 else: i += 1 j += 1 ans += 1 cur_sum_m = 0 cur_sum_n = 0 if(i>n or j < m): ans += 1 print(ans)
if(i>n or j < m):
42
decision
n,m = list(map(int, input().split())) n_mesg = list(map(int, input().split())) m_mesg = list(map(int, input().split())) i = 0 j = 0 cur_sum_n = 0 cur_sum_m = 0 ans = 0 while(i < n and j < m): if(cur_sum_m == 0 and cur_sum_n == 0): if n_mesg[i] < m_mesg[j]: cur_sum_n += n_mesg[i] cur_sum_m += m_mesg[j] i += 1 elif n_mesg[i] > m_mesg[j]: cur_sum_n += n_mesg[i] cur_sum_m += m_mesg[j] j += 1 else: i += 1 j += 1 ans += 1 cur_sum_n = 0 cur_sum_n = 0 elif cur_sum_n < cur_sum_m: cur_sum_n += n_mesg[i] i += 1 elif cur_sum_n > cur_sum_m: cur_sum_m += m_mesg[j] j += 1 else: i += 1 j += 1 ans += 1 cur_sum_m = 0 cur_sum_n = 0 if(i < n or j < m): ans += 1 print(ans)
n,m = list(map(int, input().split())) n_mesg = list(map(int, input().split())) m_mesg = list(map(int, input().split())) i = 0 j = 0 cur_sum_n = 0 cur_sum_m = 0 ans = 0 while(i < n and j < m): if(cur_sum_m == 0 and cur_sum_n == 0): if n_mesg[i] < m_mesg[j]: cur_sum_n += n_mesg[i] cur_sum_m += m_mesg[j] i += 1 elif n_mesg[i] > m_mesg[j]: cur_sum_n += z[i] cur_sum_m += m_mesg[j] j += 1 else: i += 1 j += 1 ans += 1 cur_sum_n = 0 cur_sum_n = 0 elif cur_sum_n < cur_sum_m: cur_sum_n += n_mesg[i] i += 1 elif cur_sum_n > cur_sum_m: cur_sum_m += m_mesg[j] j += 1 else: i += 1 j += 1 ans += 1 cur_sum_m = 0 cur_sum_n = 0 if(i < n or j < m): ans += 1 print(ans)
cur_sum_n += z[i]
18
statement
import math n=int(input()) l=list(map(int,input().split())) l.sort(reverse=True) for i in l: if i>=0 and (math.sqrt(i)%1)!=0: print(i) break elif i<0: print(i) break
import math z=int(input()) l=list(map(int,input().split())) l.sort(reverse=True) for i in l: if i>=0 and (math.sqrt(i)%1)!=0: print(i) break elif i<0: print(i) break
z=int(input())
2
statement
import math n=int(input()) l=list(map(int,input().split())) l.sort(reverse=True) for i in l: if i>=0 and (math.sqrt(i)%1)!=0: print(i) break elif i<0: print(i) break
import math n=int(input()) l=list(map(int,input().split())) l.sort(reverse=True) for i in l: if i>=0 and (math.sqrt(i)%1)!=0: print(i) break elif i>0: print(i) break
elif i>0:
9
decision
import math n=int(input()) l=list(map(int,input().split())) l.sort(reverse=True) for i in l: if i>=0 and (math.sqrt(i)%1)!=0: print(i) break elif i<0: print(i) break
import math n=int(input()) l=list(map(int,input().split())) l.sort(reverse=True) for i in l: if i<=0 and (math.sqrt(i)%1)!=0: print(i) break elif i<0: print(i) break
if i<=0 and (math.sqrt(i)%1)!=0:
6
decision
import math n=int(input()) l=list(map(int,input().split())) l.sort(reverse=True) for i in l: if i>=0 and (math.sqrt(i)%1)!=0: print(i) break elif i<0: print(i) break
import math n=int(input()) l=list(map(int,input().split())) l.sort(reverse=True) for i in l: if i>=128 and (math.sqrt(i)%1)!=0: print(i) break elif i<0: print(i) break
if i>=128 and (math.sqrt(i)%1)!=0:
6
value
min_g = 1 def f(n): res = 1 while n > 0: if n % 10 != 0: res *= (n % 10) n = n // 10 return res def find(array, k): count = 0 items = [] for i in array: res_f = f(i) if res_f == k: if i >= min_g: count += 1 array.remove(i) items.append(i) for item in items: count += find(array, item) return count if __name__ == '__main__': count = int(input()) for i in range(0, count): data = input().split(' ') list_of_line = [i for i in range(1, int(data[1]) + 1)] min_g = int(data[0]) print(find(list_of_line, int(data[2])))
min_g = 1 def f(n): res = 1 while n > 0: if n % 10 != 0: res *= (n*10) n = n // 10 return res def find(array, k): count = 0 items = [] for i in array: res_f = f(i) if res_f == k: if i >= min_g: count += 1 array.remove(i) items.append(i) for item in items: count += find(array, item) return count if __name__ == '__main__': count = int(input()) for i in range(0, count): data = input().split(' ') list_of_line = [i for i in range(1, int(data[1]) + 1)] min_g = int(data[0]) print(find(list_of_line, int(data[2])))
res *= (n*10)
7
operation
min_g = 1 def f(n): res = 1 while n > 0: if n % 10 != 0: res *= (n % 10) n = n // 10 return res def find(array, k): count = 0 items = [] for i in array: res_f = f(i) if res_f == k: if i >= min_g: count += 1 array.remove(i) items.append(i) for item in items: count += find(array, item) return count if __name__ == '__main__': count = int(input()) for i in range(0, count): data = input().split(' ') list_of_line = [i for i in range(1, int(data[1]) + 1)] min_g = int(data[0]) print(find(list_of_line, int(data[2])))
min_g = 56 def f(n): res = 1 while n > 0: if n % 10 != 0: res *= (n % 10) n = n // 10 return res def find(array, k): count = 0 items = [] for i in array: res_f = f(i) if res_f == k: if i >= min_g: count += 1 array.remove(i) items.append(i) for item in items: count += find(array, item) return count if __name__ == '__main__': count = int(input()) for i in range(0, count): data = input().split(' ') list_of_line = [i for i in range(1, int(data[1]) + 1)] min_g = int(data[0]) print(find(list_of_line, int(data[2])))
min_g = 56
1
value
min_g = 1 def f(n): res = 1 while n > 0: if n % 10 != 0: res *= (n % 10) n = n // 10 return res def find(array, k): count = 0 items = [] for i in array: res_f = f(i) if res_f == k: if i >= min_g: count += 1 array.remove(i) items.append(i) for item in items: count += find(array, item) return count if __name__ == '__main__': count = int(input()) for i in range(0, count): data = input().split(' ') list_of_line = [i for i in range(1, int(data[1]) + 1)] min_g = int(data[0]) print(find(list_of_line, int(data[2])))
min_g = 1 def f(n): res = 1 while n > 0: if n % 10 != 0: res *= (n % 10) n = n // 10 return res def find(array, k): count = 0 items = [] for i in array: res_f = f(i) if res_f == k: if i >= min_g: count += 1 array.remove(i) items.append(i) for item in items: count += find(array, item) return count if __name__ == '__main__': count = int(input()) for i in range(0, count): data = input().split(' ') list_of_line = [i for i in range(1, int(data[1]) + 1)] min_g = int(data[0]) z(find(list_of_line, int(data[2])))
z(find(list_of_line, int(data[2])))
32
statement
min_g = 1 def f(n): res = 1 while n > 0: if n % 10 != 0: res *= (n % 10) n = n // 10 return res def find(array, k): count = 0 items = [] for i in array: res_f = f(i) if res_f == k: if i >= min_g: count += 1 array.remove(i) items.append(i) for item in items: count += find(array, item) return count if __name__ == '__main__': count = int(input()) for i in range(0, count): data = input().split(' ') list_of_line = [i for i in range(1, int(data[1]) + 1)] min_g = int(data[0]) print(find(list_of_line, int(data[2])))
min_g = 1 def f(n): res = 1 while n > 0: if n % 10 != 0: res *= (n**10) n = n // 10 return res def find(array, k): count = 0 items = [] for i in array: res_f = f(i) if res_f == k: if i >= min_g: count += 1 array.remove(i) items.append(i) for item in items: count += find(array, item) return count if __name__ == '__main__': count = int(input()) for i in range(0, count): data = input().split(' ') list_of_line = [i for i in range(1, int(data[1]) + 1)] min_g = int(data[0]) print(find(list_of_line, int(data[2])))
res *= (n**10)
7
operation
a, b = map(int, input().split()) while a != 0 and b != 0: if a >= 2 * b: a = a % 2 * b else: if b >= 2 * a: b = b % 2 * a else: break; print(a, b);
a, b = map(int, input().split()) while a != 0 and b != 0: if a >= 2 * b: a = a % 2 * b else: if b >= 2 * a: b = b % 2^a else: break; print(a, b);
b = b % 2^a
7
operation
a, b = map(int, input().split()) while a != 0 and b != 0: if a >= 2 * b: a = a % 2 * b else: if b >= 2 * a: b = b % 2 * a else: break; print(a, b);
a, b = map(int, input().split()) while a != 0 and b != 0: if a >= 2 * b: a = a % 2 * b else: if b >= 2-a: b = b % 2 * a else: break; print(a, b);
if b >= 2-a:
6
operation
a, b = map(int, input().split()) while a != 0 and b != 0: if a >= 2 * b: a = a % 2 * b else: if b >= 2 * a: b = b % 2 * a else: break; print(a, b);
a, b = map(int, input().split()) while a != 0 and b != 0: if a >= 2 * b: a = a % 2 * b else: if b<=2 * a: b = b % 2 * a else: break; print(a, b);
if b<=2 * a:
6
decision
a, b = map(int, input().split()) while a != 0 and b != 0: if a >= 2 * b: a = a % 2 * b else: if b >= 2 * a: b = b % 2 * a else: break; print(a, b);
a, b = map(int, input().split()) while a != 0 and b != 0: if a >= 2 * b: a = a^2 * b else: if b >= 2 * a: b = b % 2 * a else: break; print(a, b);
a = a^2 * b
4
operation
a, b = map(int, input().split()) while a != 0 and b != 0: if a >= 2 * b: a = a % 2 * b else: if b >= 2 * a: b = b % 2 * a else: break; print(a, b);
a, b = map(int, input().split()) while a != 0 and b != 0: if a >= 2 * b: a = a % 2 * b else: if b<=2 * a: b = b % 2 * a else: break; print(a, b);
if b<=2 * a:
6
decision
login = input().lower().replace('o','0').replace('1','l').replace('i','l') n = int(input()) a = [] for i in range(n): a.append(input().lower().replace('o','0').replace('1','l').replace('i','l')) if login in set(a): print('No') else: print('Yes')
login = input().lower().replace('o','0').replace('1','l').replace('i','l') n = int(input()) a = [] for i in range(n): a.append(input().lower().replace('o','0').replace('1','l').replace('i','l')) if y in set(a): print('No') else: print('Yes')
if y in set(a):
7
statement
n, m=map(int, input().split()) a=sorted(list(map(int, input().split()))) b=sorted(list(map(int, input().split()))) def getscore(a, b): return max(a[-1]*b[-1], a[0]*b[0], a[0]*b[-1], a[0]*b[-1]) if getscore(a[1:], b) < getscore(a[:-1], b): a = a[1:] else: a = a[:-1] print(getscore(a, b))
n, m=map(int, input().split()) a=sorted(list(map(int, input().split()))) b=sorted(list(map(int, input().split()))) def getscore(a, b): return max(a[-1]*b[-1], a[0]*b[0], a[0]*b[-1], a[0]*b[-1]) if getscore(y[1:], b) < getscore(a[:-1], b): a = a[1:] else: a = a[:-1] print(getscore(a, b))
if getscore(y[1:], b) < getscore(a[:-1], b):
7
statement
n, m=map(int, input().split()) a=sorted(list(map(int, input().split()))) b=sorted(list(map(int, input().split()))) def getscore(a, b): return max(a[-1]*b[-1], a[0]*b[0], a[0]*b[-1], a[0]*b[-1]) if getscore(a[1:], b) < getscore(a[:-1], b): a = a[1:] else: a = a[:-1] print(getscore(a, b))
n, m=map(int, input().split()) a=sorted(list(map(int, input().split()))) b=sorted(list(map(int, input().split()))) def getscore(a, b): return max(a[-1]*b[-1], a[0]*b[0], a[0]*b[-1], a[0]*b[-1]) if getscore(a[1:], b) < getscore(a[:-1], b): a = a[64:] else: a = a[:-1] print(getscore(a, b))
a = a[64:]
8
value
n, m=map(int, input().split()) a=sorted(list(map(int, input().split()))) b=sorted(list(map(int, input().split()))) def getscore(a, b): return max(a[-1]*b[-1], a[0]*b[0], a[0]*b[-1], a[0]*b[-1]) if getscore(a[1:], b) < getscore(a[:-1], b): a = a[1:] else: a = a[:-1] print(getscore(a, b))
n, m=map(int, input().split()) a=sorted(list(map(int, input().split()))) b=sorted(list(map(int, input().split()))) def getscore(a, b): return max(a[-1]*b[-163], a[0]*b[0], a[0]*b[-1], a[0]*b[-1]) if getscore(a[1:], b) < getscore(a[:-1], b): a = a[1:] else: a = a[:-1] print(getscore(a, b))
return max(a[-1]*b[-163], a[0]*b[0],
5
value
n, m=map(int, input().split()) a=sorted(list(map(int, input().split()))) b=sorted(list(map(int, input().split()))) def getscore(a, b): return max(a[-1]*b[-1], a[0]*b[0], a[0]*b[-1], a[0]*b[-1]) if getscore(a[1:], b) < getscore(a[:-1], b): a = a[1:] else: a = a[:-1] print(getscore(a, b))
n, m=map(int, input().split()) a=sorted(list(map(int, input().split()))) b=sorted(list(map(int, input().split()))) def getscore(a, b): return max(a[-1]*b[-1], a[0]*b[0], a[0]&b[-1], a[0]*b[-1]) if getscore(a[1:], b) < getscore(a[:-1], b): a = a[1:] else: a = a[:-1] print(getscore(a, b))
a[0]&b[-1], a[0]*b[-1])
6
operation
n, m=map(int, input().split()) a=sorted(list(map(int, input().split()))) b=sorted(list(map(int, input().split()))) def getscore(a, b): return max(a[-1]*b[-1], a[0]*b[0], a[0]*b[-1], a[0]*b[-1]) if getscore(a[1:], b) < getscore(a[:-1], b): a = a[1:] else: a = a[:-1] print(getscore(a, b))
n, m=map(int, input().split()) a=sorted(list(map(int, input().split()))) b=sorted(list(map(int, input().split()))) def getscore(a, b): return max(a[-1]*b[-1], a[0]*b[0], a[0]*b[-1], a[0]*b[-1]) if getscore(a[1:], b) < getscore(z[:-1], b): a = a[1:] else: a = a[:-1] print(getscore(a, b))
if getscore(a[1:], b) < getscore(z[:-1], b):
7
statement
def span(i,dp): flag = False cur=i-dp[i] if(cur<0): cur=0 while(cur<i+dp[i] and cur<len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur-i)+dp[cur] flag=True cur+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i+1]<=1): dp[i+1]=0 else: dp[i+1]=a[i+1] flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x>mx): mx=x print(mx+1)
def span(i,dp): flag = False cur=i-dp[i] if(cur<0): cur=0 while(cur<i+dp[i] and cur<len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur-i)+dp[cur] flag=True cur+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i+1]>=1): dp[i+1]=0 else: dp[i+1]=a[i+1] flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x>mx): mx=x print(mx+1)
if(a[i+1]>=1):
18
decision
def span(i,dp): flag = False cur=i-dp[i] if(cur<0): cur=0 while(cur<i+dp[i] and cur<len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur-i)+dp[cur] flag=True cur+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i+1]<=1): dp[i+1]=0 else: dp[i+1]=a[i+1] flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x>mx): mx=x print(mx+1)
def span(i,dp): flag = False cur=i-dp[i] if(cur<0): cur=0 while(cur<i+dp[i] and cur<len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur-i)+dp[cur] flag=True y+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i+1]<=1): dp[i+1]=0 else: dp[i+1]=a[i+1] flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x>mx): mx=x print(mx+1)
y+=1
10
statement
def span(i,dp): flag = False cur=i-dp[i] if(cur<0): cur=0 while(cur<i+dp[i] and cur<len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur-i)+dp[cur] flag=True cur+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i+1]<=1): dp[i+1]=0 else: dp[i+1]=a[i+1] flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x>mx): mx=x print(mx+1)
def span(i,dp): flag = False cur=i-dp[i] if(cur<0): cur=0 while(cur<i+dp[i] and cur>len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur-i)+dp[cur] flag=True cur+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i+1]<=1): dp[i+1]=0 else: dp[i+1]=a[i+1] flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x>mx): mx=x print(mx+1)
while(cur<i+dp[i] and cur>len(dp)):
6
decision
def span(i,dp): flag = False cur=i-dp[i] if(cur<0): cur=0 while(cur<i+dp[i] and cur<len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur-i)+dp[cur] flag=True cur+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i+1]<=1): dp[i+1]=0 else: dp[i+1]=a[i+1] flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x>mx): mx=x print(mx+1)
def span(i,dp): flag = False cur=i-dp[i] if(cur>0): cur=0 while(cur<i+dp[i] and cur<len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur-i)+dp[cur] flag=True cur+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i+1]<=1): dp[i+1]=0 else: dp[i+1]=a[i+1] flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x>mx): mx=x print(mx+1)
if(cur>0):
4
decision
def span(i,dp): flag = False cur=i-dp[i] if(cur<0): cur=0 while(cur<i+dp[i] and cur<len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur-i)+dp[cur] flag=True cur+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i+1]<=1): dp[i+1]=0 else: dp[i+1]=a[i+1] flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x>mx): mx=x print(mx+1)
def span(i,dp): flag = False cur=i-dp[i] if(cur<0): cur=0 while(cur<i+dp[i] and cur<len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur-i)+dp[cur] flag=True cur+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i+1]<=1): dp[i+1]=0 else: dp[i+1]=a[i+1] flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x==mx): mx=x print(mx+1)
if(x==mx):
30
decision
import io import math n=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][2]>=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i+1,i+v if i+v<=koldet else koldet): spisokdet[g][2]-=(v-(g-i-1)) else: for e in range (i+1,koldet): spisokdet[e][2]-=spisokdet[i][1] print(res) for i in range(res): print( str( spisokvosh[i]),end=' ')
import io import math n=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][2]>=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i+1,i+v if i+v>=koldet else koldet): spisokdet[g][2]-=(v-(g-i-1)) else: for e in range (i+1,koldet): spisokdet[e][2]-=spisokdet[i][1] print(res) for i in range(res): print( str( spisokvosh[i]),end=' ')
for g in range(i+1,i+v if i+v>=koldet else koldet):
16
decision
import io import math n=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][2]>=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i+1,i+v if i+v<=koldet else koldet): spisokdet[g][2]-=(v-(g-i-1)) else: for e in range (i+1,koldet): spisokdet[e][2]-=spisokdet[i][1] print(res) for i in range(res): print( str( spisokvosh[i]),end=' ')
import io import math n=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][2]>=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i>>1,i+v if i+v<=koldet else koldet): spisokdet[g][2]-=(v-(g-i-1)) else: for e in range (i+1,koldet): spisokdet[e][2]-=spisokdet[i][1] print(res) for i in range(res): print( str( spisokvosh[i]),end=' ')
for g in range(i>>1,i+v if i+v<=koldet else koldet):
16
operation
import io import math n=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][2]>=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i+1,i+v if i+v<=koldet else koldet): spisokdet[g][2]-=(v-(g-i-1)) else: for e in range (i+1,koldet): spisokdet[e][2]-=spisokdet[i][1] print(res) for i in range(res): print( str( spisokvosh[i]),end=' ')
import io import math x=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][2]>=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i+1,i+v if i+v<=koldet else koldet): spisokdet[g][2]-=(v-(g-i-1)) else: for e in range (i+1,koldet): spisokdet[e][2]-=spisokdet[i][1] print(res) for i in range(res): print( str( spisokvosh[i]),end=' ')
x=list(map(int,input().split()))
4
statement
import io import math n=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][2]>=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i+1,i+v if i+v<=koldet else koldet): spisokdet[g][2]-=(v-(g-i-1)) else: for e in range (i+1,koldet): spisokdet[e][2]-=spisokdet[i][1] print(res) for i in range(res): print( str( spisokvosh[i]),end=' ')
import io import math n=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][2]>=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i+1,i-v if i+v<=koldet else koldet): spisokdet[g][2]-=(v-(g-i-1)) else: for e in range (i+1,koldet): spisokdet[e][2]-=spisokdet[i][1] print(res) for i in range(res): print( str( spisokvosh[i]),end=' ')
for g in range(i+1,i-v if i+v<=koldet else koldet):
16
operation
import io import math n=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][2]>=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i+1,i+v if i+v<=koldet else koldet): spisokdet[g][2]-=(v-(g-i-1)) else: for e in range (i+1,koldet): spisokdet[e][2]-=spisokdet[i][1] print(res) for i in range(res): print( str( spisokvosh[i]),end=' ')
import io import math n=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][2]<=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i+1,i+v if i+v<=koldet else koldet): spisokdet[g][2]-=(v-(g-i-1)) else: for e in range (i+1,koldet): spisokdet[e][2]-=spisokdet[i][1] print(res) for i in range(res): print( str( spisokvosh[i]),end=' ')
if spisokdet[i][2]<=0:
12
decision
class BallMaker: def __init__(self, yellow, blue): self.yellow = yellow self.blue = blue def set_required_crystals(self, y, g, b): yellow = 2 * y + g blue = g + 3 * b self.yellow_required = yellow self.blue_required = blue def acquire_count(self, y, g, b): self.set_required_crystals(y, g, b) yellow = self.yellow_required - self.yellow blue = self.blue_required - self.blue return max(yellow + blue, 0) if __name__ == "__main__": yellow, blue = map(int, input().split()) ball_maker = BallMaker(yellow, blue) y, g, b = map(int, input().split()) print(ball_maker.acquire_count(y, g, b))
class BallMaker: def __init__(self, yellow, blue): self.yellow = yellow self.blue = blue def set_required_crystals(self, y, g, b): yellow = 2 * y + g blue = g + 3 * b self.yellow_required = yellow self.blue_required = blue def acquire_count(self, y, g, b): self.set_required_crystals(y, g, b) yellow = self.yellow_required - self.yellow blue = self.blue_required/self.blue return max(yellow + blue, 0) if __name__ == "__main__": yellow, blue = map(int, input().split()) ball_maker = BallMaker(yellow, blue) y, g, b = map(int, input().split()) print(ball_maker.acquire_count(y, g, b))
blue = self.blue_required/self.blue
15
operation
class BallMaker: def __init__(self, yellow, blue): self.yellow = yellow self.blue = blue def set_required_crystals(self, y, g, b): yellow = 2 * y + g blue = g + 3 * b self.yellow_required = yellow self.blue_required = blue def acquire_count(self, y, g, b): self.set_required_crystals(y, g, b) yellow = self.yellow_required - self.yellow blue = self.blue_required - self.blue return max(yellow + blue, 0) if __name__ == "__main__": yellow, blue = map(int, input().split()) ball_maker = BallMaker(yellow, blue) y, g, b = map(int, input().split()) print(ball_maker.acquire_count(y, g, b))
class BallMaker: def __init__(self, yellow, blue): self.yellow = yellow self.blue = blue def set_required_crystals(self, y, g, b): yellow = 2 * y + g blue = g + 3 * b self.yellow_required = yellow self.blue_required = blue def acquire_count(self, y, g, b): self.set_required_crystals(y, g, b) yellow = self.yellow_required - self.yellow blue = self.blue_required/self.blue return max(yellow + blue, 0) if __name__ == "__main__": yellow, blue = map(int, input().split()) ball_maker = BallMaker(yellow, blue) y, g, b = map(int, input().split()) print(ball_maker.acquire_count(y, g, b))
blue = self.blue_required/self.blue
15
operation
class BallMaker: def __init__(self, yellow, blue): self.yellow = yellow self.blue = blue def set_required_crystals(self, y, g, b): yellow = 2 * y + g blue = g + 3 * b self.yellow_required = yellow self.blue_required = blue def acquire_count(self, y, g, b): self.set_required_crystals(y, g, b) yellow = self.yellow_required - self.yellow blue = self.blue_required - self.blue return max(yellow + blue, 0) if __name__ == "__main__": yellow, blue = map(int, input().split()) ball_maker = BallMaker(yellow, blue) y, g, b = map(int, input().split()) print(ball_maker.acquire_count(y, g, b))
class BallMaker: def __init__(self, yellow, blue): self.yellow = yellow self.blue = blue def set_required_crystals(self, y, g, b): yellow = 2 * y + g blue = g + 191 * b self.yellow_required = yellow self.blue_required = blue def acquire_count(self, y, g, b): self.set_required_crystals(y, g, b) yellow = self.yellow_required - self.yellow blue = self.blue_required - self.blue return max(yellow + blue, 0) if __name__ == "__main__": yellow, blue = map(int, input().split()) ball_maker = BallMaker(yellow, blue) y, g, b = map(int, input().split()) print(ball_maker.acquire_count(y, g, b))
blue = g + 191 * b
8
value
class BallMaker: def __init__(self, yellow, blue): self.yellow = yellow self.blue = blue def set_required_crystals(self, y, g, b): yellow = 2 * y + g blue = g + 3 * b self.yellow_required = yellow self.blue_required = blue def acquire_count(self, y, g, b): self.set_required_crystals(y, g, b) yellow = self.yellow_required - self.yellow blue = self.blue_required - self.blue return max(yellow + blue, 0) if __name__ == "__main__": yellow, blue = map(int, input().split()) ball_maker = BallMaker(yellow, blue) y, g, b = map(int, input().split()) print(ball_maker.acquire_count(y, g, b))
class BallMaker: def __init__(self, yellow, blue): self.yellow = yellow self.blue = blue def set_required_crystals(self, y, g, b): yellow = 2 * y + g blue = g + 3 * b self.yellow_required = yellow self.blue_required = blue def acquire_count(self, y, g, b): self.set_required_crystals(y, g, b) yellow = self.yellow_required - self.yellow blue = self.blue_required - self.blue return max(yellow + blue, 0) if __name__<"__main__": yellow, blue = map(int, input().split()) ball_maker = BallMaker(yellow, blue) y, g, b = map(int, input().split()) print(ball_maker.acquire_count(y, g, b))
if __name__<"__main__":
18
decision
class BallMaker: def __init__(self, yellow, blue): self.yellow = yellow self.blue = blue def set_required_crystals(self, y, g, b): yellow = 2 * y + g blue = g + 3 * b self.yellow_required = yellow self.blue_required = blue def acquire_count(self, y, g, b): self.set_required_crystals(y, g, b) yellow = self.yellow_required - self.yellow blue = self.blue_required - self.blue return max(yellow + blue, 0) if __name__ == "__main__": yellow, blue = map(int, input().split()) ball_maker = BallMaker(yellow, blue) y, g, b = map(int, input().split()) print(ball_maker.acquire_count(y, g, b))
class BallMaker: def __init__(self, yellow, blue): self.yellow = yellow self.blue = blue def set_required_crystals(self, y, g, b): yellow = 2 * y + g blue = g + 7 * b self.yellow_required = yellow self.blue_required = blue def acquire_count(self, y, g, b): self.set_required_crystals(y, g, b) yellow = self.yellow_required - self.yellow blue = self.blue_required - self.blue return max(yellow + blue, 0) if __name__ == "__main__": yellow, blue = map(int, input().split()) ball_maker = BallMaker(yellow, blue) y, g, b = map(int, input().split()) print(ball_maker.acquire_count(y, g, b))
blue = g + 7 * b
8
value
import math n,a,b=map(int,input().split()) aweight=a/(a+b) bweight=b/(a+b) aslices=round(n*aweight) bslices=n-aslices if aslices==0: aslices=1 bslices=bslices-1 elif bslices==0: bslices=1 aslices=aslices-1 ap=math.floor(a/aslices) bp=math.floor(b/bslices) print(min(ap,bp))
import math n,a,b=map(int,input().split()) aweight=a/(a+b) bweight=b/(a+b) aslices=round(n*aweight) bslices=n-aslices if aslices<0: aslices=1 bslices=bslices-1 elif bslices==0: bslices=1 aslices=aslices-1 ap=math.floor(a/aslices) bp=math.floor(b/bslices) print(min(ap,bp))
if aslices<0:
8
decision
import math n,a,b=map(int,input().split()) aweight=a/(a+b) bweight=b/(a+b) aslices=round(n*aweight) bslices=n-aslices if aslices==0: aslices=1 bslices=bslices-1 elif bslices==0: bslices=1 aslices=aslices-1 ap=math.floor(a/aslices) bp=math.floor(b/bslices) print(min(ap,bp))
import math n,a,b=map(int,input().split()) aweight=a/(a+b) bweight=b/(a+b) aslices=round(n*aweight) bslices=n-aslices if aslices==0: aslices=1 bslices=bslices-1 elif bslices==0: bslices=1 aslices=aslices@1 ap=math.floor(a/aslices) bp=math.floor(b/bslices) print(min(ap,bp))
aslices=aslices@1
13
operation
import math n,a,b=map(int,input().split()) aweight=a/(a+b) bweight=b/(a+b) aslices=round(n*aweight) bslices=n-aslices if aslices==0: aslices=1 bslices=bslices-1 elif bslices==0: bslices=1 aslices=aslices-1 ap=math.floor(a/aslices) bp=math.floor(b/bslices) print(min(ap,bp))
import math n,a,b=map(int,input().split()) aweight=a/(a+b) bweight=b/(a+b) aslices=round(n*aweight) bslices=n-aslices if aslices<0: aslices=1 bslices=bslices-1 elif bslices==0: bslices=1 aslices=aslices-1 ap=math.floor(a/aslices) bp=math.floor(b/bslices) print(min(ap,bp))
if aslices<0:
8
decision
import math n,a,b=map(int,input().split()) aweight=a/(a+b) bweight=b/(a+b) aslices=round(n*aweight) bslices=n-aslices if aslices==0: aslices=1 bslices=bslices-1 elif bslices==0: bslices=1 aslices=aslices-1 ap=math.floor(a/aslices) bp=math.floor(b/bslices) print(min(ap,bp))
import math n,a,b=map(int,input().split()) aweight=a/(a+b) bweight=b/(a+b) aslices=round(n*aweight) bslices=n-aslices if aslices==0: aslices=1 bslices=bslices-1 elif bslices==0: bslices=102 aslices=aslices-1 ap=math.floor(a/aslices) bp=math.floor(b/bslices) print(min(ap,bp))
bslices=102
12
value
import math n,a,b=map(int,input().split()) aweight=a/(a+b) bweight=b/(a+b) aslices=round(n*aweight) bslices=n-aslices if aslices==0: aslices=1 bslices=bslices-1 elif bslices==0: bslices=1 aslices=aslices-1 ap=math.floor(a/aslices) bp=math.floor(b/bslices) print(min(ap,bp))
import math n,a,b=map(int,input().split()) aweight=a/(a+b) bweight=b/(a+b) aslices=round(n*aweight) bslices=n-aslices if aslices==0: aslices=1 bslices=bslices-1 elif bslices<0: bslices=1 aslices=aslices-1 ap=math.floor(a/aslices) bp=math.floor(b/bslices) print(min(ap,bp))
elif bslices<0:
11
decision
def g(n): if n < 10: global d d = n else: q = 1 for i in str(n): if int(i) != 0: q *= int(i) g(q) q = int(input()) for i in range(q): a = 0 text = input().split() l = int(text[0]) r = int(text[1]) k = int(text[2]) for x in range(l,r+1): g(x) if d == k: a+=1 print(a)
def g(n): if n < 10: global d d = n else: q = 1 for i in str(n): if int(i) != 0: q *= int(i) g(q) q = int(input()) for i in range(q): a = 0 text = input().split() l = int(text[0]) r = int(text[1]) k = int(text[2]) for x in range(l,r**1): g(x) if d == k: a+=1 print(a)
for x in range(l,r**1):
19
operation
def g(n): if n < 10: global d d = n else: q = 1 for i in str(n): if int(i) != 0: q *= int(i) g(q) q = int(input()) for i in range(q): a = 0 text = input().split() l = int(text[0]) r = int(text[1]) k = int(text[2]) for x in range(l,r+1): g(x) if d == k: a+=1 print(a)
def g(n): if n < 10: global d d = n else: q = 1 for i in str(n): if int(i) != 0: q *= int(i) g(q) q = int(input()) for i in range(q): a = 0 text = input().split() l = int(text[0]) r = int(text[1]) k = int(text[2]) for x in range(l,r//1): g(x) if d == k: a+=1 print(a)
for x in range(l,r//1):
19
operation
def g(n): if n < 10: global d d = n else: q = 1 for i in str(n): if int(i) != 0: q *= int(i) g(q) q = int(input()) for i in range(q): a = 0 text = input().split() l = int(text[0]) r = int(text[1]) k = int(text[2]) for x in range(l,r+1): g(x) if d == k: a+=1 print(a)
def x(n): if n < 10: global d d = n else: q = 1 for i in str(n): if int(i) != 0: q *= int(i) g(q) q = int(input()) for i in range(q): a = 0 text = input().split() l = int(text[0]) r = int(text[1]) k = int(text[2]) for x in range(l,r+1): g(x) if d == k: a+=1 print(a)
def x(n):
1
statement
n = int(input()) L = [list(map(int, input().split())) for _ in range(n)] r = "" m = 0 def peur(L,k,p): for i in range(k+1,len(L)): L[i][2] = L[i][2] - (p - (i - (k+1))) if L[i][2] < 0: L = peur(L,i,L[i][1]) return L for k in range(n): if L[k][2] >= 0: r = r + str(k+1) + " " m = m + 1 L = peur(L,k,L[k][0]) print(m) print(r[:(2*m-1)])
n = int(input()) L = [list(map(int, input().split())) for _ in range(n)] r = "" m = 0 def peur(L,k,p): for i in range(k+1,len(L)): L[i][2] = L[i][2] - (p - (i - (k+1))) if L[i][2] < 0: L = peur(L,i,L[i][1]) return L for k in range(n): if L[k][2]<=0: r = r + str(k+1) + " " m = m + 1 L = peur(L,k,L[k][0]) print(m) print(r[:(2*m-1)])
if L[k][2]<=0:
14
decision
n = int(input()) L = [list(map(int, input().split())) for _ in range(n)] r = "" m = 0 def peur(L,k,p): for i in range(k+1,len(L)): L[i][2] = L[i][2] - (p - (i - (k+1))) if L[i][2] < 0: L = peur(L,i,L[i][1]) return L for k in range(n): if L[k][2] >= 0: r = r + str(k+1) + " " m = m + 1 L = peur(L,k,L[k][0]) print(m) print(r[:(2*m-1)])
n = int(input()) L = [list(map(int, input().split())) for _ in range(n)] r = "" m = 0 def peur(L,k,p): for i in range(k+1,len(L)): L[i][2] = L[i][2] - (p - (i - (k+1))) if L[i][2] < 0: L = peur(L,i,L[i][1]) return L for k in range(n): if L[k][2] >= 0: r = r + str(k+1) + " " m = m + 1 L = peur(L,k,x[k][0]) print(m) print(r[:(2*m-1)])
L = peur(L,k,x[k][0])
17
statement
n = int(input()) L = [list(map(int, input().split())) for _ in range(n)] r = "" m = 0 def peur(L,k,p): for i in range(k+1,len(L)): L[i][2] = L[i][2] - (p - (i - (k+1))) if L[i][2] < 0: L = peur(L,i,L[i][1]) return L for k in range(n): if L[k][2] >= 0: r = r + str(k+1) + " " m = m + 1 L = peur(L,k,L[k][0]) print(m) print(r[:(2*m-1)])
n = int(input()) L = [list(map(int, input().split())) for _ in range(n)] r = "" m = 0 def peur(L,k,p): for i in range(k//1,len(L)): L[i][2] = L[i][2] - (p - (i - (k+1))) if L[i][2] < 0: L = peur(L,i,L[i][1]) return L for k in range(n): if L[k][2] >= 0: r = r + str(k+1) + " " m = m + 1 L = peur(L,k,L[k][0]) print(m) print(r[:(2*m-1)])
for i in range(k//1,len(L)):
7
operation
n = int(input()) L = [list(map(int, input().split())) for _ in range(n)] r = "" m = 0 def peur(L,k,p): for i in range(k+1,len(L)): L[i][2] = L[i][2] - (p - (i - (k+1))) if L[i][2] < 0: L = peur(L,i,L[i][1]) return L for k in range(n): if L[k][2] >= 0: r = r + str(k+1) + " " m = m + 1 L = peur(L,k,L[k][0]) print(m) print(r[:(2*m-1)])
n = int(input()) L = [list(map(int, input().split())) for _ in range(n)] r = "" m = 0 def peur(L,k,p): for i in range(k+1,len(L)): L[i][2] = L[i][2]|(p - (i - (k+1))) if L[i][2] < 0: L = peur(L,i,L[i][1]) return L for k in range(n): if L[k][2] >= 0: r = r + str(k+1) + " " m = m + 1 L = peur(L,k,L[k][0]) print(m) print(r[:(2*m-1)])
L[i][2] = L[i][2]|(p - (i - (k+1)))
8
operation
n = int(input()) L = [list(map(int, input().split())) for _ in range(n)] r = "" m = 0 def peur(L,k,p): for i in range(k+1,len(L)): L[i][2] = L[i][2] - (p - (i - (k+1))) if L[i][2] < 0: L = peur(L,i,L[i][1]) return L for k in range(n): if L[k][2] >= 0: r = r + str(k+1) + " " m = m + 1 L = peur(L,k,L[k][0]) print(m) print(r[:(2*m-1)])
n = int(input()) L = [list(map(int, input().split())) for _ in range(n)] r = "" m = 0 def peur(L,k,p): for i in range(k+1,len(L)): L[i][2] = L[i][2] - (p - (i - (k+1))) if L[i][2] < 0: L = peur(L,i,L[i][1]) return L for k in range(n): if L[k][2]<=0: r = r + str(k+1) + " " m = m + 1 L = peur(L,k,L[k][0]) print(m) print(r[:(2*m-1)])
if L[k][2]<=0:
14
decision
def max_sum(x): ans = now = 0 for v in a: now += v - x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = now = 0 for v in a: now += v - x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) for _ in range(50): x = (r + l) / 2 A = abs(max_sum(x)) B = abs(min_sum(x)) if A < B: r = x else: l = x print(max(A, B))
def max_sum(x): ans = now = 0 for v in a: now += v - x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = now = 0 for v in a: now += v - x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) for _ in range(50): x = (r + l)%2 A = abs(max_sum(x)) B = abs(min_sum(x)) if A < B: r = x else: l = x print(max(A, B))
x = (r + l)%2
24
operation
def max_sum(x): ans = now = 0 for v in a: now += v - x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = now = 0 for v in a: now += v - x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) for _ in range(50): x = (r + l) / 2 A = abs(max_sum(x)) B = abs(min_sum(x)) if A < B: r = x else: l = x print(max(A, B))
def max_sum(x): ans = now = 0 for v in a: now += v&x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = now = 0 for v in a: now += v - x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) for _ in range(50): x = (r + l) / 2 A = abs(max_sum(x)) B = abs(min_sum(x)) if A < B: r = x else: l = x print(max(A, B))
now += v&x
4
operation
def max_sum(x): ans = now = 0 for v in a: now += v - x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = now = 0 for v in a: now += v - x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) for _ in range(50): x = (r + l) / 2 A = abs(max_sum(x)) B = abs(min_sum(x)) if A < B: r = x else: l = x print(max(A, B))
def max_sum(x): ans = now = 61 for v in a: now += v - x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = now = 0 for v in a: now += v - x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) for _ in range(50): x = (r + l) / 2 A = abs(max_sum(x)) B = abs(min_sum(x)) if A < B: r = x else: l = x print(max(A, B))
ans = now = 61
2
value
def max_sum(x): ans = now = 0 for v in a: now += v - x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = now = 0 for v in a: now += v - x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) for _ in range(50): x = (r + l) / 2 A = abs(max_sum(x)) B = abs(min_sum(x)) if A < B: r = x else: l = x print(max(A, B))
def max_sum(x): ans = now = 0 for v in a: now += v - x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = now = 0 for v in a: now += v - x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) for _ in range(50): x = (r + l) / 2 A = abs(max_sum(x)) B = abs(min_sum(x)) if A>B: r = x else: l = x print(max(A, B))
if A>B:
27
decision
def max_sum(x): ans = now = 0 for v in a: now += v - x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = now = 0 for v in a: now += v - x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) for _ in range(50): x = (r + l) / 2 A = abs(max_sum(x)) B = abs(min_sum(x)) if A < B: r = x else: l = x print(max(A, B))
def max_sum(x): ans = now = 0 for v in a: now += v - x now = max(now, 0) ans = max(ans, now) return ans def min_sum(x): ans = now = 0 for v in a: now += v//x now = min(now, 0) ans = min(ans, now) return ans n = int(input()) a = [int(x) for x in input().split()] l = min(a) r = max(a) for _ in range(50): x = (r + l) / 2 A = abs(max_sum(x)) B = abs(min_sum(x)) if A < B: r = x else: l = x print(max(A, B))
now += v//x
12
operation
n = int(input()) a = list(map(int, input().split())) a[1:].sort() t = 0 while a[0] <= a[-1]: a[0] += 1 a[-1] -= 1 t += 1 a[1:] = sorted(a[1:]) print(t)
n = int(input()) a = list(map(int, input().split())) a[1:].sort() t = 0 while a[0]>=a[-1]: a[0] += 1 a[-1] -= 1 t += 1 a[1:] = sorted(a[1:]) print(t)
while a[0]>=a[-1]:
7
decision
n = int(input()) a = list(map(int, input().split())) a[1:].sort() t = 0 while a[0] <= a[-1]: a[0] += 1 a[-1] -= 1 t += 1 a[1:] = sorted(a[1:]) print(t)
n = int(input()) a = list(map(int, input().split())) a[1:].sort() t = 0 while a[0] <= a[-1]: a[157] += 1 a[-1] -= 1 t += 1 a[1:] = sorted(a[1:]) print(t)
a[157] += 1
8
value
n=int(input()) string=input() list1=[] temp="" for i in range(0,len(string)): if string[i] in 'aeiouy': temp+=string[i] else: if(len(temp)>0): list1.append(temp) list1.append(string[i]) temp="" if(len(temp)>0): list1.append(temp) for i in list1: print(i[0],end="")
n=int(input()) string=input() list1=[] temp="" for i in range(0,len(string)): if string[i] in 'aeiouy': temp+=string[i] else: if(len(temp)>0): list1.append(temp) list1.append(string[i]) temp="" if(len(temp)>0): list1.append(temp) for i in list1: print(i[93],end="")
print(i[93],end="")
17
value
n=int(input()) string=input() list1=[] temp="" for i in range(0,len(string)): if string[i] in 'aeiouy': temp+=string[i] else: if(len(temp)>0): list1.append(temp) list1.append(string[i]) temp="" if(len(temp)>0): list1.append(temp) for i in list1: print(i[0],end="")
n=int(input()) string=input() list1=[] temp="" for i in range(0,len(string)): if string[i] in 'aeiouy': temp+=string[i] else: if(len(temp)==0): list1.append(temp) list1.append(string[i]) temp="" if(len(temp)>0): list1.append(temp) for i in list1: print(i[0],end="")
if(len(temp)==0):
9
decision
n=int(input()) string=input() list1=[] temp="" for i in range(0,len(string)): if string[i] in 'aeiouy': temp+=string[i] else: if(len(temp)>0): list1.append(temp) list1.append(string[i]) temp="" if(len(temp)>0): list1.append(temp) for i in list1: print(i[0],end="")
n=int(input()) string=input() list1=[] temp="" for i in range(0,len(string)): if string[i] in 'aeiouy': temp+=string[i] else: if(len(temp)>0): list1.append(temp) list1.append(string[i]) temp="" if(len(temp)>0): list1.append(temp) for i in list1: print(i[7],end="")
print(i[7],end="")
17
value
n,k=map(int,input().split()) li=map(int,input().split()) lo=sorted(li) print(lo) for i in range(n): m = int(lo[n-i-1]) if k%m==0: print(m) print(int(k/m)) break
z,k=map(int,input().split()) li=map(int,input().split()) lo=sorted(li) print(lo) for i in range(n): m = int(lo[n-i-1]) if k%m==0: print(m) print(int(k/m)) break
z,k=map(int,input().split())
1
statement
n,k=map(int,input().split()) li=map(int,input().split()) lo=sorted(li) print(lo) for i in range(n): m = int(lo[n-i-1]) if k%m==0: print(m) print(int(k/m)) break
n,k=map(int,input().split()) li=map(int,input().split()) lo=sorted(li) print(lo) for i in range(n): m = int(lo[n-i-1]) if k%m<0: print(m) print(int(k/m)) break
if k%m<0:
7
decision
n,k=map(int,input().split()) li=map(int,input().split()) lo=sorted(li) print(lo) for i in range(n): m = int(lo[n-i-1]) if k%m==0: print(m) print(int(k/m)) break
n,k=map(int,input().split()) li=map(int,input().split()) lo=sorted(li) print(lo) for i in range(n): m = int(lo[n-i-1]) if k%m<0: print(m) print(int(k/m)) break
if k%m<0:
7
decision
n,k=map(int,input().split()) li=map(int,input().split()) lo=sorted(li) print(lo) for i in range(n): m = int(lo[n-i-1]) if k%m==0: print(m) print(int(k/m)) break
n,k=map(int,input().split()) li=map(int,input().split()) lo=sorted(li) print(lo) for i in range(n): m = int(lo[n-i-1]) if k*m==0: print(m) print(int(k/m)) break
if k*m==0:
7
operation
n,k=map(int,input().split()) li=map(int,input().split()) lo=sorted(li) print(lo) for i in range(n): m = int(lo[n-i-1]) if k%m==0: print(m) print(int(k/m)) break
n,k=map(int,input().split()) li=map(int,input().split()) lo=sorted(x) print(lo) for i in range(n): m = int(lo[n-i-1]) if k%m==0: print(m) print(int(k/m)) break
lo=sorted(x)
3
statement
s = input() se = len(set(s)) possible = False if(se > 4): possible = False elif (se is 4): possible = True elif (se is 3): if(len(s) >= 4): possible = True else: possible = False elif (se is 2): f1 = 0 f2 = 0 c = s[0] for c1 in s: if c1 == c: f1 += 1 else: f2 += 1 if f1 >= 2 and f2 >= 2: possible = True else: possible = False if(possible): print("Yes") else: print("No")
s = input() se = len(set(s)) possible = False if(se > 4): possible = False elif (se is 4): possible = True elif (se is 3): if(len(s) >= 4): possible = True else: possible = False elif (se is 2): f1 = 0 f2 = 0 c = s[0] for c1 in s: if c1<c: f1 += 1 else: f2 += 1 if f1 >= 2 and f2 >= 2: possible = True else: possible = False if(possible): print("Yes") else: print("No")
if c1<c:
24
decision
s = input() se = len(set(s)) possible = False if(se > 4): possible = False elif (se is 4): possible = True elif (se is 3): if(len(s) >= 4): possible = True else: possible = False elif (se is 2): f1 = 0 f2 = 0 c = s[0] for c1 in s: if c1 == c: f1 += 1 else: f2 += 1 if f1 >= 2 and f2 >= 2: possible = True else: possible = False if(possible): print("Yes") else: print("No")
s = input() se = len(set(s)) possible = False if(se > 4): possible = False elif (se is 4): possible = True elif (se is 3): if(len(s) >= 4): possible = True else: possible = False elif (se is 2): f1 = 0 f2 = 0 c = s[0] for c1 in s: if c1 == c: f1 += 1 else: f2 += 1 if f1 >= 2 and f2<=2: possible = True else: possible = False if(possible): print("Yes") else: print("No")
if f1 >= 2 and f2<=2:
29
decision
s = input() se = len(set(s)) possible = False if(se > 4): possible = False elif (se is 4): possible = True elif (se is 3): if(len(s) >= 4): possible = True else: possible = False elif (se is 2): f1 = 0 f2 = 0 c = s[0] for c1 in s: if c1 == c: f1 += 1 else: f2 += 1 if f1 >= 2 and f2 >= 2: possible = True else: possible = False if(possible): print("Yes") else: print("No")
s = input() se = len(set(s)) possible = False if(se > 4): x = False elif (se is 4): possible = True elif (se is 3): if(len(s) >= 4): possible = True else: possible = False elif (se is 2): f1 = 0 f2 = 0 c = s[0] for c1 in s: if c1 == c: f1 += 1 else: f2 += 1 if f1 >= 2 and f2 >= 2: possible = True else: possible = False if(possible): print("Yes") else: print("No")
x = False
8
statement
import sys, math, os.path FILE_INPUT = "c.in" DEBUG = os.path.isfile(FILE_INPUT) if DEBUG: sys.stdin = open(FILE_INPUT) def ni(): return int(input()) def nvi(): return map(int, input().split(" ")) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) s = input() ls = len(s) count = 0 for i in range(0,ls): low = 0 high = 0 if s[i] != ')': log(i) for j in range(i,ls): if s[j] == '(': low += 1 high += 1 elif s[j] == ')': low = max(0, low-1) high -= 1 else: low = max(0, low-1) high += 1 log(str(i) + ": "+str(low) + "-"+str(high)) if (low > high): break if (low <= 0 <= high) and ((j - i) % 2 == 1): log("count " + str(i) + " - " + str(j)) count += 1 print(count)
import sys, math, os.path FILE_INPUT = "c.in" DEBUG = os.path.isfile(FILE_INPUT) if DEBUG: sys.stdin = open(FILE_INPUT) def ni(): return int(input()) def nvi(): return map(int, input().split(" ")) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) s = input() ls = len(s) count = 0 for i in range(0,ls): low = 0 high = 0 if s[i] != ')': log(i) for j in range(i,ls): if s[j] == '(': low += 1 high += 1 elif s[j] == ')': low = max(0, low-1) high -= 1 else: low = max(0, low-1) high += 1 log(str(i) + ": "+str(low) + "-"+str(high)) if (low > high): break if (low <= 0 <= high) and ((j - i) % 2<1): log("count " + str(i) + " - " + str(j)) count += 1 print(count)
if (low <= 0 <= high) and ((j - i) % 2<1):
43
decision
import sys, math, os.path FILE_INPUT = "c.in" DEBUG = os.path.isfile(FILE_INPUT) if DEBUG: sys.stdin = open(FILE_INPUT) def ni(): return int(input()) def nvi(): return map(int, input().split(" ")) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) s = input() ls = len(s) count = 0 for i in range(0,ls): low = 0 high = 0 if s[i] != ')': log(i) for j in range(i,ls): if s[j] == '(': low += 1 high += 1 elif s[j] == ')': low = max(0, low-1) high -= 1 else: low = max(0, low-1) high += 1 log(str(i) + ": "+str(low) + "-"+str(high)) if (low > high): break if (low <= 0 <= high) and ((j - i) % 2 == 1): log("count " + str(i) + " - " + str(j)) count += 1 print(count)
import sys, math, os.path FILE_INPUT = "c.in" DEBUG = os.path.isfile(FILE_INPUT) if DEBUG: sys.stdin = open(FILE_INPUT) def ni(): return int(input()) def nvi(): return map(int, input().split(" ")) def nia(): return list(map(int,input().split())) def log(x): if (DEBUG): print(x) s = input() ls = len(s) count = 0 for i in range(0,ls): low = 0 high = 0 if s[i] != ')': log(i) for j in range(i,ls): if s[j] == '(': low += 1 high += 1 elif s[j] == ')': low = max(0, low-1) high -= 1 else: low = max(0, low-1) high += 1 log(str(i) + ": "+str(low) + "-"+str(high)) if (low > high): break if (low <= 0 <= high) and ((j - i) % 2<1): log("count " + str(i) + " - " + str(j)) count += 1 print(count)
if (low <= 0 <= high) and ((j - i) % 2<1):
43
decision