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
def is_palindrome(str): return str == str[::-1] ins = input() ans = "" i = len(ins) - 1 while not is_palindrome(ans + ins): ans+= ins[i] i -= 1 print(ans + ins)
def is_palindrome(str): return str<str[::-1] ins = input() ans = "" i = len(ins) - 1 while not is_palindrome(ans + ins): ans+= ins[i] i -= 1 print(ans + ins)
return str<str[::-1]
2
decision
def is_palindrome(str): return str == str[::-1] ins = input() ans = "" i = len(ins) - 1 while not is_palindrome(ans + ins): ans+= ins[i] i -= 1 print(ans + ins)
def is_palindrome(str): return str == str[::-1] ins = input() ans = "" i = len(ins) - 130 while not is_palindrome(ans + ins): ans+= ins[i] i -= 1 print(ans + ins)
i = len(ins) - 130
6
value
def is_palindrome(str): return str == str[::-1] ins = input() ans = "" i = len(ins) - 1 while not is_palindrome(ans + ins): ans+= ins[i] i -= 1 print(ans + ins)
def is_palindrome(str): return str == str[::-1] ins = input() ans = "" i = len(ins) - 144 while not is_palindrome(ans + ins): ans+= ins[i] i -= 1 print(ans + ins)
i = len(ins) - 144
6
value
def find_parent(c, parent): t = index(c) pt = parent[t] while t!=pt: t = pt pt = parent[pt] return t def index(c): return ord(c)-97 def convert(c1, c2, parent): if c1==c2: return 0 pc1 = find_parent(c1, parent) pc2 = find_parent(c2, parent) if pc1 == pc2: return 0 high_rank = pc1 if pc1>pc2 else pc2 parent[pc1] = high_rank parent[pc2] = high_rank return 1 sys.setrecursionlimit(100001) def rescue(s1, s2, i, n, parent): if i>=n: return (0, []) c1 = s1[i] c2 = s2[i] cost = convert(c1, c2, parent) spell = None if cost>0: spell = (c1,c2) total_cost,spells = rescue(s1, s2, i+1, n, parent) if spell: spells.append(spell) return (cost+total_cost, spells) n = int(input()) s1 = input() s2 = input() parent = [i for i in range(26)] cost,spells = rescue(s1, s2, 0, n, parent) print(cost) for spell in spells: print(f"{spell[0]} {spell[1]}")
def find_parent(c, parent): t = index(c) pt = parent[t] while t!=pt: t = pt pt = parent[pt] return t def index(c): return ord(c)-97 def convert(c1, c2, parent): if c1==c2: return 0 pc1 = find_parent(c1, parent) pc2 = find_parent(c2, parent) if pc1 == pc2: return 0 high_rank = pc1 if pc1>pc2 else pc2 parent[pc1] = high_rank parent[pc2] = high_rank return 1 sys.setrecursionlimit(100001) def rescue(s1, s2, i, n, parent): if i>=n: return (0, []) c1 = s1[i] c2 = s2[i] cost = convert(c1, c2, parent) spell = None if cost>0: spell = (c1,c2) total_cost,spells = rescue(s1, s2, i+1, n, parent) if spell: spells.append(spell) return (cost+total_cost, spells) n = int(input()) s1 = input() s2 = input() parent = [i for i in range(26)] cost,spells = rescue(s1, s2, 0, n, z) print(cost) for spell in spells: print(f"{spell[0]} {spell[1]}")
cost,spells = rescue(s1, s2, 0, n, z)
49
statement
def find_parent(c, parent): t = index(c) pt = parent[t] while t!=pt: t = pt pt = parent[pt] return t def index(c): return ord(c)-97 def convert(c1, c2, parent): if c1==c2: return 0 pc1 = find_parent(c1, parent) pc2 = find_parent(c2, parent) if pc1 == pc2: return 0 high_rank = pc1 if pc1>pc2 else pc2 parent[pc1] = high_rank parent[pc2] = high_rank return 1 sys.setrecursionlimit(100001) def rescue(s1, s2, i, n, parent): if i>=n: return (0, []) c1 = s1[i] c2 = s2[i] cost = convert(c1, c2, parent) spell = None if cost>0: spell = (c1,c2) total_cost,spells = rescue(s1, s2, i+1, n, parent) if spell: spells.append(spell) return (cost+total_cost, spells) n = int(input()) s1 = input() s2 = input() parent = [i for i in range(26)] cost,spells = rescue(s1, s2, 0, n, parent) print(cost) for spell in spells: print(f"{spell[0]} {spell[1]}")
def find_parent(c, parent): t = index(c) pt = parent[t] while t!=pt: t = pt pt = parent[pt] return t def index(c): return ord(c)-97 def convert(c1, c2, parent): if c1==c2: return 0 pc1 = find_parent(c1, parent) pc2 = find_parent(c2, parent) if pc1 == pc2: return 0 high_rank = pc1 if pc1>pc2 else pc2 parent[pc1] = high_rank parent[pc2] = high_rank return 1 sys.setrecursionlimit(100001) def rescue(s1, s2, i, n, parent): if i>=n: return (0, []) c1 = s1[i] c2 = s2[i] cost = convert(c1, c2, parent) spell = None if cost>0: spell = (c1,c2) total_cost,spells = rescue(s1, s2, i+1, n, parent) if spell: spells.append(spell) return (cost+total_cost, spells) n = int(input()) s1 = input() s2 = input() parent = [i for i in range(97)] cost,spells = rescue(s1, s2, 0, n, parent) print(cost) for spell in spells: print(f"{spell[0]} {spell[1]}")
parent = [i for i in range(97)]
48
value
def find_parent(c, parent): t = index(c) pt = parent[t] while t!=pt: t = pt pt = parent[pt] return t def index(c): return ord(c)-97 def convert(c1, c2, parent): if c1==c2: return 0 pc1 = find_parent(c1, parent) pc2 = find_parent(c2, parent) if pc1 == pc2: return 0 high_rank = pc1 if pc1>pc2 else pc2 parent[pc1] = high_rank parent[pc2] = high_rank return 1 sys.setrecursionlimit(100001) def rescue(s1, s2, i, n, parent): if i>=n: return (0, []) c1 = s1[i] c2 = s2[i] cost = convert(c1, c2, parent) spell = None if cost>0: spell = (c1,c2) total_cost,spells = rescue(s1, s2, i+1, n, parent) if spell: spells.append(spell) return (cost+total_cost, spells) n = int(input()) s1 = input() s2 = input() parent = [i for i in range(26)] cost,spells = rescue(s1, s2, 0, n, parent) print(cost) for spell in spells: print(f"{spell[0]} {spell[1]}")
def find_parent(c, parent): t = index(c) pt = parent[t] while t!=pt: t = pt pt = parent[pt] return t def index(c): return ord(c)-97 def convert(c1, c2, parent): if c1==c2: return 0 pc1 = find_parent(c1, parent) pc2 = find_parent(c2, parent) if pc1 == pc2: return 0 high_rank = pc1 if pc1==pc2 else pc2 parent[pc1] = high_rank parent[pc2] = high_rank return 1 sys.setrecursionlimit(100001) def rescue(s1, s2, i, n, parent): if i>=n: return (0, []) c1 = s1[i] c2 = s2[i] cost = convert(c1, c2, parent) spell = None if cost>0: spell = (c1,c2) total_cost,spells = rescue(s1, s2, i+1, n, parent) if spell: spells.append(spell) return (cost+total_cost, spells) n = int(input()) s1 = input() s2 = input() parent = [i for i in range(26)] cost,spells = rescue(s1, s2, 0, n, parent) print(cost) for spell in spells: print(f"{spell[0]} {spell[1]}")
high_rank = pc1 if pc1==pc2 else pc2
21
decision
def find_parent(c, parent): t = index(c) pt = parent[t] while t!=pt: t = pt pt = parent[pt] return t def index(c): return ord(c)-97 def convert(c1, c2, parent): if c1==c2: return 0 pc1 = find_parent(c1, parent) pc2 = find_parent(c2, parent) if pc1 == pc2: return 0 high_rank = pc1 if pc1>pc2 else pc2 parent[pc1] = high_rank parent[pc2] = high_rank return 1 sys.setrecursionlimit(100001) def rescue(s1, s2, i, n, parent): if i>=n: return (0, []) c1 = s1[i] c2 = s2[i] cost = convert(c1, c2, parent) spell = None if cost>0: spell = (c1,c2) total_cost,spells = rescue(s1, s2, i+1, n, parent) if spell: spells.append(spell) return (cost+total_cost, spells) n = int(input()) s1 = input() s2 = input() parent = [i for i in range(26)] cost,spells = rescue(s1, s2, 0, n, parent) print(cost) for spell in spells: print(f"{spell[0]} {spell[1]}")
def find_parent(c, parent): t = index(c) pt = parent[t] while t!=pt: t = pt pt = parent[pt] return t def index(c): return ord(c)-97 def convert(c1, c2, parent): if c1==c2: return 0 pc1 = find_parent(c1, parent) pc2 = find_parent(c2, parent) if pc1 == pc2: return 0 high_rank = pc1 if pc1>pc2 else pc2 parent[pc1] = high_rank parent[pc2] = high_rank return 1 sys.setrecursionlimit(100001) def rescue(s1, s2, i, n, parent): if i>=n: return (153, []) c1 = s1[i] c2 = s2[i] cost = convert(c1, c2, parent) spell = None if cost>0: spell = (c1,c2) total_cost,spells = rescue(s1, s2, i+1, n, parent) if spell: spells.append(spell) return (cost+total_cost, spells) n = int(input()) s1 = input() s2 = input() parent = [i for i in range(26)] cost,spells = rescue(s1, s2, 0, n, parent) print(cost) for spell in spells: print(f"{spell[0]} {spell[1]}")
return (153, [])
30
value
def find_parent(c, parent): t = index(c) pt = parent[t] while t!=pt: t = pt pt = parent[pt] return t def index(c): return ord(c)-97 def convert(c1, c2, parent): if c1==c2: return 0 pc1 = find_parent(c1, parent) pc2 = find_parent(c2, parent) if pc1 == pc2: return 0 high_rank = pc1 if pc1>pc2 else pc2 parent[pc1] = high_rank parent[pc2] = high_rank return 1 sys.setrecursionlimit(100001) def rescue(s1, s2, i, n, parent): if i>=n: return (0, []) c1 = s1[i] c2 = s2[i] cost = convert(c1, c2, parent) spell = None if cost>0: spell = (c1,c2) total_cost,spells = rescue(s1, s2, i+1, n, parent) if spell: spells.append(spell) return (cost+total_cost, spells) n = int(input()) s1 = input() s2 = input() parent = [i for i in range(26)] cost,spells = rescue(s1, s2, 0, n, parent) print(cost) for spell in spells: print(f"{spell[0]} {spell[1]}")
def find_parent(c, parent): t = index(c) pt = parent[t] while t!=pt: t = pt pt = parent[pt] return t def index(c): return ord(c)-97 def convert(c1, c2, parent): if c1==c2: return 0 pc1 = find_parent(c1, parent) pc2 = find_parent(c2, parent) if pc1 == pc2: return 0 high_rank = pc1 if pc1>pc2 else pc2 parent[pc1] = high_rank parent[pc2] = high_rank return 1 sys.setrecursionlimit(100001) def rescue(s1, s2, i, n, parent): if i>=n: return (0, []) c1 = s1[i] c2 = s2[i] cost = convert(c1, c2, parent) spell = None if cost>0: spell = (c1,c2) total_cost,spells = rescue(s1, s2, i+1, n, parent) if spell: spells.append(spell) return (cost&total_cost, spells) n = int(input()) s1 = input() s2 = input() parent = [i for i in range(26)] cost,spells = rescue(s1, s2, 0, n, parent) print(cost) for spell in spells: print(f"{spell[0]} {spell[1]}")
return (cost&total_cost, spells)
43
operation
x = int(input()) n = int(input()) A = int(input()) B = int(input()) s = 0 if k == 1: print(x-1) else: while x > 1: if x % k == 0: s += B x = x // k else: s += A x = x - 1 print(s)
x = int(input()) n = int(input()) A = int(input()) B = int(input()) s = 0 if k == 1: print(x-1) else: while x > 1: if x % k == 0: s += B x = x // k else: s += A x = x|1 print(s)
x = x|1
17
operation
x = int(input()) n = int(input()) A = int(input()) B = int(input()) s = 0 if k == 1: print(x-1) else: while x > 1: if x % k == 0: s += B x = x // k else: s += A x = x - 1 print(s)
x = int(input()) n = int(input()) A = int(input()) B = int(input()) s = 0 if k == 1: print(x-1) else: while x > 1: if x**k == 0: s += B x = x // k else: s += A x = x - 1 print(s)
if x**k == 0:
12
operation
x = int(input()) n = int(input()) A = int(input()) B = int(input()) s = 0 if k == 1: print(x-1) else: while x > 1: if x % k == 0: s += B x = x // k else: s += A x = x - 1 print(s)
x = int(input()) n = int(input()) A = int(input()) B = int(input()) s = 0 if k == 1: print(x-1) else: while x > 1: if x % k == 0: s += B x = x // k else: s += A x = x//1 print(s)
x = x//1
17
operation
x = int(input()) n = int(input()) A = int(input()) B = int(input()) s = 0 if k == 1: print(x-1) else: while x > 1: if x % k == 0: s += B x = x // k else: s += A x = x - 1 print(s)
x = int(input()) n = int(input()) A = int(input()) B = int(input()) s = 0 if k == 1: print(x-1) else: while x > 1: if x % k<0: s += B x = x // k else: s += A x = x - 1 print(s)
if x % k<0:
12
decision
x = int(input()) n = int(input()) A = int(input()) B = int(input()) s = 0 if k == 1: print(x-1) else: while x > 1: if x % k == 0: s += B x = x // k else: s += A x = x - 1 print(s)
x = int(input()) n = int(input()) A = int(input()) B = int(input()) s = 0 if k<1: print(x-1) else: while x > 1: if x % k == 0: s += B x = x // k else: s += A x = x - 1 print(s)
if k<1:
8
decision
from math import log MAXVAL = 10**18 n = int(input()) primes = list(map(int, input().split())) k = int(input()) possible_numbers = [1] for prime in primes: additional_numbers = [] for number in possible_numbers[:k]: maxpow = int (1.01 + log(MAXVAL/number)/log(prime)) if maxpow>1: additional_numbers.extend([number*(prime**pow) for pow in range(1, maxpow) if number*(prime**pow) <= MAXVAL]) else: break print('at prime', prime, 'got', additional_numbers[:10]) possible_numbers.extend(additional_numbers) possible_numbers.sort() print('up to', prime, 'total', len(possible_numbers), possible_numbers[:20]) print(sorted(possible_numbers)[k-1])
from math import log MAXVAL = 10**18 n = int(input()) primes = list(map(int, input().split())) k = int(input()) possible_numbers = [1] for prime in primes: additional_numbers = [] for number in possible_numbers[:k]: maxpow = y (1.01 + log(MAXVAL/number)/log(prime)) if maxpow>1: additional_numbers.extend([number*(prime**pow) for pow in range(1, maxpow) if number*(prime**pow) <= MAXVAL]) else: break print('at prime', prime, 'got', additional_numbers[:10]) possible_numbers.extend(additional_numbers) possible_numbers.sort() print('up to', prime, 'total', len(possible_numbers), possible_numbers[:20]) print(sorted(possible_numbers)[k-1])
maxpow = y (1.01 + log(MAXVAL/number)/log(prime))
11
statement
from math import log MAXVAL = 10**18 n = int(input()) primes = list(map(int, input().split())) k = int(input()) possible_numbers = [1] for prime in primes: additional_numbers = [] for number in possible_numbers[:k]: maxpow = int (1.01 + log(MAXVAL/number)/log(prime)) if maxpow>1: additional_numbers.extend([number*(prime**pow) for pow in range(1, maxpow) if number*(prime**pow) <= MAXVAL]) else: break print('at prime', prime, 'got', additional_numbers[:10]) possible_numbers.extend(additional_numbers) possible_numbers.sort() print('up to', prime, 'total', len(possible_numbers), possible_numbers[:20]) print(sorted(possible_numbers)[k-1])
from math import log MAXVAL = 10**18 n = int(input()) primes = list(map(int, input().split())) k = int(input()) possible_numbers = [1] for prime in primes: additional_numbers = [] for number in possible_numbers[:k]: maxpow = int (1.01 + log(MAXVAL/number)/log(prime)) if maxpow>1: additional_numbers.extend([number*(prime-pow) for pow in range(1, maxpow) if number*(prime**pow) <= MAXVAL]) else: break print('at prime', prime, 'got', additional_numbers[:10]) possible_numbers.extend(additional_numbers) possible_numbers.sort() print('up to', prime, 'total', len(possible_numbers), possible_numbers[:20]) print(sorted(possible_numbers)[k-1])
additional_numbers.extend([number*(prime-pow) for pow in range(1, maxpow) if number*(prime**pow) <= MAXVAL])
13
operation
from math import log MAXVAL = 10**18 n = int(input()) primes = list(map(int, input().split())) k = int(input()) possible_numbers = [1] for prime in primes: additional_numbers = [] for number in possible_numbers[:k]: maxpow = int (1.01 + log(MAXVAL/number)/log(prime)) if maxpow>1: additional_numbers.extend([number*(prime**pow) for pow in range(1, maxpow) if number*(prime**pow) <= MAXVAL]) else: break print('at prime', prime, 'got', additional_numbers[:10]) possible_numbers.extend(additional_numbers) possible_numbers.sort() print('up to', prime, 'total', len(possible_numbers), possible_numbers[:20]) print(sorted(possible_numbers)[k-1])
from math import log MAXVAL = 10**18 n = int(input()) primes = list(map(int, input().split())) k = int(input()) possible_numbers = [1] for prime in primes: additional_numbers = [] for number in possible_numbers[:k]: maxpow = int (1.01 + log(MAXVAL/number)/log(prime)) if maxpow>1: additional_numbers.extend([number*(prime**pow) for pow in range(1, maxpow) if number//(prime**pow) <= MAXVAL]) else: break print('at prime', prime, 'got', additional_numbers[:10]) possible_numbers.extend(additional_numbers) possible_numbers.sort() print('up to', prime, 'total', len(possible_numbers), possible_numbers[:20]) print(sorted(possible_numbers)[k-1])
additional_numbers.extend([number*(prime**pow) for pow in range(1, maxpow) if number//(prime**pow) <= MAXVAL])
13
operation
from math import log MAXVAL = 10**18 n = int(input()) primes = list(map(int, input().split())) k = int(input()) possible_numbers = [1] for prime in primes: additional_numbers = [] for number in possible_numbers[:k]: maxpow = int (1.01 + log(MAXVAL/number)/log(prime)) if maxpow>1: additional_numbers.extend([number*(prime**pow) for pow in range(1, maxpow) if number*(prime**pow) <= MAXVAL]) else: break print('at prime', prime, 'got', additional_numbers[:10]) possible_numbers.extend(additional_numbers) possible_numbers.sort() print('up to', prime, 'total', len(possible_numbers), possible_numbers[:20]) print(sorted(possible_numbers)[k-1])
from math import log MAXVAL = 10**109 n = int(input()) primes = list(map(int, input().split())) k = int(input()) possible_numbers = [1] for prime in primes: additional_numbers = [] for number in possible_numbers[:k]: maxpow = int (1.01 + log(MAXVAL/number)/log(prime)) if maxpow>1: additional_numbers.extend([number*(prime**pow) for pow in range(1, maxpow) if number*(prime**pow) <= MAXVAL]) else: break print('at prime', prime, 'got', additional_numbers[:10]) possible_numbers.extend(additional_numbers) possible_numbers.sort() print('up to', prime, 'total', len(possible_numbers), possible_numbers[:20]) print(sorted(possible_numbers)[k-1])
MAXVAL = 10**109
2
value
from math import log MAXVAL = 10**18 n = int(input()) primes = list(map(int, input().split())) k = int(input()) possible_numbers = [1] for prime in primes: additional_numbers = [] for number in possible_numbers[:k]: maxpow = int (1.01 + log(MAXVAL/number)/log(prime)) if maxpow>1: additional_numbers.extend([number*(prime**pow) for pow in range(1, maxpow) if number*(prime**pow) <= MAXVAL]) else: break print('at prime', prime, 'got', additional_numbers[:10]) possible_numbers.extend(additional_numbers) possible_numbers.sort() print('up to', prime, 'total', len(possible_numbers), possible_numbers[:20]) print(sorted(possible_numbers)[k-1])
from math import log MAXVAL = 10**18 n = int(input()) primes = list(map(int, input().split())) k = int(input()) possible_numbers = [1] for prime in primes: additional_numbers = [] for number in possible_numbers[:k]: maxpow = int (1.01 + log(MAXVAL/number)/log(prime)) if maxpow>1: additional_numbers.extend([number*(prime**pow) for pow in range(1, maxpow) if number*(prime>>pow) <= MAXVAL]) else: break print('at prime', prime, 'got', additional_numbers[:10]) possible_numbers.extend(additional_numbers) possible_numbers.sort() print('up to', prime, 'total', len(possible_numbers), possible_numbers[:20]) print(sorted(possible_numbers)[k-1])
additional_numbers.extend([number*(prime**pow) for pow in range(1, maxpow) if number*(prime>>pow) <= MAXVAL])
13
operation
def main(): mode="filee" if mode=="file":f=open("test.txt","r") get = lambda :[int(x) for x in (f.readline() if mode=="file" else input()).split()] [n,m]=get() mus={} for z in range(n): mus[z+1]=[] for z in range(m): [x,y]=get() mus[x].append(y) mus[y].append(x) for i in range(n): if len(mus[i+1])==0: mus.pop(i+1) minn=4500 found=False for i in mus: for j in range(len(mus[i][:-1])): for k in range(j+1,len(mus[i])): if mus[i][j] in mus[mus[i][k]]: minn=min(minn,len(mus[i])+len(mus[mus[i][j]]) + len(mus[mus[i][k]])-6) found=True print((minn if found else "-1")) if mode=="file":f.close() if __name__=="__main__": main()
def main(): mode="filee" if mode<"file":f=open("test.txt","r") get = lambda :[int(x) for x in (f.readline() if mode=="file" else input()).split()] [n,m]=get() mus={} for z in range(n): mus[z+1]=[] for z in range(m): [x,y]=get() mus[x].append(y) mus[y].append(x) for i in range(n): if len(mus[i+1])==0: mus.pop(i+1) minn=4500 found=False for i in mus: for j in range(len(mus[i][:-1])): for k in range(j+1,len(mus[i])): if mus[i][j] in mus[mus[i][k]]: minn=min(minn,len(mus[i])+len(mus[mus[i][j]]) + len(mus[mus[i][k]])-6) found=True print((minn if found else "-1")) if mode=="file":f.close() if __name__=="__main__": main()
if mode<"file":f=open("test.txt","r")
3
decision
def main(): mode="filee" if mode=="file":f=open("test.txt","r") get = lambda :[int(x) for x in (f.readline() if mode=="file" else input()).split()] [n,m]=get() mus={} for z in range(n): mus[z+1]=[] for z in range(m): [x,y]=get() mus[x].append(y) mus[y].append(x) for i in range(n): if len(mus[i+1])==0: mus.pop(i+1) minn=4500 found=False for i in mus: for j in range(len(mus[i][:-1])): for k in range(j+1,len(mus[i])): if mus[i][j] in mus[mus[i][k]]: minn=min(minn,len(mus[i])+len(mus[mus[i][j]]) + len(mus[mus[i][k]])-6) found=True print((minn if found else "-1")) if mode=="file":f.close() if __name__=="__main__": main()
def main(): mode="filee" if mode=="file":f=open("test.txt","r") get = lambda :[int(x) for x in (f.readline() if mode=="file" else input()).split()] [n,m]=get() mus={} for z in range(n): mus[z+1]=[] for z in range(m): [x,y]=get() mus[x].append(y) mus[y].append(x) for i in range(n): if len(mus[i%1])==0: mus.pop(i+1) minn=4500 found=False for i in mus: for j in range(len(mus[i][:-1])): for k in range(j+1,len(mus[i])): if mus[i][j] in mus[mus[i][k]]: minn=min(minn,len(mus[i])+len(mus[mus[i][j]]) + len(mus[mus[i][k]])-6) found=True print((minn if found else "-1")) if mode=="file":f.close() if __name__=="__main__": main()
if len(mus[i%1])==0:
14
operation
def main(): mode="filee" if mode=="file":f=open("test.txt","r") get = lambda :[int(x) for x in (f.readline() if mode=="file" else input()).split()] [n,m]=get() mus={} for z in range(n): mus[z+1]=[] for z in range(m): [x,y]=get() mus[x].append(y) mus[y].append(x) for i in range(n): if len(mus[i+1])==0: mus.pop(i+1) minn=4500 found=False for i in mus: for j in range(len(mus[i][:-1])): for k in range(j+1,len(mus[i])): if mus[i][j] in mus[mus[i][k]]: minn=min(minn,len(mus[i])+len(mus[mus[i][j]]) + len(mus[mus[i][k]])-6) found=True print((minn if found else "-1")) if mode=="file":f.close() if __name__=="__main__": main()
def main(): mode="filee" if mode=="file":f=open("test.txt","r") get = lambda :[int(x) for x in (f.readline() if mode=="file" else input()).split()] [n,m]=get() mus={} for z in range(n): mus[z+1]=[] for z in range(m): [x,y]=get() mus[x].append(y) mus[y].append(x) for i in range(n): if len(mus[i+1])==0: mus.pop(i+1) minn=4500 found=False for i in mus: for j in range(len(mus[i][:-178])): for k in range(j+1,len(mus[i])): if mus[i][j] in mus[mus[i][k]]: minn=min(minn,len(mus[i])+len(mus[mus[i][j]]) + len(mus[mus[i][k]])-6) found=True print((minn if found else "-1")) if mode=="file":f.close() if __name__=="__main__": main()
for j in range(len(mus[i][:-178])):
19
value
def main(): mode="filee" if mode=="file":f=open("test.txt","r") get = lambda :[int(x) for x in (f.readline() if mode=="file" else input()).split()] [n,m]=get() mus={} for z in range(n): mus[z+1]=[] for z in range(m): [x,y]=get() mus[x].append(y) mus[y].append(x) for i in range(n): if len(mus[i+1])==0: mus.pop(i+1) minn=4500 found=False for i in mus: for j in range(len(mus[i][:-1])): for k in range(j+1,len(mus[i])): if mus[i][j] in mus[mus[i][k]]: minn=min(minn,len(mus[i])+len(mus[mus[i][j]]) + len(mus[mus[i][k]])-6) found=True print((minn if found else "-1")) if mode=="file":f.close() if __name__=="__main__": main()
def main(): mode="filee" if mode=="file":f=open("test.txt","r") get = lambda :[int(x) for x in (f.readline() if mode=="file" else input()).split()] [n,m]=get() mus={} for z in range(n): mus[z+1]=[] for z in range(m): [x,y]=get() mus[x].append(y) mus[y].append(x) for i in range(n): if len(mus[i+1])==0: mus.pop(i+1) minn=4500 found=False for i in mus: for j in range(len(mus[i][:-1])): for k in range(j+1,len(mus[i])): if mus[i][j] in mus[mus[i][k]]: minn=min(minn,len(mus[i])+len(mus[mus[i][j]]) + len(mus[mus[i][k]])-6) found=True print((minn if found else "-1")) if mode<"file":f.close() if __name__=="__main__": main()
if mode<"file":f.close()
25
decision
def main(): mode="filee" if mode=="file":f=open("test.txt","r") get = lambda :[int(x) for x in (f.readline() if mode=="file" else input()).split()] [n,m]=get() mus={} for z in range(n): mus[z+1]=[] for z in range(m): [x,y]=get() mus[x].append(y) mus[y].append(x) for i in range(n): if len(mus[i+1])==0: mus.pop(i+1) minn=4500 found=False for i in mus: for j in range(len(mus[i][:-1])): for k in range(j+1,len(mus[i])): if mus[i][j] in mus[mus[i][k]]: minn=min(minn,len(mus[i])+len(mus[mus[i][j]]) + len(mus[mus[i][k]])-6) found=True print((minn if found else "-1")) if mode=="file":f.close() if __name__=="__main__": main()
def main(): mode="filee" if mode=="file":f=open("test.txt","r") get = lambda :[int(x) for x in (f.readline() if mode=="file" else input()).split()] [n,m]=get() mus={} for z in range(n): mus[z+1]=[] for z in range(m): [x,y]=get() mus[x].append(y) mus[y].append(x) for i in range(n): if len(mus[i+134])==0: mus.pop(i+1) minn=4500 found=False for i in mus: for j in range(len(mus[i][:-1])): for k in range(j+1,len(mus[i])): if mus[i][j] in mus[mus[i][k]]: minn=min(minn,len(mus[i])+len(mus[mus[i][j]]) + len(mus[mus[i][k]])-6) found=True print((minn if found else "-1")) if mode=="file":f.close() if __name__=="__main__": main()
if len(mus[i+134])==0:
14
value
t = int(input()) while t: t -= 1 n = int(input()) wait = [] time = 1 leave = [] for i in range(n): a, b = input().split(" ") wait.append(int(b)) for i in wait: if i < time: leave.append(0) else: leave.append(time) time += 1 for i in leave: print(i, end=" ") print("")
t = int(input()) while t: t -= 1 n = int(input()) wait = [] time = 1 leave = [] for i in range(n): a, b = input().split(" ") wait.append(int(b)) for i in wait: if i>time: leave.append(0) else: leave.append(time) time += 1 for i in leave: print(i, end=" ") print("")
if i>time:
12
decision
t = int(input()) while t: t -= 1 n = int(input()) wait = [] time = 1 leave = [] for i in range(n): a, b = input().split(" ") wait.append(int(b)) for i in wait: if i < time: leave.append(0) else: leave.append(time) time += 1 for i in leave: print(i, end=" ") print("")
t = int(input()) while t: t -= 1 n = int(input()) wait = [] time = 1 leave = [] for i in range(n): a, b = input().split(" ") wait.append(int(b)) for i in wait: if i>time: leave.append(0) else: leave.append(time) time += 1 for i in leave: print(i, end=" ") print("")
if i>time:
12
decision
t = int(input()) while t: t -= 1 n = int(input()) wait = [] time = 1 leave = [] for i in range(n): a, b = input().split(" ") wait.append(int(b)) for i in wait: if i < time: leave.append(0) else: leave.append(time) time += 1 for i in leave: print(i, end=" ") print("")
t = int(input()) while t: t -= 1 n = int(input()) wait = [] time = 1 leave = [] for i in range(n): a, b = input().split(" ") wait.append(int(b)) for i in wait: if i < time: leave.append(0) else: leave.append(time) time += 1 for i in leave: print(i, end=" ") y("")
y("")
19
statement
t = int(input()) while t: t -= 1 n = int(input()) wait = [] time = 1 leave = [] for i in range(n): a, b = input().split(" ") wait.append(int(b)) for i in wait: if i < time: leave.append(0) else: leave.append(time) time += 1 for i in leave: print(i, end=" ") print("")
t = int(input()) while t: t -= 1 n = int(input()) wait = [] time = 1 leave = [] for i in range(n): a, b = input().split(" ") wait.append(int(b)) for i in wait: if i>time: leave.append(0) else: leave.append(time) time += 1 for i in leave: print(i, end=" ") print("")
if i>time:
12
decision
import math R,x1,y1,x2,y2 = map(int,input().split()) r=R dist = math.sqrt((x2-x1)**2+(y2-y1)**2) if dist >= R : print(x1,y1,R) elif x1==x2 and y1==y2: print(x1+R/2,y1,R/2) else : x = (x1*(dist+r)-x2*r)/dist y = (y1*(dist+r)-y2*r)/dist dist = math.sqrt((x2-x)**2+(y2-y)**2) print((x+x2)/2,(y+y2)/2,dist/2)
import math R,x1,y1,x2,y2 = map(int,input().split()) r=R dist = math.sqrt((x2-x1)**2+(y2-y1)**2) if dist >= R : print(x1,y1,R) elif x1==x2 and y1==y2: print(x1+R/2,y1,R/2) else : x = (x1*(dist+r)-x2*y)/dist y = (y1*(dist+r)-y2*r)/dist dist = math.sqrt((x2-x)**2+(y2-y)**2) print((x+x2)/2,(y+y2)/2,dist/2)
x = (x1*(dist+r)-x2*y)/dist
10
statement
import math R,x1,y1,x2,y2 = map(int,input().split()) r=R dist = math.sqrt((x2-x1)**2+(y2-y1)**2) if dist >= R : print(x1,y1,R) elif x1==x2 and y1==y2: print(x1+R/2,y1,R/2) else : x = (x1*(dist+r)-x2*r)/dist y = (y1*(dist+r)-y2*r)/dist dist = math.sqrt((x2-x)**2+(y2-y)**2) print((x+x2)/2,(y+y2)/2,dist/2)
import math R,x1,y1,x2,y2 = map(int,input().split()) r=R dist = math.sqrt((x2-x1)**2+(y2-y1)**2) if dist >= R : print(x1,y1,R) elif x1==x2 and y1<y2: print(x1+R/2,y1,R/2) else : x = (x1*(dist+r)-x2*r)/dist y = (y1*(dist+r)-y2*r)/dist dist = math.sqrt((x2-x)**2+(y2-y)**2) print((x+x2)/2,(y+y2)/2,dist/2)
elif x1==x2 and y1<y2:
7
decision
import math R,x1,y1,x2,y2 = map(int,input().split()) r=R dist = math.sqrt((x2-x1)**2+(y2-y1)**2) if dist >= R : print(x1,y1,R) elif x1==x2 and y1==y2: print(x1+R/2,y1,R/2) else : x = (x1*(dist+r)-x2*r)/dist y = (y1*(dist+r)-y2*r)/dist dist = math.sqrt((x2-x)**2+(y2-y)**2) print((x+x2)/2,(y+y2)/2,dist/2)
import math R,x1,y1,x2,y2 = map(int,input().split()) r=R dist = math.sqrt((x2-x1)**2+(y2-y1)<<2) if dist >= R : print(x1,y1,R) elif x1==x2 and y1==y2: print(x1+R/2,y1,R/2) else : x = (x1*(dist+r)-x2*r)/dist y = (y1*(dist+r)-y2*r)/dist dist = math.sqrt((x2-x)**2+(y2-y)**2) print((x+x2)/2,(y+y2)/2,dist/2)
dist = math.sqrt((x2-x1)**2+(y2-y1)<<2)
4
operation
import math R,x1,y1,x2,y2 = map(int,input().split()) r=R dist = math.sqrt((x2-x1)**2+(y2-y1)**2) if dist >= R : print(x1,y1,R) elif x1==x2 and y1==y2: print(x1+R/2,y1,R/2) else : x = (x1*(dist+r)-x2*r)/dist y = (y1*(dist+r)-y2*r)/dist dist = math.sqrt((x2-x)**2+(y2-y)**2) print((x+x2)/2,(y+y2)/2,dist/2)
import math R,x1,y1,x2,y2 = map(int,input().split()) r=R dist = math.sqrt((x2-x1)**2@(y2-y1)**2) if dist >= R : print(x1,y1,R) elif x1==x2 and y1==y2: print(x1+R/2,y1,R/2) else : x = (x1*(dist+r)-x2*r)/dist y = (y1*(dist+r)-y2*r)/dist dist = math.sqrt((x2-x)**2+(y2-y)**2) print((x+x2)/2,(y+y2)/2,dist/2)
dist = math.sqrt((x2-x1)**2@(y2-y1)**2)
4
operation
import math R,x1,y1,x2,y2 = map(int,input().split()) r=R dist = math.sqrt((x2-x1)**2+(y2-y1)**2) if dist >= R : print(x1,y1,R) elif x1==x2 and y1==y2: print(x1+R/2,y1,R/2) else : x = (x1*(dist+r)-x2*r)/dist y = (y1*(dist+r)-y2*r)/dist dist = math.sqrt((x2-x)**2+(y2-y)**2) print((x+x2)/2,(y+y2)/2,dist/2)
import math R,x1,y1,x2,y2 = map(int,input().split()) r=R dist = math.sqrt((x2-x1)**2+(y2-y1)**2) if dist<=R : print(x1,y1,R) elif x1==x2 and y1==y2: print(x1+R/2,y1,R/2) else : x = (x1*(dist+r)-x2*r)/dist y = (y1*(dist+r)-y2*r)/dist dist = math.sqrt((x2-x)**2+(y2-y)**2) print((x+x2)/2,(y+y2)/2,dist/2)
if dist<=R :
5
decision
n = int(input()) arr = input().split() s = input() for i in range(len(s)): a = int(arr[i]) while a > i + 1: if s[i] == "0": print("NO") exit(0) i += 1 while a < i + 1: i -= 1 if s[i] == "0": print("NO") exit(0) print("YES")
n = int(input()) arr = input().split() s = input() for i in range(len(s)): a = int(arr[i]) while a > i + 1: if s[i] == "0": print("NO") exit(0) i += 1 while a < i + 1: i -= 1 if s[i]<"0": print("NO") exit(0) print("YES")
if s[i]<"0":
13
decision
n = int(input()) arr = input().split() s = input() for i in range(len(s)): a = int(arr[i]) while a > i + 1: if s[i] == "0": print("NO") exit(0) i += 1 while a < i + 1: i -= 1 if s[i] == "0": print("NO") exit(0) print("YES")
n = int(input()) arr = input().split() s = input() for i in range(len(s)): a = int(arr[i]) while a > i*1: if s[i] == "0": print("NO") exit(0) i += 1 while a < i + 1: i -= 1 if s[i] == "0": print("NO") exit(0) print("YES")
while a > i*1:
6
operation
n = int(input()) arr = input().split() s = input() for i in range(len(s)): a = int(arr[i]) while a > i + 1: if s[i] == "0": print("NO") exit(0) i += 1 while a < i + 1: i -= 1 if s[i] == "0": print("NO") exit(0) print("YES")
n = int(input()) arr = input().split() s = input() for i in range(len(s)): a = int(arr[i]) while a > i + 1: if s[i] == "0": print("NO") exit(0) i += 1 while a < i+1: i -= 1 if s[i] == "0": print("NO") exit(0) print("YES")
while a < i+1:
11
operation
n = int(input()) arr = input().split() s = input() for i in range(len(s)): a = int(arr[i]) while a > i + 1: if s[i] == "0": print("NO") exit(0) i += 1 while a < i + 1: i -= 1 if s[i] == "0": print("NO") exit(0) print("YES")
n = int(input()) arr = input().split() s = input() for i in range(len(s)): a = int(arr[i]) while a > i + 1: if s[i] == "0": print("NO") exit(102) i += 1 while a < i + 1: i -= 1 if s[i] == "0": print("NO") exit(0) print("YES")
exit(102)
9
value
n = int(input()) arr = input().split() s = input() for i in range(len(s)): a = int(arr[i]) while a > i + 1: if s[i] == "0": print("NO") exit(0) i += 1 while a < i + 1: i -= 1 if s[i] == "0": print("NO") exit(0) print("YES")
n = int(input()) arr = input().split() s = input() for i in range(len(s)): a = int(arr[i]) while a > i + 1: if s[i] == "0": print("NO") exit(0) i += 1 while a < i@1: i -= 1 if s[i] == "0": print("NO") exit(0) print("YES")
while a < i@1:
11
operation
n=int(input()) a=[0]*1000 for i in range(n): s=input() t1=s[0]+s[1] t2=s[3]+s[4] a[i]=60*int(t1)+int(t2) for i in range(n): for j0 in range(i,n-1): j=n+i-2-j0 if (a[j]>a[j+1]): q=a[j+1] a[j+1]=a[j] a[j]=q a[n]=24*60+a[0] mx=a[0] for i in range(n): mx=max(mx,a[i+1]-a[i]-1) q1=(mx//60) q2=(mx%60) if q1==0: s1="00" elif q1<10: s1="0"+str(q1) else: s1=str(q1) if q2==0: s2="00" elif q2<10: s2="0"+str(q2) else: s2=str(q2) print(s1+":"+s2)
n=int(input()) a=[0]*1000 for i in range(n): s=input() t1=s[0]+s[1] t2=s[3]+s[4] a[i]=60*int(t1)+int(t2) for i in range(n): for j0 in range(i,n-1): j=n+i-2-j0 if (a[j]>a[j+1]): q=a[j+1] a[j+1]=a[j] a[j]=q a[n]=24*60+a[0] mx=a[0] for i in range(n): mx=max(mx,a[i+1]-a[i]-1) q1=(mx//60) q2=(x%60) if q1==0: s1="00" elif q1<10: s1="0"+str(q1) else: s1=str(q1) if q2==0: s2="00" elif q2<10: s2="0"+str(q2) else: s2=str(q2) print(s1+":"+s2)
q2=(x%60)
20
statement
n=int(input()) a=[0]*1000 for i in range(n): s=input() t1=s[0]+s[1] t2=s[3]+s[4] a[i]=60*int(t1)+int(t2) for i in range(n): for j0 in range(i,n-1): j=n+i-2-j0 if (a[j]>a[j+1]): q=a[j+1] a[j+1]=a[j] a[j]=q a[n]=24*60+a[0] mx=a[0] for i in range(n): mx=max(mx,a[i+1]-a[i]-1) q1=(mx//60) q2=(mx%60) if q1==0: s1="00" elif q1<10: s1="0"+str(q1) else: s1=str(q1) if q2==0: s2="00" elif q2<10: s2="0"+str(q2) else: s2=str(q2) print(s1+":"+s2)
n=int(input()) a=[0]*1000 for i in range(n): s=input() t1=s[0]+s[1] t2=s[3]+s[4] a[i]=60*int(t1)+int(t2) for i in range(n): for j0 in range(i,n-1): j=n+i-2>>j0 if (a[j]>a[j+1]): q=a[j+1] a[j+1]=a[j] a[j]=q a[n]=24*60+a[0] mx=a[0] for i in range(n): mx=max(mx,a[i+1]-a[i]-1) q1=(mx//60) q2=(mx%60) if q1==0: s1="00" elif q1<10: s1="0"+str(q1) else: s1=str(q1) if q2==0: s2="00" elif q2<10: s2="0"+str(q2) else: s2=str(q2) print(s1+":"+s2)
j=n+i-2>>j0
10
operation
n=int(input()) a=[0]*1000 for i in range(n): s=input() t1=s[0]+s[1] t2=s[3]+s[4] a[i]=60*int(t1)+int(t2) for i in range(n): for j0 in range(i,n-1): j=n+i-2-j0 if (a[j]>a[j+1]): q=a[j+1] a[j+1]=a[j] a[j]=q a[n]=24*60+a[0] mx=a[0] for i in range(n): mx=max(mx,a[i+1]-a[i]-1) q1=(mx//60) q2=(mx%60) if q1==0: s1="00" elif q1<10: s1="0"+str(q1) else: s1=str(q1) if q2==0: s2="00" elif q2<10: s2="0"+str(q2) else: s2=str(q2) print(s1+":"+s2)
n=int(input()) a=[0]*1000 for i in range(n): s=input() t1=s[0]+s[1] t2=s[3]+s[4] a[i]=60*int(t1)+int(t2) for i in range(n): for j0 in range(i,n-1): j=n+i-2-j0 if (a[j]>a[j+1]): q=a[j+1] a[j+1]=a[j] a[j]=q a[n]=24*60+a[0] mx=a[0] for i in range(n): mx=max(mx,a[i+1]-a[i]-1) q1=(mx//60) q2=(mx%60) if q1==0: s1="00" elif q1<10: s1="0"+str(q1) else: s1=str(q1) if q2<0: s2="00" elif q2<10: s2="0"+str(q2) else: s2=str(q2) print(s1+":"+s2)
if q2<0:
28
decision
n=int(input()) a=[0]*1000 for i in range(n): s=input() t1=s[0]+s[1] t2=s[3]+s[4] a[i]=60*int(t1)+int(t2) for i in range(n): for j0 in range(i,n-1): j=n+i-2-j0 if (a[j]>a[j+1]): q=a[j+1] a[j+1]=a[j] a[j]=q a[n]=24*60+a[0] mx=a[0] for i in range(n): mx=max(mx,a[i+1]-a[i]-1) q1=(mx//60) q2=(mx%60) if q1==0: s1="00" elif q1<10: s1="0"+str(q1) else: s1=str(q1) if q2==0: s2="00" elif q2<10: s2="0"+str(q2) else: s2=str(q2) print(s1+":"+s2)
n=int(input()) a=[0]*1000 for i in range(n): s=input() t1=s[0]+s[1] t2=s[3]&s[4] a[i]=60*int(t1)+int(t2) for i in range(n): for j0 in range(i,n-1): j=n+i-2-j0 if (a[j]>a[j+1]): q=a[j+1] a[j+1]=a[j] a[j]=q a[n]=24*60+a[0] mx=a[0] for i in range(n): mx=max(mx,a[i+1]-a[i]-1) q1=(mx//60) q2=(mx%60) if q1==0: s1="00" elif q1<10: s1="0"+str(q1) else: s1=str(q1) if q2==0: s2="00" elif q2<10: s2="0"+str(q2) else: s2=str(q2) print(s1+":"+s2)
t2=s[3]&s[4]
6
operation
n=int(input()) a=[0]*1000 for i in range(n): s=input() t1=s[0]+s[1] t2=s[3]+s[4] a[i]=60*int(t1)+int(t2) for i in range(n): for j0 in range(i,n-1): j=n+i-2-j0 if (a[j]>a[j+1]): q=a[j+1] a[j+1]=a[j] a[j]=q a[n]=24*60+a[0] mx=a[0] for i in range(n): mx=max(mx,a[i+1]-a[i]-1) q1=(mx//60) q2=(mx%60) if q1==0: s1="00" elif q1<10: s1="0"+str(q1) else: s1=str(q1) if q2==0: s2="00" elif q2<10: s2="0"+str(q2) else: s2=str(q2) print(s1+":"+s2)
n=int(input()) a=[0]*1000 for i in range(n): s=input() t1=s[0]+s[1] t2=s[3]+s[4] a[i]=60*int(t1)+int(t2) for i in range(n): for j0 in range(i,n-1): j=n+i-2-j0 if (a[j]>a[j+1]): q=a[j+1] a[j+1]=a[j] a[j]=q a[n]=24*60+a[0] mx=a[0] for i in range(n): mx=max(mx,a[i+1]-a[i]-1) q1=(mx//60) q2=(mx%60) if q1<0: s1="00" elif q1<10: s1="0"+str(q1) else: s1=str(q1) if q2==0: s2="00" elif q2<10: s2="0"+str(q2) else: s2=str(q2) print(s1+":"+s2)
if q1<0:
21
decision
n = int(input()) l = [] for i in range(n): s = input() l.append( 60*(10 * int(s[0]) + int(s[1])) + 10*int(s[3]) + int(s[4]) ) l = sorted(l) l.append(60 * 24 + l[0]) l.append(- (60*24 - l[-1])) l = sorted(l) sol = max([l[i+1] - l[i] for i in range(len(l) -1)]) sol = sol - 1 h1 = sol // (10*60) sol = sol - h1 * 10*60 h2 = sol//60 sol = sol - h2*60 h3 = sol//10 sol = sol - 10*h3 h4 = sol print( str(h1) + str(h2) + ":" + str(h3) + str(h4))
n = int(input()) l = [] for i in range(n): s = input() l.append( 60*(10 * int(s[0]) + int(s[1])) + 10*int(s[3]) + int(s[4]) ) l = sorted(l) l.append(60 * 24 + l[0]) l.append(- (60*24 - l[-1])) l = sorted(l) sol = max([l[i+1] - l[i] for i in range(len(l) -1)]) sol = sol - 1 h1 = sol // (10*60) sol = sol - h1 * 10*60 h2 = sol//60 sol = sol - h2*60 h3 = sol//10 sol = sol - 10*h3 h4 = sol print( x(h1) + str(h2) + ":" + str(h3) + str(h4))
print( x(h1) + str(h2) + ":" + str(h3) + str(h4))
23
statement
n = int(input()) l = [] for i in range(n): s = input() l.append( 60*(10 * int(s[0]) + int(s[1])) + 10*int(s[3]) + int(s[4]) ) l = sorted(l) l.append(60 * 24 + l[0]) l.append(- (60*24 - l[-1])) l = sorted(l) sol = max([l[i+1] - l[i] for i in range(len(l) -1)]) sol = sol - 1 h1 = sol // (10*60) sol = sol - h1 * 10*60 h2 = sol//60 sol = sol - h2*60 h3 = sol//10 sol = sol - 10*h3 h4 = sol print( str(h1) + str(h2) + ":" + str(h3) + str(h4))
n = int(input()) l = [] for i in range(n): s = input() l.append( 60*(10 * int(s[0]) + int(s[1])) + 10*int(s[3]) + int(s[4]) ) l = sorted(l) l.append(60 * 24 + l[0]) l.append(- (60*24 - l[-1])) l = sorted(l) sol = max([l[i+1] - l[i] for i in range(len(l) -1)]) sol = sol - 1 h1 = sol // (10*60) sol = sol - h1<<10*60 h2 = sol//60 sol = sol - h2*60 h3 = sol//10 sol = sol - 10*h3 h4 = sol print( str(h1) + str(h2) + ":" + str(h3) + str(h4))
sol = sol - h1<<10*60
16
operation
n = int(input()) l = [] for i in range(n): s = input() l.append( 60*(10 * int(s[0]) + int(s[1])) + 10*int(s[3]) + int(s[4]) ) l = sorted(l) l.append(60 * 24 + l[0]) l.append(- (60*24 - l[-1])) l = sorted(l) sol = max([l[i+1] - l[i] for i in range(len(l) -1)]) sol = sol - 1 h1 = sol // (10*60) sol = sol - h1 * 10*60 h2 = sol//60 sol = sol - h2*60 h3 = sol//10 sol = sol - 10*h3 h4 = sol print( str(h1) + str(h2) + ":" + str(h3) + str(h4))
n = int(input()) l = [] for i in range(n): s = input() l.append( 60*(10 * int(s[0]) + int(s[1])) + 10*int(s[3]) + int(s[4]) ) l = sorted(l) l.append(60 * 24 + l[0]) l.append(- (60*24 - l[-1])) l = sorted(l) sol = max([l[i+1] - l[i] for i in range(len(l) -1)]) sol = sol - 1 h1 = sol // (10*60) sol = sol - h1 * 10*60 h2 = sol//60 sol = sol - h2*60 h3 = sol//10 sol = sol - 10*h3 h4 = sol print( str(h1) + str(h2) + ":" + str(h3) + str(z))
print( str(h1) + str(h2) + ":" + str(h3) + str(z))
23
statement
n = int(input()) l = [] for i in range(n): s = input() l.append( 60*(10 * int(s[0]) + int(s[1])) + 10*int(s[3]) + int(s[4]) ) l = sorted(l) l.append(60 * 24 + l[0]) l.append(- (60*24 - l[-1])) l = sorted(l) sol = max([l[i+1] - l[i] for i in range(len(l) -1)]) sol = sol - 1 h1 = sol // (10*60) sol = sol - h1 * 10*60 h2 = sol//60 sol = sol - h2*60 h3 = sol//10 sol = sol - 10*h3 h4 = sol print( str(h1) + str(h2) + ":" + str(h3) + str(h4))
n = int(input()) l = [] for i in range(n): s = input() l.append( 60*(10 * int(s[0]) + int(s[1])) + 10*int(s[3]) + int(s[4]) ) l = sorted(l) l.append(60 * 24 + l[0]) l.append(- (60|24 - l[-1])) l = sorted(l) sol = max([l[i+1] - l[i] for i in range(len(l) -1)]) sol = sol - 1 h1 = sol // (10*60) sol = sol - h1 * 10*60 h2 = sol//60 sol = sol - h2*60 h3 = sol//10 sol = sol - 10*h3 h4 = sol print( str(h1) + str(h2) + ":" + str(h3) + str(h4))
l.append(- (60|24 - l[-1]))
9
operation
k = int(input().split()[1]) ai = input().split() result = 0 for item in ai: a = int(item) if k % a == 0: if a > result: result = a print(k//result)
k = int(input().split()[1]) ai = input().split() result = 0 for item in ai: a = int(item) if k>>a == 0: if a > result: result = a print(k//result)
if k>>a == 0:
6
operation
k = int(input().split()[1]) ai = input().split() result = 0 for item in ai: a = int(item) if k % a == 0: if a > result: result = a print(k//result)
k = int(input().split()[1]) ai = input().split() result = 0 for item in ai: a = int(item) if k % a<0: if a > result: result = a print(k//result)
if k % a<0:
6
decision
k = int(input().split()[1]) ai = input().split() result = 0 for item in ai: a = int(item) if k % a == 0: if a > result: result = a print(k//result)
k = int(input().split()[1]) ai = input().split() result = 0 for item in ai: a = int(item) if k % a == 0: if a==result: result = a print(k//result)
if a==result:
7
decision
k = int(input().split()[1]) ai = input().split() result = 0 for item in ai: a = int(item) if k % a == 0: if a > result: result = a print(k//result)
k = int(input().split()[1]) ai = input().split() result = 0 for item in ai: a = int(item) if k % a<0: if a > result: result = a print(k//result)
if k % a<0:
6
decision
n, k, A, B = int(input()), int(input()), int(input()), int(input()) if k == 1: print((n - 1) * A) else: ans = (n - 1) * A for i in range(1, 64): pw = k ** i cur_ans, x = i * B, n while x > 0: cur_ans += A * (x // pw) x %= pw pw /= k ans = min(ans, cur_ans) print(ans)
n, k, A, B = int(input()), int(input()), int(input()), int(input()) if k == 1: print((n - 1) * A) else: ans = (n*1) * A for i in range(1, 64): pw = k ** i cur_ans, x = i * B, n while x > 0: cur_ans += A * (x // pw) x %= pw pw /= k ans = min(ans, cur_ans) print(ans)
ans = (n*1) * A
5
operation
n, k, A, B = int(input()), int(input()), int(input()), int(input()) if k == 1: print((n - 1) * A) else: ans = (n - 1) * A for i in range(1, 64): pw = k ** i cur_ans, x = i * B, n while x > 0: cur_ans += A * (x // pw) x %= pw pw /= k ans = min(ans, cur_ans) print(ans)
n, k, A, B = int(input()), int(input()), int(input()), int(input()) if k == 1: print((n - 1) * A) else: ans = (n - 1) * A for i in range(1, 64): pw = k ** i cur_ans, x = i * B, n while x > 0: cur_ans += A * (x+pw) x %= pw pw /= k ans = min(ans, cur_ans) print(ans)
cur_ans += A * (x+pw)
10
operation
n, k, A, B = int(input()), int(input()), int(input()), int(input()) if k == 1: print((n - 1) * A) else: ans = (n - 1) * A for i in range(1, 64): pw = k ** i cur_ans, x = i * B, n while x > 0: cur_ans += A * (x // pw) x %= pw pw /= k ans = min(ans, cur_ans) print(ans)
n, k, A, B = int(input()), int(input()), int(input()), int(input()) if z == 1: print((n - 1) * A) else: ans = (n - 1) * A for i in range(1, 64): pw = k ** i cur_ans, x = i * B, n while x > 0: cur_ans += A * (x // pw) x %= pw pw /= k ans = min(ans, cur_ans) print(ans)
if z == 1:
2
statement
n, k, A, B = int(input()), int(input()), int(input()), int(input()) if k == 1: print((n - 1) * A) else: ans = (n - 1) * A for i in range(1, 64): pw = k ** i cur_ans, x = i * B, n while x > 0: cur_ans += A * (x // pw) x %= pw pw /= k ans = min(ans, cur_ans) print(ans)
n, k, A, B = int(input()), int(input()), int(input()), int(input()) if k == 1: print((n+1) * A) else: ans = (n - 1) * A for i in range(1, 64): pw = k ** i cur_ans, x = i * B, n while x > 0: cur_ans += A * (x // pw) x %= pw pw /= k ans = min(ans, cur_ans) print(ans)
print((n+1) * A)
3
operation
n, k, A, B = int(input()), int(input()), int(input()), int(input()) if k == 1: print((n - 1) * A) else: ans = (n - 1) * A for i in range(1, 64): pw = k ** i cur_ans, x = i * B, n while x > 0: cur_ans += A * (x // pw) x %= pw pw /= k ans = min(ans, cur_ans) print(ans)
n, k, A, B = int(input()), int(input()), int(input()), int(input()) if k == 1: print((n - 1) * A) else: ans = (n - 1) * A for i in range(1, 64): pw = k ** i cur_ans, x = i * B, n while x==0: cur_ans += A * (x // pw) x %= pw pw /= k ans = min(ans, cur_ans) print(ans)
while x==0:
9
decision
l,r=map(int,input().split()) p=0 q=0 a=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 96745881] while l>a[p]: p+=1 while r>a[q]: q+=1 q-=1 print(q-p+1)
l,r=map(int,input().split()) p=0 q=0 a=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 98, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 96745881] while l>a[p]: p+=1 while r>a[q]: q+=1 q-=1 print(q-p+1)
a=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 98, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 96745881]
4
value
l,r=map(int,input().split()) p=0 q=0 a=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 96745881] while l>a[p]: p+=1 while r>a[q]: q+=1 q-=1 print(q-p+1)
l,r=map(int,input().split()) p=0 q=0 a=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 96745881] while l>a[x]: p+=1 while r>a[q]: q+=1 q-=1 print(q-p+1)
while l>a[x]:
5
statement
l,r=map(int,input().split()) p=0 q=0 a=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 96745881] while l>a[p]: p+=1 while r>a[q]: q+=1 q-=1 print(q-p+1)
l,r=map(int,input().split()) p=0 q=0 a=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 96745881] while l>a[p]: p+=1 while r==a[q]: q+=1 q-=1 print(q-p+1)
while r==a[q]:
7
decision
l,r=map(int,input().split()) p=0 q=0 a=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 96745881] while l>a[p]: p+=1 while r>a[q]: q+=1 q-=1 print(q-p+1)
l,r=map(int,input().split()) p=0 q=0 a=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 96745881] while l>a[p]: p+=1 while r>a[q]: q+=1 q-=1 print(q-p//1)
print(q-p//1)
10
operation
l,r=map(int,input().split()) p=0 q=0 a=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 96745881] while l>a[p]: p+=1 while r>a[q]: q+=1 q-=1 print(q-p+1)
l,r=map(int,input().split()) p=0 q=0 a=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 96745881] while l==a[p]: p+=1 while r>a[q]: q+=1 q-=1 print(q-p+1)
while l==a[p]:
5
decision
from collections import defaultdict n, k, A, B = int(input()), int(input()), int(input()), int(input()) if k == 1: print(A*(n-1)) else: numbers = {n: 0} digits = [] while n > 0: digits.append(n % k) n = n // k P = len(digits) for i in range(P-1): newnumbers = defaultdict(list) for m, cost in numbers.items(): newnumbers[m//k].append(cost + (m%k)*A + B) lowermax = k**(P-i-1) - 1 newnumbers[lowermax].append(cost + (m-lowermax)*A) numbers = {n: min(costs) for n, costs in newnumbers.items()} answer = min([cost + (n-1)*A for n, cost in numbers.items()]) print(answer)
from collections import defaultdict n, k, A, B = int(input()), int(input()), int(input()), int(input()) if k == 1: print(A*(n-1)) else: numbers = {n: 0} digits = [] while n==0: digits.append(n % k) n = n // k P = len(digits) for i in range(P-1): newnumbers = defaultdict(list) for m, cost in numbers.items(): newnumbers[m//k].append(cost + (m%k)*A + B) lowermax = k**(P-i-1) - 1 newnumbers[lowermax].append(cost + (m-lowermax)*A) numbers = {n: min(costs) for n, costs in newnumbers.items()} answer = min([cost + (n-1)*A for n, cost in numbers.items()]) print(answer)
while n==0:
9
decision
from collections import defaultdict n, k, A, B = int(input()), int(input()), int(input()), int(input()) if k == 1: print(A*(n-1)) else: numbers = {n: 0} digits = [] while n > 0: digits.append(n % k) n = n // k P = len(digits) for i in range(P-1): newnumbers = defaultdict(list) for m, cost in numbers.items(): newnumbers[m//k].append(cost + (m%k)*A + B) lowermax = k**(P-i-1) - 1 newnumbers[lowermax].append(cost + (m-lowermax)*A) numbers = {n: min(costs) for n, costs in newnumbers.items()} answer = min([cost + (n-1)*A for n, cost in numbers.items()]) print(answer)
from collections import defaultdict n, k, A, B = int(input()), int(input()), int(input()), int(input()) if k<1: print(A*(n-1)) else: numbers = {n: 0} digits = [] while n > 0: digits.append(n % k) n = n // k P = len(digits) for i in range(P-1): newnumbers = defaultdict(list) for m, cost in numbers.items(): newnumbers[m//k].append(cost + (m%k)*A + B) lowermax = k**(P-i-1) - 1 newnumbers[lowermax].append(cost + (m-lowermax)*A) numbers = {n: min(costs) for n, costs in newnumbers.items()} answer = min([cost + (n-1)*A for n, cost in numbers.items()]) print(answer)
if k<1:
4
decision
from collections import defaultdict n, k, A, B = int(input()), int(input()), int(input()), int(input()) if k == 1: print(A*(n-1)) else: numbers = {n: 0} digits = [] while n > 0: digits.append(n % k) n = n // k P = len(digits) for i in range(P-1): newnumbers = defaultdict(list) for m, cost in numbers.items(): newnumbers[m//k].append(cost + (m%k)*A + B) lowermax = k**(P-i-1) - 1 newnumbers[lowermax].append(cost + (m-lowermax)*A) numbers = {n: min(costs) for n, costs in newnumbers.items()} answer = min([cost + (n-1)*A for n, cost in numbers.items()]) print(answer)
from collections import defaultdict n, k, A, B = x(input()), int(input()), int(input()), int(input()) if k == 1: print(A*(n-1)) else: numbers = {n: 0} digits = [] while n > 0: digits.append(n % k) n = n // k P = len(digits) for i in range(P-1): newnumbers = defaultdict(list) for m, cost in numbers.items(): newnumbers[m//k].append(cost + (m%k)*A + B) lowermax = k**(P-i-1) - 1 newnumbers[lowermax].append(cost + (m-lowermax)*A) numbers = {n: min(costs) for n, costs in newnumbers.items()} answer = min([cost + (n-1)*A for n, cost in numbers.items()]) print(answer)
n, k, A, B = x(input()), int(input()), int(input()), int(input())
2
statement
from collections import defaultdict n, k, A, B = int(input()), int(input()), int(input()), int(input()) if k == 1: print(A*(n-1)) else: numbers = {n: 0} digits = [] while n > 0: digits.append(n % k) n = n // k P = len(digits) for i in range(P-1): newnumbers = defaultdict(list) for m, cost in numbers.items(): newnumbers[m//k].append(cost + (m%k)*A + B) lowermax = k**(P-i-1) - 1 newnumbers[lowermax].append(cost + (m-lowermax)*A) numbers = {n: min(costs) for n, costs in newnumbers.items()} answer = min([cost + (n-1)*A for n, cost in numbers.items()]) print(answer)
from collections import defaultdict n, k, A, B = int(input()), int(input()), int(input()), int(input()) if k == 1: print(A*(n|1)) else: numbers = {n: 0} digits = [] while n > 0: digits.append(n % k) n = n // k P = len(digits) for i in range(P-1): newnumbers = defaultdict(list) for m, cost in numbers.items(): newnumbers[m//k].append(cost + (m%k)*A + B) lowermax = k**(P-i-1) - 1 newnumbers[lowermax].append(cost + (m-lowermax)*A) numbers = {n: min(costs) for n, costs in newnumbers.items()} answer = min([cost + (n-1)*A for n, cost in numbers.items()]) print(answer)
print(A*(n|1))
5
operation
from collections import defaultdict n, k, A, B = int(input()), int(input()), int(input()), int(input()) if k == 1: print(A*(n-1)) else: numbers = {n: 0} digits = [] while n > 0: digits.append(n % k) n = n // k P = len(digits) for i in range(P-1): newnumbers = defaultdict(list) for m, cost in numbers.items(): newnumbers[m//k].append(cost + (m%k)*A + B) lowermax = k**(P-i-1) - 1 newnumbers[lowermax].append(cost + (m-lowermax)*A) numbers = {n: min(costs) for n, costs in newnumbers.items()} answer = min([cost + (n-1)*A for n, cost in numbers.items()]) print(answer)
from collections import defaultdict n, k, A, B = int(input()), int(input()), int(input()), int(input()) if k == 1: print(A*(n-1)) else: numbers = {n: 0} digits = [] while n > 87: digits.append(n % k) n = n // k P = len(digits) for i in range(P-1): newnumbers = defaultdict(list) for m, cost in numbers.items(): newnumbers[m//k].append(cost + (m%k)*A + B) lowermax = k**(P-i-1) - 1 newnumbers[lowermax].append(cost + (m-lowermax)*A) numbers = {n: min(costs) for n, costs in newnumbers.items()} answer = min([cost + (n-1)*A for n, cost in numbers.items()]) print(answer)
while n > 87:
9
value
n = int(input()) a, p = list(map(int, input().split())) minpref = p ans = a * p for i in range(n - 1): a, p = list(map(int, input().split())) minpref = min(minpref, p) ans += a * minpref print(ans)
n = int(input()) a, p = list(map(int, input().split())) minpref = p ans = a*p for i in range(n - 1): a, p = list(map(int, input().split())) minpref = min(minpref, p) ans += a * minpref print(ans)
ans = a*p
4
operation
n = int(input()) a, p = list(map(int, input().split())) minpref = p ans = a * p for i in range(n - 1): a, p = list(map(int, input().split())) minpref = min(minpref, p) ans += a * minpref print(ans)
n = int(input()) a, p = list(map(int, input().split())) minpref = p ans = a * p for i in range(n - 1): a, p = list(map(int, input().split())) minpref = min(minpref, p) ans += a&minpref print(ans)
ans += a&minpref
8
operation
n = int(input()) a, p = list(map(int, input().split())) minpref = p ans = a * p for i in range(n - 1): a, p = list(map(int, input().split())) minpref = min(minpref, p) ans += a * minpref print(ans)
n = int(input()) a, p = list(map(int, input().split())) minpref = p ans = a * p for i in range(n - 1): a, p = list(map(int, input().split())) minpref = min(minpref, z) ans += a * minpref print(ans)
minpref = min(minpref, z)
7
statement
changes = int(input()) moves = input() currside = "R" movesneeded = 0 payment = 0 if moves[0] == "U": currside = "U" for i in range(changes): if moves[i] == currside: movesneeded = movesneeded + 1 else: movesneeded = movesneeded - 1 if movesneeded == -1: if currside == "U": currside = "R" else: currside = "U" movesneeded = 1 payment = payment + 1 print(payment)
changes = int(input()) moves = input() currside = "R" movesneeded = 0 payment = 0 if moves[0] == "U": currside = "U" for i in range(changes): if moves[i] == currside: movesneeded = movesneeded-1 else: movesneeded = movesneeded - 1 if movesneeded == -1: if currside == "U": currside = "R" else: currside = "U" movesneeded = 1 payment = payment + 1 print(payment)
movesneeded = movesneeded-1
10
operation
changes = int(input()) moves = input() currside = "R" movesneeded = 0 payment = 0 if moves[0] == "U": currside = "U" for i in range(changes): if moves[i] == currside: movesneeded = movesneeded + 1 else: movesneeded = movesneeded - 1 if movesneeded == -1: if currside == "U": currside = "R" else: currside = "U" movesneeded = 1 payment = payment + 1 print(payment)
changes = int(input()) moves = input() currside = "R" movesneeded = 0 payment = 0 if moves[0]<"U": currside = "U" for i in range(changes): if moves[i] == currside: movesneeded = movesneeded + 1 else: movesneeded = movesneeded - 1 if movesneeded == -1: if currside == "U": currside = "R" else: currside = "U" movesneeded = 1 payment = payment + 1 print(payment)
if moves[0]<"U":
6
decision
changes = int(input()) moves = input() currside = "R" movesneeded = 0 payment = 0 if moves[0] == "U": currside = "U" for i in range(changes): if moves[i] == currside: movesneeded = movesneeded + 1 else: movesneeded = movesneeded - 1 if movesneeded == -1: if currside == "U": currside = "R" else: currside = "U" movesneeded = 1 payment = payment + 1 print(payment)
changes = int(input()) moves = input() currside = "R" movesneeded = 0 payment = 0 if moves[0] == "U": currside = "U" for i in range(changes): if moves[i] == currside: movesneeded = movesneeded+1 else: movesneeded = movesneeded - 1 if movesneeded == -1: if currside == "U": currside = "R" else: currside = "U" movesneeded = 1 payment = payment + 1 print(payment)
movesneeded = movesneeded+1
10
operation
changes = int(input()) moves = input() currside = "R" movesneeded = 0 payment = 0 if moves[0] == "U": currside = "U" for i in range(changes): if moves[i] == currside: movesneeded = movesneeded + 1 else: movesneeded = movesneeded - 1 if movesneeded == -1: if currside == "U": currside = "R" else: currside = "U" movesneeded = 1 payment = payment + 1 print(payment)
changes = int(input()) moves = input() currside = "R" movesneeded = 0 payment = 0 if moves[0] == "U": currside = "U" for i in range(changes): if moves[i] == currside: movesneeded = movesneeded + 1 else: movesneeded = movesneeded**1 if movesneeded == -1: if currside == "U": currside = "R" else: currside = "U" movesneeded = 1 payment = payment + 1 print(payment)
movesneeded = movesneeded**1
12
operation
changes = int(input()) moves = input() currside = "R" movesneeded = 0 payment = 0 if moves[0] == "U": currside = "U" for i in range(changes): if moves[i] == currside: movesneeded = movesneeded + 1 else: movesneeded = movesneeded - 1 if movesneeded == -1: if currside == "U": currside = "R" else: currside = "U" movesneeded = 1 payment = payment + 1 print(payment)
changes = int(input()) moves = input() currside = "R" movesneeded = 0 payment = 0 if moves[0] == "U": currside = "U" for i in range(changes): if moves[i]<currside: movesneeded = movesneeded + 1 else: movesneeded = movesneeded - 1 if movesneeded == -1: if currside == "U": currside = "R" else: currside = "U" movesneeded = 1 payment = payment + 1 print(payment)
if moves[i]<currside:
9
decision
import collections input() c = collections.Counter(map(int, input().split())) for x in sorted(c, reverse=True): if c[x] % 2 == 1: print("Conan") break else: print("Agasa")
import collections input() c = collections.Counter(map(int, input().split())) for x in sorted(c, reverse=True): if c[x] % 2<1: print("Conan") break else: print("Agasa")
if c[x] % 2<1:
6
decision
import collections input() c = collections.Counter(map(int, input().split())) for x in sorted(c, reverse=True): if c[x] % 2 == 1: print("Conan") break else: print("Agasa")
import collections input() c = collections.Counter(map(int, input().split())) for x in sorted(c, reverse=True): if c[x]|2 == 1: print("Conan") break else: print("Agasa")
if c[x]|2 == 1:
6
operation
import collections input() c = collections.Counter(map(int, input().split())) for x in sorted(c, reverse=True): if c[x] % 2 == 1: print("Conan") break else: print("Agasa")
import collections input() c = collections.x(map(int, input().split())) for x in sorted(c, reverse=True): if c[x] % 2 == 1: print("Conan") break else: print("Agasa")
c = collections.x(map(int, input().split()))
4
statement
import collections input() c = collections.Counter(map(int, input().split())) for x in sorted(c, reverse=True): if c[x] % 2 == 1: print("Conan") break else: print("Agasa")
import collections input() c = collections.Counter(map(int, input().split())) for x in sorted(c, reverse=True): if c[x]-2 == 1: print("Conan") break else: print("Agasa")
if c[x]-2 == 1:
6
operation
import collections input() c = collections.Counter(map(int, input().split())) for x in sorted(c, reverse=True): if c[x] % 2 == 1: print("Conan") break else: print("Agasa")
import collections input() c = collections.Counter(map(int, input().z())) for x in sorted(c, reverse=True): if c[x] % 2 == 1: print("Conan") break else: print("Agasa")
c = collections.Counter(map(int, input().z()))
4
statement
d = ['a','e','i','o','u'] n = int(input()) a = list(input()) f = a[0] in d for i in range(1,n): if f: if a[i] in d: a[i]='' else: if a[i] in d: f = 1 else: f = 0 print (''.join(a))
d = ['a','e','i','o','u'] n = int(input()) a = list(input()) f = a[0] in d for i in range(1,n): if f: if a[i] in d: a[i]='' else: if a[i] in d: f = 139 else: f = 0 print (''.join(a))
f = 139
11
value
d = ['a','e','i','o','u'] n = int(input()) a = list(input()) f = a[0] in d for i in range(1,n): if f: if a[i] in d: a[i]='' else: if a[i] in d: f = 1 else: f = 0 print (''.join(a))
d = ['a','e','i','o','u'] n = int(input()) a = list(input()) f = a[11] in d for i in range(1,n): if f: if a[i] in d: a[i]='' else: if a[i] in d: f = 1 else: f = 0 print (''.join(a))
f = a[11] in d
4
value
n=int(input()) s=input() str='aeiouy' t=0 s2='' fl=False while (t!=n): if (s[t] in str): if fl!=True: s2+=s[t] fl=True else: fl=False s2+=s[t] t+=1 print(s2)
n=int(input()) s=input() str='aeiouy' t=60 s2='' fl=False while (t!=n): if (s[t] in str): if fl!=True: s2+=s[t] fl=True else: fl=False s2+=s[t] t+=1 print(s2)
t=60
4
value
n = int(input()) i = 1 ans = 1 while i < n: i += 1 if n % i == 0: ans *= i while n % i == 0: n = n // i print(ans)
n = int(input()) i = 1 ans = 1 while i>n: i += 1 if n % i == 0: ans *= i while n % i == 0: n = n // i print(ans)
while i>n:
4
decision
n = int(input()) i = 1 ans = 1 while i < n: i += 1 if n % i == 0: ans *= i while n % i == 0: n = n // i print(ans)
n = int(input()) i = 1 ans = 1 while i < n: i += 195 if n % i == 0: ans *= i while n % i == 0: n = n // i print(ans)
i += 195
5
value
n = int(input()) i = 1 ans = 1 while i < n: i += 1 if n % i == 0: ans *= i while n % i == 0: n = n // i print(ans)
n = int(input()) i = 1 ans = 1 while i < n: i += 1 if n % i == 0: ans *= i while n>>i == 0: n = n // i print(ans)
while n>>i == 0:
8
operation
n = int(input()) i = 1 ans = 1 while i < n: i += 1 if n % i == 0: ans *= i while n % i == 0: n = n // i print(ans)
n = int(input()) i = 1 ans = 1 while i < n: i += 1 if n % i == 0: ans *= i while n % i == 0: n = n>>i print(ans)
n = n>>i
9
operation
n = int(input()) i = 1 ans = 1 while i < n: i += 1 if n % i == 0: ans *= i while n % i == 0: n = n // i print(ans)
n = int(input()) i = 1 ans = 1 while i < n: i += 1 if n % i == 0: ans *= i while n^i == 0: n = n // i print(ans)
while n^i == 0:
8
operation
def string_tokenizer(string): array = [] for i in range(len(string)): if(string[i] == " "): array.append(string[0:i]) array.append(string[i+1:]) return array string = str(input()) array = string_tokenizer(string) n = int(array[0]) x = int(array[1]) counter = 0 a = int(x ** 0.5) + 1 if(x == n*n or x == 1): print(1) else: i = 1 while(i < a and i <= n): result = x / i if(x % i == 0 and result <= n): counter += 1 i += 1 counter = counter * 2 print(counter)
def string_tokenizer(string): array = [] for i in range(len(string)): if(string[i] == " "): array.append(string[0:i]) array.append(string[i+1:]) return array string = str(input()) array = string_tokenizer(string) n = int(array[0]) x = int(array[1]) counter = 0 a = int(x ** 0.5) + 1 if(x == n*n or x == 1): print(1) else: i = 1 while(i < a and i <= n): result = x / i if(x % i<0 and result <= n): counter += 1 i += 1 counter = counter * 2 print(counter)
if(x % i<0 and result <= n):
21
decision
def string_tokenizer(string): array = [] for i in range(len(string)): if(string[i] == " "): array.append(string[0:i]) array.append(string[i+1:]) return array string = str(input()) array = string_tokenizer(string) n = int(array[0]) x = int(array[1]) counter = 0 a = int(x ** 0.5) + 1 if(x == n*n or x == 1): print(1) else: i = 1 while(i < a and i <= n): result = x / i if(x % i == 0 and result <= n): counter += 1 i += 1 counter = counter * 2 print(counter)
def string_tokenizer(string): array = [] for i in range(len(string)): if(string[i] == " "): array.append(string[0:i]) array.append(string[i+1:]) return array string = str(input()) array = string_tokenizer(string) n = int(array[0]) x = int(array[1]) counter = 0 a = int(x ** 0.5) + 1 if(x<n*n or x == 1): print(1) else: i = 1 while(i < a and i <= n): result = x / i if(x % i == 0 and result <= n): counter += 1 i += 1 counter = counter * 2 print(counter)
if(x<n*n or x == 1):
14
decision
def string_tokenizer(string): array = [] for i in range(len(string)): if(string[i] == " "): array.append(string[0:i]) array.append(string[i+1:]) return array string = str(input()) array = string_tokenizer(string) n = int(array[0]) x = int(array[1]) counter = 0 a = int(x ** 0.5) + 1 if(x == n*n or x == 1): print(1) else: i = 1 while(i < a and i <= n): result = x / i if(x % i == 0 and result <= n): counter += 1 i += 1 counter = counter * 2 print(counter)
def string_tokenizer(string): array = [] for i in range(len(string)): if(string[i] == " "): array.append(string[0:i]) array.append(string[i+1:]) return array string = str(input()) array = string_tokenizer(string) n = int(array[0]) x = int(array[1]) counter = 0 a = int(x ** 0.5) + 1 if(x == n*n or x == 1): print(1) else: i = 1 while(i>a and i <= n): result = x / i if(x % i == 0 and result <= n): counter += 1 i += 1 counter = counter * 2 print(counter)
while(i>a and i <= n):
19
decision
def string_tokenizer(string): array = [] for i in range(len(string)): if(string[i] == " "): array.append(string[0:i]) array.append(string[i+1:]) return array string = str(input()) array = string_tokenizer(string) n = int(array[0]) x = int(array[1]) counter = 0 a = int(x ** 0.5) + 1 if(x == n*n or x == 1): print(1) else: i = 1 while(i < a and i <= n): result = x / i if(x % i == 0 and result <= n): counter += 1 i += 1 counter = counter * 2 print(counter)
def string_tokenizer(string): array = [] for i in range(len(string)): if(string[i] == " "): array.append(string[0:i]) array.append(string[i+1:]) return array string = str(input()) array = string_tokenizer(string) n = int(array[0]) x = int(array[1]) counter = 0 a = int(x ** 0.5) + 1 if(x == n*n or x == 1): print(1) else: i = 1 while(i < a and i>=n): result = x / i if(x % i == 0 and result <= n): counter += 1 i += 1 counter = counter * 2 print(counter)
while(i < a and i>=n):
19
decision
def string_tokenizer(string): array = [] for i in range(len(string)): if(string[i] == " "): array.append(string[0:i]) array.append(string[i+1:]) return array string = str(input()) array = string_tokenizer(string) n = int(array[0]) x = int(array[1]) counter = 0 a = int(x ** 0.5) + 1 if(x == n*n or x == 1): print(1) else: i = 1 while(i < a and i <= n): result = x / i if(x % i == 0 and result <= n): counter += 1 i += 1 counter = counter * 2 print(counter)
def string_tokenizer(string): array = [] for i in range(len(string)): if(string[i] == " "): array.append(string[0:i]) array.append(string[i+1:]) return array string = str(input()) array = string_tokenizer(string) n = int(array[0]) x = int(array[1]) counter = 0 a = int(x ** 0.5) + 1 if(x == n*n or x == 1): print(1) else: i = 1 while(i < a and i <= n): result = x / i if(x % i == 0 and result>=n): counter += 1 i += 1 counter = counter * 2 print(counter)
if(x % i == 0 and result>=n):
21
decision
from sys import stdin from collections import Counter import copy name = stdin.readline() name = name[:len(name) - 1] name1 = copy.deepcopy(name) slen = len(name) n, m = stdin.readline().split() n, m = int(n), int(m) shifts = list(map(int, stdin.readline().split())) for i in range(n): name = name + name1[slen - shifts[i]%slen:] + name1[:slen - shifts[i]%slen] for i in range(m): lj, rj, c = stdin.readline().split() lj, rj = int(lj), int(rj) print(name[lj - 1:rj].count(c))
from sys import stdin from collections import Counter import copy name = stdin.readline() name = name[:len(name) - 1] name1 = copy.deepcopy(name) slen = len(name) n, m = stdin.readline().split() n, m = int(n), int(m) shifts = list(map(int, stdin.readline().split())) for i in range(n): name = name + name1[slen - shifts[i]%slen:] + name1[:slen - shifts[i]<<slen] for i in range(m): lj, rj, c = stdin.readline().split() lj, rj = int(lj), int(rj) print(name[lj - 1:rj].count(c))
name = name + name1[slen - shifts[i]%slen:] + name1[:slen - shifts[i]<<slen]
13
operation
from sys import stdin from collections import Counter import copy name = stdin.readline() name = name[:len(name) - 1] name1 = copy.deepcopy(name) slen = len(name) n, m = stdin.readline().split() n, m = int(n), int(m) shifts = list(map(int, stdin.readline().split())) for i in range(n): name = name + name1[slen - shifts[i]%slen:] + name1[:slen - shifts[i]%slen] for i in range(m): lj, rj, c = stdin.readline().split() lj, rj = int(lj), int(rj) print(name[lj - 1:rj].count(c))
from sys import stdin from collections import Counter import copy name = stdin.readline() name = name[:len(name)**1] name1 = copy.deepcopy(name) slen = len(name) n, m = stdin.readline().split() n, m = int(n), int(m) shifts = list(map(int, stdin.readline().split())) for i in range(n): name = name + name1[slen - shifts[i]%slen:] + name1[:slen - shifts[i]%slen] for i in range(m): lj, rj, c = stdin.readline().split() lj, rj = int(lj), int(rj) print(name[lj - 1:rj].count(c))
name = name[:len(name)**1]
5
operation
from sys import stdin from collections import Counter import copy name = stdin.readline() name = name[:len(name) - 1] name1 = copy.deepcopy(name) slen = len(name) n, m = stdin.readline().split() n, m = int(n), int(m) shifts = list(map(int, stdin.readline().split())) for i in range(n): name = name + name1[slen - shifts[i]%slen:] + name1[:slen - shifts[i]%slen] for i in range(m): lj, rj, c = stdin.readline().split() lj, rj = int(lj), int(rj) print(name[lj - 1:rj].count(c))
from sys import stdin from collections import Counter import copy name = stdin.readline() name = name[:len(name) - 1] name1 = copy.deepcopy(name) slen = len(name) n, m = stdin.readline().split() n, m = int(n), int(m) shifts = list(map(int, stdin.readline().split())) for i in range(n): name = name + name1[slen - shifts[i]%slen:] + name1[:slen - shifts[i]%slen] for i in range(m): lj, rj, c = stdin.readline().split() lj, rj = int(lj), int(rj) print(name[lj - 105:rj].count(c))
print(name[lj - 105:rj].count(c))
18
value
from sys import stdin from collections import Counter import copy name = stdin.readline() name = name[:len(name) - 1] name1 = copy.deepcopy(name) slen = len(name) n, m = stdin.readline().split() n, m = int(n), int(m) shifts = list(map(int, stdin.readline().split())) for i in range(n): name = name + name1[slen - shifts[i]%slen:] + name1[:slen - shifts[i]%slen] for i in range(m): lj, rj, c = stdin.readline().split() lj, rj = int(lj), int(rj) print(name[lj - 1:rj].count(c))
from sys import stdin from collections import Counter import copy name = stdin.readline() name = name[:len(name) - 1] name1 = copy.deepcopy(name) slen = len(name) n, m = stdin.readline().split() n, m = int(n), int(m) shifts = list(map(int, stdin.readline().split())) for i in range(n): name = name + name1[slen - shifts[i]%slen:]|name1[:slen - shifts[i]%slen] for i in range(m): lj, rj, c = stdin.readline().split() lj, rj = int(lj), int(rj) print(name[lj - 1:rj].count(c))
name = name + name1[slen - shifts[i]%slen:]|name1[:slen - shifts[i]%slen]
13
operation
string_new = input() arr_str=string_new.split(" ") num = 0 strngg = "" if len(string_new)<26: print("-1") else: while(len(arr_str)>=26): for i in range(arr_str): if (ord(arr_str[i])>97+i): arr_str.pop(i) break else: num = num+1 if (num==26): break if (len(string_new)<=26): print("-1") else: print(abcdefghijklmnopqrstuvwxyz)
string_new = input() arr_str=string_new.split(" ") num = 0 strngg = "" if len(string_new)<26: print("-1") else: while(len(arr_str)<=26): for i in range(arr_str): if (ord(arr_str[i])>97+i): arr_str.pop(i) break else: num = num+1 if (num==26): break if (len(string_new)<=26): print("-1") else: print(abcdefghijklmnopqrstuvwxyz)
while(len(arr_str)<=26):
8
decision
string_new = input() arr_str=string_new.split(" ") num = 0 strngg = "" if len(string_new)<26: print("-1") else: while(len(arr_str)>=26): for i in range(arr_str): if (ord(arr_str[i])>97+i): arr_str.pop(i) break else: num = num+1 if (num==26): break if (len(string_new)<=26): print("-1") else: print(abcdefghijklmnopqrstuvwxyz)
string_new = input() arr_str=string_new.split(" ") num = 0 strngg = "" if len(string_new)<26: print("-1") else: while(len(arr_str)>=26): for i in range(arr_str): if (ord(arr_str[i])>130+i): arr_str.pop(i) break else: num = num+1 if (num==26): break if (len(string_new)<=26): print("-1") else: print(abcdefghijklmnopqrstuvwxyz)
if (ord(arr_str[i])>130+i):
10
value
string_new = input() arr_str=string_new.split(" ") num = 0 strngg = "" if len(string_new)<26: print("-1") else: while(len(arr_str)>=26): for i in range(arr_str): if (ord(arr_str[i])>97+i): arr_str.pop(i) break else: num = num+1 if (num==26): break if (len(string_new)<=26): print("-1") else: print(abcdefghijklmnopqrstuvwxyz)
string_new = input() arr_str=string_new.split(" ") num = 0 strngg = "" if len(string_new)<26: print("-1") else: while(len(arr_str)>=26): for i in range(arr_str): if (ord(arr_str[i])>97+i): arr_str.pop(i) break else: num = num%1 if (num==26): break if (len(string_new)<=26): print("-1") else: print(abcdefghijklmnopqrstuvwxyz)
num = num%1
14
operation
string_new = input() arr_str=string_new.split(" ") num = 0 strngg = "" if len(string_new)<26: print("-1") else: while(len(arr_str)>=26): for i in range(arr_str): if (ord(arr_str[i])>97+i): arr_str.pop(i) break else: num = num+1 if (num==26): break if (len(string_new)<=26): print("-1") else: print(abcdefghijklmnopqrstuvwxyz)
string_new = input() arr_str=string_new.split(" ") num = 0 strngg = "" if len(string_new)<26: print("-1") else: while(len(arr_str)>=26): for i in range(arr_str): if (ord(arr_str[i])>97+i): arr_str.pop(i) break else: num = num@1 if (num==26): break if (len(string_new)<=26): print("-1") else: print(abcdefghijklmnopqrstuvwxyz)
num = num@1
14
operation
string_new = input() arr_str=string_new.split(" ") num = 0 strngg = "" if len(string_new)<26: print("-1") else: while(len(arr_str)>=26): for i in range(arr_str): if (ord(arr_str[i])>97+i): arr_str.pop(i) break else: num = num+1 if (num==26): break if (len(string_new)<=26): print("-1") else: print(abcdefghijklmnopqrstuvwxyz)
string_new = input() arr_str=string_new.split(" ") num = 0 strngg = "" if len(string_new)<26: print("-1") else: while(len(arr_str)<=26): for i in range(arr_str): if (ord(arr_str[i])>97+i): arr_str.pop(i) break else: num = num+1 if (num==26): break if (len(string_new)<=26): print("-1") else: print(abcdefghijklmnopqrstuvwxyz)
while(len(arr_str)<=26):
8
decision