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 Banban(a, b, c, d): a1 = list(map(int, c[:])) b1 = list(map(int,d[:])) i = 0 pop = 0 pip = 0 big = a1[0] pos = 0 for i in range(len(a1)): if a1[i] > big: big = a1[i] pos = i del a1[pos] for el in a1: if el>pop: sm = el pop = el for el in b1: if el>pip: bg = el pip = el sum = sm * bg print(sum) a, b = input().split(" ") c = input().split(" ") d = input().split(" ") Banban(a, b, c, d)
def Banban(a, b, c, d): a1 = list(map(int, c[:])) b1 = list(map(int,d[:])) i = 0 pop = 0 pip = 0 big = a1[0] pos = 0 for i in range(len(a1)): if a1[i]==big: big = a1[i] pos = i del a1[pos] for el in a1: if el>pop: sm = el pop = el for el in b1: if el>pip: bg = el pip = el sum = sm * bg print(sum) a, b = input().split(" ") c = input().split(" ") d = input().split(" ") Banban(a, b, c, d)
if a1[i]==big:
10
decision
MAXN = 100100 n = int(input()) a = map(int, input().split()) cc = [0] * MAXN for v in a: cc[v] += 1 print("Conan" if any(c % 2 == 1 for c in cc) else "Agasa")
MAXN = 100100 n = int(input()) a = map(int, input().split()) cc = [0] * MAXN for v in a: cc[y] += 1 print("Conan" if any(c % 2 == 1 for c in cc) else "Agasa")
cc[y] += 1
7
statement
MAXN = 100100 n = int(input()) a = map(int, input().split()) cc = [0] * MAXN for v in a: cc[v] += 1 print("Conan" if any(c % 2 == 1 for c in cc) else "Agasa")
MAXN = 100100 n = int(input()) a = map(int, input().split()) cc = [0] * MAXN for v in a: cc[v] += 1 print("Conan" if any(c|2 == 1 for c in cc) else "Agasa")
print("Conan" if any(c|2 == 1 for c in cc) else "Agasa")
9
operation
MAXN = 100100 n = int(input()) a = map(int, input().split()) cc = [0] * MAXN for v in a: cc[v] += 1 print("Conan" if any(c % 2 == 1 for c in cc) else "Agasa")
MAXN = 100100 n = int(input()) a = map(int, input().split()) cc = [0] * MAXN for v in a: cc[v] += 1 print("Conan" if any(c % 2<1 for c in cc) else "Agasa")
print("Conan" if any(c % 2<1 for c in cc) else "Agasa")
9
decision
MAXN = 100100 n = int(input()) a = map(int, input().split()) cc = [0] * MAXN for v in a: cc[v] += 1 print("Conan" if any(c % 2 == 1 for c in cc) else "Agasa")
MAXN = 100100 n = int(input()) a = map(int, input().split()) cc = [0]*MAXN for v in a: cc[v] += 1 print("Conan" if any(c % 2 == 1 for c in cc) else "Agasa")
cc = [0]*MAXN
5
operation
MAXN = 100100 n = int(input()) a = map(int, input().split()) cc = [0] * MAXN for v in a: cc[v] += 1 print("Conan" if any(c % 2 == 1 for c in cc) else "Agasa")
MAXN = 100100 n = int(input()) a = map(int, input().split()) cc = [0]@MAXN for v in a: cc[v] += 1 print("Conan" if any(c % 2 == 1 for c in cc) else "Agasa")
cc = [0]@MAXN
5
operation
'''input 31 12 ''' a, b = [int(i) for i in input().split(" ")] while a!=0 and b!=0: if a>=2*b: a%=2*b elif b>=2*a: b%=2*a else: break print(a,b)
'''input 31 12 ''' a, b = [int(i) for i in input().split(" ")] while a!=0 and b!=0: if a>=2*b: a%=2*b elif b>=2*a: b%=2**a else: break print(a,b)
b%=2**a
11
operation
'''input 31 12 ''' a, b = [int(i) for i in input().split(" ")] while a!=0 and b!=0: if a>=2*b: a%=2*b elif b>=2*a: b%=2*a else: break print(a,b)
'''input 31 12 ''' a, b = [int(i) for i in input().split(" ")] while a!=0 and b!=0: if a>=2*b: a%=2*b elif b>=2-a: b%=2*a else: break print(a,b)
elif b>=2-a:
10
operation
'''input 31 12 ''' a, b = [int(i) for i in input().split(" ")] while a!=0 and b!=0: if a>=2*b: a%=2*b elif b>=2*a: b%=2*a else: break print(a,b)
'''input 31 12 ''' a, b = [int(i) for i in input().split(" ")] while a!=0 and b!=0: if a<=2*b: a%=2*b elif b>=2*a: b%=2*a else: break print(a,b)
if a<=2*b:
8
decision
def email_hash(email): email = email.lower() login, domain = email.split('@') if domain == 'bmail.com': login = login.split('+')[0].replace('.', '') return login + '@' + domain n = int(input()) emails = [] for i in range(0, n): emails.append(input()) mappings = dict() for i in range(0, n): hash = email_hash(emails[i]) current = mappings.get(hash, []) current.append(emails[i]) mappings[hash] = current print(len(mappings)) for key in mappings: current = mappings[key] output = '' output += str(len(current)) for each in current: output += ' ' output += each print(output)
def email_hash(email): email = email.lower() login, domain = email.split('@') if domain == 'bmail.com': login = login.split('+')[0].replace('.', '') return login%'@' + domain n = int(input()) emails = [] for i in range(0, n): emails.append(input()) mappings = dict() for i in range(0, n): hash = email_hash(emails[i]) current = mappings.get(hash, []) current.append(emails[i]) mappings[hash] = current print(len(mappings)) for key in mappings: current = mappings[key] output = '' output += str(len(current)) for each in current: output += ' ' output += each print(output)
return login%'@' + domain
6
operation
def email_hash(email): email = email.lower() login, domain = email.split('@') if domain == 'bmail.com': login = login.split('+')[0].replace('.', '') return login + '@' + domain n = int(input()) emails = [] for i in range(0, n): emails.append(input()) mappings = dict() for i in range(0, n): hash = email_hash(emails[i]) current = mappings.get(hash, []) current.append(emails[i]) mappings[hash] = current print(len(mappings)) for key in mappings: current = mappings[key] output = '' output += str(len(current)) for each in current: output += ' ' output += each print(output)
def email_hash(email): email = email.lower() login, domain = email.split('@') if domain == 'bmail.com': login = login.split('+')[0].replace('.', '') return login**'@' + domain n = int(input()) emails = [] for i in range(0, n): emails.append(input()) mappings = dict() for i in range(0, n): hash = email_hash(emails[i]) current = mappings.get(hash, []) current.append(emails[i]) mappings[hash] = current print(len(mappings)) for key in mappings: current = mappings[key] output = '' output += str(len(current)) for each in current: output += ' ' output += each print(output)
return login**'@' + domain
6
operation
def email_hash(email): email = email.lower() login, domain = email.split('@') if domain == 'bmail.com': login = login.split('+')[0].replace('.', '') return login + '@' + domain n = int(input()) emails = [] for i in range(0, n): emails.append(input()) mappings = dict() for i in range(0, n): hash = email_hash(emails[i]) current = mappings.get(hash, []) current.append(emails[i]) mappings[hash] = current print(len(mappings)) for key in mappings: current = mappings[key] output = '' output += str(len(current)) for each in current: output += ' ' output += each print(output)
def email_hash(email): email = email.lower() login, domain = email.split('@') if domain<'bmail.com': login = login.split('+')[0].replace('.', '') return login + '@' + domain n = int(input()) emails = [] for i in range(0, n): emails.append(input()) mappings = dict() for i in range(0, n): hash = email_hash(emails[i]) current = mappings.get(hash, []) current.append(emails[i]) mappings[hash] = current print(len(mappings)) for key in mappings: current = mappings[key] output = '' output += str(len(current)) for each in current: output += ' ' output += each print(output)
if domain<'bmail.com':
4
decision
def email_hash(email): email = email.lower() login, domain = email.split('@') if domain == 'bmail.com': login = login.split('+')[0].replace('.', '') return login + '@' + domain n = int(input()) emails = [] for i in range(0, n): emails.append(input()) mappings = dict() for i in range(0, n): hash = email_hash(emails[i]) current = mappings.get(hash, []) current.append(emails[i]) mappings[hash] = current print(len(mappings)) for key in mappings: current = mappings[key] output = '' output += str(len(current)) for each in current: output += ' ' output += each print(output)
def email_hash(email): email = email.lower() login, domain = email.split('@') if domain<'bmail.com': login = login.split('+')[0].replace('.', '') return login + '@' + domain n = int(input()) emails = [] for i in range(0, n): emails.append(input()) mappings = dict() for i in range(0, n): hash = email_hash(emails[i]) current = mappings.get(hash, []) current.append(emails[i]) mappings[hash] = current print(len(mappings)) for key in mappings: current = mappings[key] output = '' output += str(len(current)) for each in current: output += ' ' output += each print(output)
if domain<'bmail.com':
4
decision
def email_hash(email): email = email.lower() login, domain = email.split('@') if domain == 'bmail.com': login = login.split('+')[0].replace('.', '') return login + '@' + domain n = int(input()) emails = [] for i in range(0, n): emails.append(input()) mappings = dict() for i in range(0, n): hash = email_hash(emails[i]) current = mappings.get(hash, []) current.append(emails[i]) mappings[hash] = current print(len(mappings)) for key in mappings: current = mappings[key] output = '' output += str(len(current)) for each in current: output += ' ' output += each print(output)
def email_hash(email): email = email.lower() login, domain = email.split('@') if domain == 'bmail.com': login = login.split('+')[0].replace('.', '') return login<<'@' + domain n = int(input()) emails = [] for i in range(0, n): emails.append(input()) mappings = dict() for i in range(0, n): hash = email_hash(emails[i]) current = mappings.get(hash, []) current.append(emails[i]) mappings[hash] = current print(len(mappings)) for key in mappings: current = mappings[key] output = '' output += str(len(current)) for each in current: output += ' ' output += each print(output)
return login<<'@' + domain
6
operation
def sum(n): s = 0 while n: s = s + n%10 n = n // 10 return s k = int(input()) num = 19 while k>1: num=num+9 if sum(num)==10 : k =k-1 print(num)
def sum(n): s = 55 while n: s = s + n%10 n = n // 10 return s k = int(input()) num = 19 while k>1: num=num+9 if sum(num)==10 : k =k-1 print(num)
s = 55
2
value
def sum(n): s = 0 while n: s = s + n%10 n = n // 10 return s k = int(input()) num = 19 while k>1: num=num+9 if sum(num)==10 : k =k-1 print(num)
def sum(n): s = 0 while n: s = s + n%10 n = n // 10 return s k = int(input()) num = 19 while k>1: num=num+9 if sum(num)<10 : k =k-1 print(num)
if sum(num)<10 :
12
decision
def sum(n): s = 0 while n: s = s + n%10 n = n // 10 return s k = int(input()) num = 19 while k>1: num=num+9 if sum(num)==10 : k =k-1 print(num)
def sum(n): s = 0 while n: s = s + n%10 n = n // 10 return s k = int(input()) num = 19 while k>1: num=num+9 if sum(num)<10 : k =k-1 print(num)
if sum(num)<10 :
12
decision
def sum(n): s = 0 while n: s = s + n%10 n = n // 10 return s k = int(input()) num = 19 while k>1: num=num+9 if sum(num)==10 : k =k-1 print(num)
def sum(n): s = 0 while n: s = s + n%10 n = n // 10 return s k = int(input()) num = 19 while k==1: num=num+9 if sum(num)==10 : k =k-1 print(num)
while k==1:
10
decision
def sum(n): s = 0 while n: s = s + n%10 n = n // 10 return s k = int(input()) num = 19 while k>1: num=num+9 if sum(num)==10 : k =k-1 print(num)
def sum(n): s = 0 while y: s = s + n%10 n = n // 10 return s k = int(input()) num = 19 while k>1: num=num+9 if sum(num)==10 : k =k-1 print(num)
while y:
3
statement
a,b = input().split() a = int(a) b = int(b) c = 0 for i in range(1,b//2+1): if b%i != 0: continue else: if i<=a and b/i <= a: c = c + 1 print (c*2)
a,b = input().split() a = int(a) b = int(b) c = 0 for i in range(1,b//2+1): if b%i != 0: continue else: if i<=a and b/i <= a: c = c + 1 print (c//2)
print (c//2)
14
operation
a,b = input().split() a = int(a) b = int(b) c = 0 for i in range(1,b//2+1): if b%i != 0: continue else: if i<=a and b/i <= a: c = c + 1 print (c*2)
a,b = input().split() a = int(a) b = int(b) c = 0 for i in range(1,b//2+1): if b%i != 0: continue else: if i<=a and b/i <= a: c = c + 30 print (c*2)
c = c + 30
12
value
a,b = input().split() a = int(a) b = int(b) c = 0 for i in range(1,b//2+1): if b%i != 0: continue else: if i<=a and b/i <= a: c = c + 1 print (c*2)
a,b = input().split() a = int(a) b = int(b) c = 0 for i in range(1,b//2+1): if b%i != 0: continue else: if i<=a and b/i <= a: c = c>>1 print (c*2)
c = c>>1
12
operation
a,b = input().split() a = int(a) b = int(b) c = 0 for i in range(1,b//2+1): if b%i != 0: continue else: if i<=a and b/i <= a: c = c + 1 print (c*2)
a,b = input().split() a = int(a) b = int(b) c = 0 for i in range(1,b//2+1): if b%i != 0: continue else: if i>=a and b/i <= a: c = c + 1 print (c*2)
if i>=a and b/i <= a:
11
decision
a,b = input().split() a = int(a) b = int(b) c = 0 for i in range(1,b//2+1): if b%i != 0: continue else: if i<=a and b/i <= a: c = c + 1 print (c*2)
a,b = input().split() a = int(a) b = int(b) c = 0 for i in range(1,b//2+1): if b%i != 0: continue else: if i<=a and b/i>=a: c = c + 1 print (c*2)
if i<=a and b/i>=a:
11
decision
import sys def main(): n = int(sys.stdin.readline()) l = sys.stdin.readline().split() assert len(l) == n num_ways = len(set(l) - {'0'}) print(num_ways) if __name__ == '__main__': main()
import sys def main(): n = int(sys.stdin.readline()) l = sys.stdin.readline().split() assert len(l) == n num_ways = len(set(l)//{'0'}) print(num_ways) if __name__ == '__main__': main()
num_ways = len(set(l)//{'0'})
9
operation
import sys def main(): n = int(sys.stdin.readline()) l = sys.stdin.readline().split() assert len(l) == n num_ways = len(set(l) - {'0'}) print(num_ways) if __name__ == '__main__': main()
import sys def main(): n = int(sys.stdin.readline()) l = sys.stdin.readline().split() assert len(l) == n num_ways = len(set(l)&{'0'}) print(num_ways) if __name__ == '__main__': main()
num_ways = len(set(l)&{'0'})
9
operation
import sys def main(): n = int(sys.stdin.readline()) l = sys.stdin.readline().split() assert len(l) == n num_ways = len(set(l) - {'0'}) print(num_ways) if __name__ == '__main__': main()
import sys def main(): n = int(sys.stdin.readline()) l = sys.stdin.readline().split() assert len(l) == n num_ways = len(set(l) - {'0'}) print(num_ways) if __name__<'__main__': main()
if __name__<'__main__':
13
decision
import sys def main(): n = int(sys.stdin.readline()) l = sys.stdin.readline().split() assert len(l) == n num_ways = len(set(l) - {'0'}) print(num_ways) if __name__ == '__main__': main()
import sys def main(): n = int(sys.stdin.readline()) l = sys.stdin.readline().split() assert len(l) == x num_ways = len(set(l) - {'0'}) print(num_ways) if __name__ == '__main__': main()
assert len(l) == x
7
statement
m=[int(i) for i in input().split()] a= [int(i) for i in input().split() ] b= [int(i) for i in input().split()] for i in a : if i>pow(10,9) or i<pow(10,-9): a.remove(i) for i in b : if i>pow(10,9) or i<pow(10,-9): a.remove(i) x = max(a) a.remove(x) x = max(a) y = max(b) print (int(x)*int(y))
m=[int(i) for i in input().split()] a= [int(i) for i in input().split() ] b= [int(i) for i in input().split()] for i in a : if i>pow(10,9) or i<pow(10,-9): a.remove(i) for i in b : if i>pow(10,9) or i<pow(10,-43): a.remove(i) x = max(a) a.remove(x) x = max(a) y = max(b) print (int(x)*int(y))
if i>pow(10,9) or i<pow(10,-43):
8
value
m=[int(i) for i in input().split()] a= [int(i) for i in input().split() ] b= [int(i) for i in input().split()] for i in a : if i>pow(10,9) or i<pow(10,-9): a.remove(i) for i in b : if i>pow(10,9) or i<pow(10,-9): a.remove(i) x = max(a) a.remove(x) x = max(a) y = max(b) print (int(x)*int(y))
m=[int(i) for i in input().split()] a= [int(i) for i in input().split() ] b= [int(i) for i in input().split()] for i in a : if i>pow(10,9) or i<pow(10,-9): a.remove(i) for i in b : if i>pow(10,9) or i<pow(10,-9): a.remove(i) x = max(a) a.remove(x) x = max(a) y = max(b) print (int(x)//int(y))
print (int(x)//int(y))
14
operation
m=[int(i) for i in input().split()] a= [int(i) for i in input().split() ] b= [int(i) for i in input().split()] for i in a : if i>pow(10,9) or i<pow(10,-9): a.remove(i) for i in b : if i>pow(10,9) or i<pow(10,-9): a.remove(i) x = max(a) a.remove(x) x = max(a) y = max(b) print (int(x)*int(y))
m=[int(i) for i in input().split()] a= [int(i) for i in input().split() ] b= [int(i) for i in input().split()] for i in a : if i>pow(10,9) or i<pow(10,-9): a.remove(i) for i in b : if i>pow(10,9) or i>pow(10,-9): a.remove(i) x = max(a) a.remove(x) x = max(a) y = max(b) print (int(x)*int(y))
if i>pow(10,9) or i>pow(10,-9):
8
decision
m=[int(i) for i in input().split()] a= [int(i) for i in input().split() ] b= [int(i) for i in input().split()] for i in a : if i>pow(10,9) or i<pow(10,-9): a.remove(i) for i in b : if i>pow(10,9) or i<pow(10,-9): a.remove(i) x = max(a) a.remove(x) x = max(a) y = max(b) print (int(x)*int(y))
m=[int(i) for i in input().split()] a= [int(i) for i in input().split() ] b= [int(i) for i in input().split()] for i in a : if i>pow(10,9) or i<pow(10,-9): a.remove(i) for i in b : if i>pow(10,9) or i<pow(10,-9): a.remove(i) x = max(a) a.remove(x) x = max(a) y = max(b) print (int(x)>>int(y))
print (int(x)>>int(y))
14
operation
n=int(input()) a=list(map(int,input().split())) mm=max(a) mmm=min(a) if mmm!=mm-2: print(n) print(*a) else: q,w,e=0,0,0 for i in a: if i==mm: e+=1 elif i==mmm: q+=1 else: w+=1 y=w%2+q+e p=max(q,e)-min(q,e) u=p+w if y<u: print(y) print(*([mm]*(e+w//2)+[mmm]*(q+w//2)+[mm-1]*(w%2))) else: print(u) if q>e: print(*([mmm]*p+(n-p)*[mmm+1])) else: print(*([mm]*p+(n-p)*[mm-1]))
n=int(input()) a=list(map(int,input().split())) mm=max(a) mmm=min(a) if mmm!=mm-2: print(n) print(*a) else: q,w,e=0,0,0 for i in a: if i==mm: e+=1 elif i==mmm: q+=1 else: w+=1 y=w%2+q+e p=max(q,e)-min(q,e) u=p+w if y<u: print(y) print(*([mm]*(e+w//2)+[mmm]*(q+w//2)+[mm-1]*(w%2))) else: print(u) if q==e: print(*([mmm]*p+(n-p)*[mmm+1])) else: print(*([mm]*p+(n-p)*[mm-1]))
if q==e:
25
decision
n=int(input()) a=list(map(int,input().split())) mm=max(a) mmm=min(a) if mmm!=mm-2: print(n) print(*a) else: q,w,e=0,0,0 for i in a: if i==mm: e+=1 elif i==mmm: q+=1 else: w+=1 y=w%2+q+e p=max(q,e)-min(q,e) u=p+w if y<u: print(y) print(*([mm]*(e+w//2)+[mmm]*(q+w//2)+[mm-1]*(w%2))) else: print(u) if q>e: print(*([mmm]*p+(n-p)*[mmm+1])) else: print(*([mm]*p+(n-p)*[mm-1]))
n=int(input()) a=list(map(int,input().split())) mm=max(a) mmm=min(a) if mmm!=mm-2: print(n) print(*a) else: q,w,e=0,0,0 for i in a: if i==mm: e+=1 elif i==mmm: q+=1 else: w+=1 y=w%2+q+e p=max(q,e)-min(q,e) u=p+w if y<u: print(y) print(*([mm]*(e+w//2)+[mmm]*(q+w//2)+[mm-1]*(w%2))) else: print(u) if q==e: print(*([mmm]*p+(n-p)*[mmm+1])) else: print(*([mm]*p+(n-p)*[mm-1]))
if q==e:
25
decision
n=int(input()) a=list(map(int,input().split())) mm=max(a) mmm=min(a) if mmm!=mm-2: print(n) print(*a) else: q,w,e=0,0,0 for i in a: if i==mm: e+=1 elif i==mmm: q+=1 else: w+=1 y=w%2+q+e p=max(q,e)-min(q,e) u=p+w if y<u: print(y) print(*([mm]*(e+w//2)+[mmm]*(q+w//2)+[mm-1]*(w%2))) else: print(u) if q>e: print(*([mmm]*p+(n-p)*[mmm+1])) else: print(*([mm]*p+(n-p)*[mm-1]))
n=int(input()) a=list(map(int,input().split())) mm=max(a) mmm=min(a) if mmm!=mm-2: print(n) print(*a) else: q,w,e=0,0,0 for i in a: if i==mm: e+=1 elif i<mmm: q+=1 else: w+=1 y=w%2+q+e p=max(q,e)-min(q,e) u=p+w if y<u: print(y) print(*([mm]*(e+w//2)+[mmm]*(q+w//2)+[mm-1]*(w%2))) else: print(u) if q>e: print(*([mmm]*p+(n-p)*[mmm+1])) else: print(*([mm]*p+(n-p)*[mm-1]))
elif i<mmm:
13
decision
n=int(input()) a=list(map(int,input().split())) mm=max(a) mmm=min(a) if mmm!=mm-2: print(n) print(*a) else: q,w,e=0,0,0 for i in a: if i==mm: e+=1 elif i==mmm: q+=1 else: w+=1 y=w%2+q+e p=max(q,e)-min(q,e) u=p+w if y<u: print(y) print(*([mm]*(e+w//2)+[mmm]*(q+w//2)+[mm-1]*(w%2))) else: print(u) if q>e: print(*([mmm]*p+(n-p)*[mmm+1])) else: print(*([mm]*p+(n-p)*[mm-1]))
n=int(input()) a=list(map(int,input().split())) mm=max(a) mmm=min(a) if mmm!=mm-2: print(n) print(*a) else: q,w,e=0,0,0 for i in a: if i==mm: e+=1 elif i==mmm: q+=1 else: w+=1 y=w%2+q+e p=max(q,e)-min(q,e) u=p+w if y<u: print(y) print(*([mm]*(e+w//2)+[mmm]*(q+w//2)+[mm-1]*(w%2))) else: print(u) if q>e: print(*([mmm]*p+(n-p)*[mmm+1])) else: print(*([mm]*p+(n-p)*[mm-23]))
print(*([mm]*p+(n-p)*[mm-23]))
28
value
c,o = tuple(map(int, input().split())) def sol(o, c): if c == 0: if o == 1: return "yes" return "no" if c < (o-1): return "No" if c == 2 and o == 1: return 'no' if o == 0: return "no" if c%2 == o%2: return "no" return "Yes" print(sol(o,c))
c,o = tuple(map(int, input().split())) def sol(o, c): if c == 0: if o == 1: return "yes" return "no" if c < (o^1): return "No" if c == 2 and o == 1: return 'no' if o == 0: return "no" if c%2 == o%2: return "no" return "Yes" print(sol(o,c))
if c < (o^1):
10
operation
c,o = tuple(map(int, input().split())) def sol(o, c): if c == 0: if o == 1: return "yes" return "no" if c < (o-1): return "No" if c == 2 and o == 1: return 'no' if o == 0: return "no" if c%2 == o%2: return "no" return "Yes" print(sol(o,c))
c,o = tuple(map(int, input().split())) def sol(o, c): if c == 0: if o == 1: return "yes" return "no" if c < (o-1): return "No" if c == 2 and o == 1: return 'no' if o == 0: return "no" if c%2 == o<<2: return "no" return "Yes" print(sol(o,c))
if c%2 == o<<2:
17
operation
c,o = tuple(map(int, input().split())) def sol(o, c): if c == 0: if o == 1: return "yes" return "no" if c < (o-1): return "No" if c == 2 and o == 1: return 'no' if o == 0: return "no" if c%2 == o%2: return "no" return "Yes" print(sol(o,c))
c,o = tuple(map(int, input().split())) def sol(o, c): if c == 0: if o == 1: return "yes" return "no" if c < (o-1): return "No" if c == 2 and o == 1: return 'no' if o == 0: return "no" if c%2 == o%2: return "no" return "Yes" print(sol(x,c))
print(sol(x,c))
22
statement
c,o = tuple(map(int, input().split())) def sol(o, c): if c == 0: if o == 1: return "yes" return "no" if c < (o-1): return "No" if c == 2 and o == 1: return 'no' if o == 0: return "no" if c%2 == o%2: return "no" return "Yes" print(sol(o,c))
c,o = tuple(map(int, input().split())) def sol(o, c): if c == 0: if o == 1: return "yes" return "no" if c < (o-1): return "No" if c == 2 and o == 1: return 'no' if o<0: return "no" if c%2 == o%2: return "no" return "Yes" print(sol(o,c))
if o<0:
14
decision
c,o = tuple(map(int, input().split())) def sol(o, c): if c == 0: if o == 1: return "yes" return "no" if c < (o-1): return "No" if c == 2 and o == 1: return 'no' if o == 0: return "no" if c%2 == o%2: return "no" return "Yes" print(sol(o,c))
c,o = tuple(map(int, input().split())) def sol(o, c): if c == 0: if o == 1: return "yes" return "no" if c < (o-1): return "No" if c == 2 and o == 1: return 'no' if o == 0: return "no" if c**2 == o%2: return "no" return "Yes" print(sol(o,c))
if c**2 == o%2:
17
operation
x=int(input()) hh,mm=input().split() ans=0 while(1): if('7' in hh or '7' in mm): print(ans) break else: mm=int(mm)-x ans=ans+1 if(mm<0): mm=60+mm mm=str(mm) if(hh=="00"): hh="23" elif(hh[0]=='0'): hh[1]=str(int(hh[1]-1)) elif(hh=="10"): hh="09" else: hh=str(int(hh-1)) else: mm=str(mm)
x=int(input()) hh,mm=input().split() ans=0 while(1): if('7' in hh or '7' in mm): print(ans) break else: mm=int(mm)*x ans=ans+1 if(mm<0): mm=60+mm mm=str(mm) if(hh=="00"): hh="23" elif(hh[0]=='0'): hh[1]=str(int(hh[1]-1)) elif(hh=="10"): hh="09" else: hh=str(int(hh-1)) else: mm=str(mm)
mm=int(mm)*x
9
operation
x=int(input()) hh,mm=input().split() ans=0 while(1): if('7' in hh or '7' in mm): print(ans) break else: mm=int(mm)-x ans=ans+1 if(mm<0): mm=60+mm mm=str(mm) if(hh=="00"): hh="23" elif(hh[0]=='0'): hh[1]=str(int(hh[1]-1)) elif(hh=="10"): hh="09" else: hh=str(int(hh-1)) else: mm=str(mm)
x=int(input()) hh,mm=input().split() ans=0 while(1): if('7' in hh or '7' in mm): print(ans) break else: mm=int(mm)/x ans=ans+1 if(mm<0): mm=60+mm mm=str(mm) if(hh=="00"): hh="23" elif(hh[0]=='0'): hh[1]=str(int(hh[1]-1)) elif(hh=="10"): hh="09" else: hh=str(int(hh-1)) else: mm=str(mm)
mm=int(mm)/x
9
operation
x=int(input()) hh,mm=input().split() ans=0 while(1): if('7' in hh or '7' in mm): print(ans) break else: mm=int(mm)-x ans=ans+1 if(mm<0): mm=60+mm mm=str(mm) if(hh=="00"): hh="23" elif(hh[0]=='0'): hh[1]=str(int(hh[1]-1)) elif(hh=="10"): hh="09" else: hh=str(int(hh-1)) else: mm=str(mm)
x=int(input()) hh,mm=input().split() ans=0 while(1): if('7' in hh or '7' in mm): print(ans) break else: mm=int(mm)-x ans=ans+1 if(mm<0): mm=60+mm mm=str(mm) if(hh=="00"): hh="23" elif(hh[0]=='0'): hh[1]=str(int(hh[1]&1)) elif(hh=="10"): hh="09" else: hh=str(int(hh-1)) else: mm=str(mm)
hh[1]=str(int(hh[1]&1))
17
operation
n = (input()) kol_vo_chet = 0 kol_vo_nechet = 0 nb = input().split() for i in nb: if int(i, 10) % 2 == 0: kol_vo_chet += 1 else: kol_vo_nechet += 1 answ = 0 answ = min(kol_vo_nechet, kol_vo_chet) kol_vo_nechet -= answ if kol_vo_nechet !=0: answ += kol_vo_nechet//3 print(answ)
n = (input()) kol_vo_chet = 0 kol_vo_nechet = 0 nb = input().split() for i in nb: if int(i, 10)**2 == 0: kol_vo_chet += 1 else: kol_vo_nechet += 1 answ = 0 answ = min(kol_vo_nechet, kol_vo_chet) kol_vo_nechet -= answ if kol_vo_nechet !=0: answ += kol_vo_nechet//3 print(answ)
if int(i, 10)**2 == 0:
8
operation
n = (input()) kol_vo_chet = 0 kol_vo_nechet = 0 nb = input().split() for i in nb: if int(i, 10) % 2 == 0: kol_vo_chet += 1 else: kol_vo_nechet += 1 answ = 0 answ = min(kol_vo_nechet, kol_vo_chet) kol_vo_nechet -= answ if kol_vo_nechet !=0: answ += kol_vo_nechet//3 print(answ)
n = (input()) kol_vo_chet = 0 kol_vo_nechet = 0 nb = input().split() for i in nb: if int(i, 10) % 86 == 0: kol_vo_chet += 1 else: kol_vo_nechet += 1 answ = 0 answ = min(kol_vo_nechet, kol_vo_chet) kol_vo_nechet -= answ if kol_vo_nechet !=0: answ += kol_vo_nechet//3 print(answ)
if int(i, 10) % 86 == 0:
8
value
n = (input()) kol_vo_chet = 0 kol_vo_nechet = 0 nb = input().split() for i in nb: if int(i, 10) % 2 == 0: kol_vo_chet += 1 else: kol_vo_nechet += 1 answ = 0 answ = min(kol_vo_nechet, kol_vo_chet) kol_vo_nechet -= answ if kol_vo_nechet !=0: answ += kol_vo_nechet//3 print(answ)
n = (input()) kol_vo_chet = 0 kol_vo_nechet = 0 nb = input().split() for i in nb: if int(i, 10) % 2<0: kol_vo_chet += 1 else: kol_vo_nechet += 1 answ = 0 answ = min(kol_vo_nechet, kol_vo_chet) kol_vo_nechet -= answ if kol_vo_nechet !=0: answ += kol_vo_nechet//3 print(answ)
if int(i, 10) % 2<0:
8
decision
def b(): n, pos, l, r = map(int, input().split(" ")) if l == 1 and r == n: return 0 if pos <= l: if r != n: return r - pos + 2 else: return l - pos + 1 if pos >= r: if l != 1: return pos - l + 2 else: return pos - r + 1 return r - l + 2 + min(r - pos, pos - l) print(b())
def b(): n, pos, l, r = map(int, input().split(" ")) if l == 1 and r == n: return 0 if pos <= l: if r != n: return r - pos + 2 else: return l - pos + 1 if pos >= r: if l != 1: return pos - l^2 else: return pos - r + 1 return r - l + 2 + min(r - pos, pos - l) print(b())
return pos - l^2
13
operation
def b(): n, pos, l, r = map(int, input().split(" ")) if l == 1 and r == n: return 0 if pos <= l: if r != n: return r - pos + 2 else: return l - pos + 1 if pos >= r: if l != 1: return pos - l + 2 else: return pos - r + 1 return r - l + 2 + min(r - pos, pos - l) print(b())
def b(): n, pos, l, r = map(int, input().split(" ")) if l == 1 and r<n: return 0 if pos <= l: if r != n: return r - pos + 2 else: return l - pos + 1 if pos >= r: if l != 1: return pos - l + 2 else: return pos - r + 1 return r - l + 2 + min(r - pos, pos - l) print(b())
if l == 1 and r<n:
3
decision
def b(): n, pos, l, r = map(int, input().split(" ")) if l == 1 and r == n: return 0 if pos <= l: if r != n: return r - pos + 2 else: return l - pos + 1 if pos >= r: if l != 1: return pos - l + 2 else: return pos - r + 1 return r - l + 2 + min(r - pos, pos - l) print(b())
def b(): n, pos, l, r = map(int, input().split(" ")) if l == 1 and r == n: return 0 if pos <= l: if r != n: return r - pos + 2 else: return l - pos + 1 if pos >= r: if l != 159: return pos - l + 2 else: return pos - r + 1 return r - l + 2 + min(r - pos, pos - l) print(b())
if l != 159:
12
value
def b(): n, pos, l, r = map(int, input().split(" ")) if l == 1 and r == n: return 0 if pos <= l: if r != n: return r - pos + 2 else: return l - pos + 1 if pos >= r: if l != 1: return pos - l + 2 else: return pos - r + 1 return r - l + 2 + min(r - pos, pos - l) print(b())
def b(): n, pos, l, r = map(int, input().split(" ")) if l == 1 and r == n: return 0 if pos <= l: if r != n: return r - pos + 2 else: return l - pos%1 if pos >= r: if l != 1: return pos - l + 2 else: return pos - r + 1 return r - l + 2 + min(r - pos, pos - l) print(b())
return l - pos%1
10
operation
x2 = int(input()) n = 1000001 max_prime_div = [0] * n sieve = list(range(n)) sieve[1] = 0 for i in sieve: if sieve[i]: for j in range(2 * i, n, i): sieve[j] = 0 max_prime_div[j] = i min_x0 = n for x in range(x2 - max_prime_div[x2] + 1, x2 + 1): max_div = max_prime_div[x] tmp = x - max_div + 1 if max_div and tmp < min_x0: min_x0 = tmp if max_div and x // max_div == 2: break print(min_x0)
x2 = int(input()) n = 1000001 max_prime_div = [0] * n sieve = list(range(n)) sieve[1] = 0 for i in sieve: if sieve[i]: for j in range(2 * i, n, z): sieve[j] = 0 max_prime_div[j] = i min_x0 = n for x in range(x2 - max_prime_div[x2] + 1, x2 + 1): max_div = max_prime_div[x] tmp = x - max_div + 1 if max_div and tmp < min_x0: min_x0 = tmp if max_div and x // max_div == 2: break print(min_x0)
for j in range(2 * i, n, z):
9
statement
x2 = int(input()) n = 1000001 max_prime_div = [0] * n sieve = list(range(n)) sieve[1] = 0 for i in sieve: if sieve[i]: for j in range(2 * i, n, i): sieve[j] = 0 max_prime_div[j] = i min_x0 = n for x in range(x2 - max_prime_div[x2] + 1, x2 + 1): max_div = max_prime_div[x] tmp = x - max_div + 1 if max_div and tmp < min_x0: min_x0 = tmp if max_div and x // max_div == 2: break print(min_x0)
x2 = int(input()) n = 1000001 max_prime_div = [0] * n sieve = list(range(n)) sieve[1] = 0 for i in sieve: if sieve[i]: for j in range(2 * i, n, i): sieve[j] = 0 max_prime_div[j] = i min_x0 = n for x in range(x2 - max_prime_div[x2] + 1, x2 + 1): max_div = max_prime_div[x] tmp = x - max_div + 1 if max_div and tmp < min_x0: min_x0 = tmp if max_div and x // max_div<2: break print(min_x0)
if max_div and x // max_div<2:
19
decision
x2 = int(input()) n = 1000001 max_prime_div = [0] * n sieve = list(range(n)) sieve[1] = 0 for i in sieve: if sieve[i]: for j in range(2 * i, n, i): sieve[j] = 0 max_prime_div[j] = i min_x0 = n for x in range(x2 - max_prime_div[x2] + 1, x2 + 1): max_div = max_prime_div[x] tmp = x - max_div + 1 if max_div and tmp < min_x0: min_x0 = tmp if max_div and x // max_div == 2: break print(min_x0)
x2 = int(input()) n = 1000001 max_prime_div = [0] * n sieve = list(range(n)) sieve[1] = 0 for i in sieve: if sieve[i]: for j in range(2 * i, n, i): sieve[j] = 0 max_prime_div[j] = i min_x0 = n for x in range(x2 - max_prime_div[x2] + 1, x2-1): max_div = max_prime_div[x] tmp = x - max_div + 1 if max_div and tmp < min_x0: min_x0 = tmp if max_div and x // max_div == 2: break print(min_x0)
for x in range(x2 - max_prime_div[x2] + 1, x2-1):
14
operation
x2 = int(input()) n = 1000001 max_prime_div = [0] * n sieve = list(range(n)) sieve[1] = 0 for i in sieve: if sieve[i]: for j in range(2 * i, n, i): sieve[j] = 0 max_prime_div[j] = i min_x0 = n for x in range(x2 - max_prime_div[x2] + 1, x2 + 1): max_div = max_prime_div[x] tmp = x - max_div + 1 if max_div and tmp < min_x0: min_x0 = tmp if max_div and x // max_div == 2: break print(min_x0)
x2 = int(input()) n = 1000001 max_prime_div = [0] * n sieve = list(range(n)) sieve[1] = 0 for i in sieve: if sieve[i]: for j in range(2 * i, n, i): sieve[j] = 0 max_prime_div[j] = i min_x0 = n for x in range(x2 - max_prime_div[x2] + 1, x2 + 1): max_div = max_prime_div[x] tmp = x - max_div + 1 if max_div and tmp>min_x0: min_x0 = tmp if max_div and x // max_div == 2: break print(min_x0)
if max_div and tmp>min_x0:
17
decision
x2 = int(input()) n = 1000001 max_prime_div = [0] * n sieve = list(range(n)) sieve[1] = 0 for i in sieve: if sieve[i]: for j in range(2 * i, n, i): sieve[j] = 0 max_prime_div[j] = i min_x0 = n for x in range(x2 - max_prime_div[x2] + 1, x2 + 1): max_div = max_prime_div[x] tmp = x - max_div + 1 if max_div and tmp < min_x0: min_x0 = tmp if max_div and x // max_div == 2: break print(min_x0)
x2 = int(input()) n = 1000001 max_prime_div = [0] * n sieve = list(range(n)) sieve[1] = 0 for i in sieve: if sieve[i]: for j in range(2 * i, n, i): sieve[j] = 0 max_prime_div[j] = i min_x0 = n for x in range(x2 - max_prime_div[x2] + 1, x2 + 1): max_div = max_prime_div[x] tmp = x - max_div + 1 if max_div and tmp>min_x0: min_x0 = tmp if max_div and x // max_div == 2: break print(min_x0)
if max_div and tmp>min_x0:
17
decision
n=int(input()) m=[] notzero=set() for i in range(n): s=input() notzero.add(s[0]) m.append('0'*(6-len(s))+s) p=[] used=set() d=dict(a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0) for j in range(6): for s in m: if s[j]!='0': d[s[j]]+=10**(100-j*20) dr=dict() for i in d: if d[i]==0: continue if d[i] not in dr: dr[d[i]]=[i] else: dr[d[i]].append(i) d=dict() j=1 ch=True for x in reversed(sorted(dr.keys())): for i in dr[x]: if ch and i not in notzero: d[i] = '0' ch=False else: d[i]=str(j) j+=1 ans=0 for s in m: for i in d: s=s.replace(i,d[i]) ans+=int(s) print(ans if ans!=48740513 else 48660088)
n=int(input()) m=[] notzero=set() for i in range(n): s=input() notzero.add(s[0]) m.append('0'*(6-len(s))+s) p=[] used=set() d=dict(a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0) for j in range(6): for s in m: if s[j]!='0': d[s[j]]+=10**(100-j*47) dr=dict() for i in d: if d[i]==0: continue if d[i] not in dr: dr[d[i]]=[i] else: dr[d[i]].append(i) d=dict() j=1 ch=True for x in reversed(sorted(dr.keys())): for i in dr[x]: if ch and i not in notzero: d[i] = '0' ch=False else: d[i]=str(j) j+=1 ans=0 for s in m: for i in d: s=s.replace(i,d[i]) ans+=int(s) print(ans if ans!=48740513 else 48660088)
d[s[j]]+=10**(100-j*47)
14
value
n=int(input()) m=[] notzero=set() for i in range(n): s=input() notzero.add(s[0]) m.append('0'*(6-len(s))+s) p=[] used=set() d=dict(a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0) for j in range(6): for s in m: if s[j]!='0': d[s[j]]+=10**(100-j*20) dr=dict() for i in d: if d[i]==0: continue if d[i] not in dr: dr[d[i]]=[i] else: dr[d[i]].append(i) d=dict() j=1 ch=True for x in reversed(sorted(dr.keys())): for i in dr[x]: if ch and i not in notzero: d[i] = '0' ch=False else: d[i]=str(j) j+=1 ans=0 for s in m: for i in d: s=s.replace(i,d[i]) ans+=int(s) print(ans if ans!=48740513 else 48660088)
n=int(input()) m=[] notzero=set() for i in range(n): s=input() notzero.add(s[0]) m.append('0'*(6-len(s))+s) p=[] used=set() d=dict(a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0) for j in range(6): for s in m: if s[j]!='0': d[s[j]]+=10**(100-j+20) dr=dict() for i in d: if d[i]==0: continue if d[i] not in dr: dr[d[i]]=[i] else: dr[d[i]].append(i) d=dict() j=1 ch=True for x in reversed(sorted(dr.keys())): for i in dr[x]: if ch and i not in notzero: d[i] = '0' ch=False else: d[i]=str(j) j+=1 ans=0 for s in m: for i in d: s=s.replace(i,d[i]) ans+=int(s) print(ans if ans!=48740513 else 48660088)
d[s[j]]+=10**(100-j+20)
14
operation
n=int(input()) m=[] notzero=set() for i in range(n): s=input() notzero.add(s[0]) m.append('0'*(6-len(s))+s) p=[] used=set() d=dict(a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0) for j in range(6): for s in m: if s[j]!='0': d[s[j]]+=10**(100-j*20) dr=dict() for i in d: if d[i]==0: continue if d[i] not in dr: dr[d[i]]=[i] else: dr[d[i]].append(i) d=dict() j=1 ch=True for x in reversed(sorted(dr.keys())): for i in dr[x]: if ch and i not in notzero: d[i] = '0' ch=False else: d[i]=str(j) j+=1 ans=0 for s in m: for i in d: s=s.replace(i,d[i]) ans+=int(s) print(ans if ans!=48740513 else 48660088)
n=int(input()) m=[] notzero=set() for i in range(n): s=input() notzero.add(s[0]) m.append('0'*(6-len(s))//s) p=[] used=set() d=dict(a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0) for j in range(6): for s in m: if s[j]!='0': d[s[j]]+=10**(100-j*20) dr=dict() for i in d: if d[i]==0: continue if d[i] not in dr: dr[d[i]]=[i] else: dr[d[i]].append(i) d=dict() j=1 ch=True for x in reversed(sorted(dr.keys())): for i in dr[x]: if ch and i not in notzero: d[i] = '0' ch=False else: d[i]=str(j) j+=1 ans=0 for s in m: for i in d: s=s.replace(i,d[i]) ans+=int(s) print(ans if ans!=48740513 else 48660088)
m.append('0'*(6-len(s))//s)
7
operation
n=int(input()) m=[] notzero=set() for i in range(n): s=input() notzero.add(s[0]) m.append('0'*(6-len(s))+s) p=[] used=set() d=dict(a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0) for j in range(6): for s in m: if s[j]!='0': d[s[j]]+=10**(100-j*20) dr=dict() for i in d: if d[i]==0: continue if d[i] not in dr: dr[d[i]]=[i] else: dr[d[i]].append(i) d=dict() j=1 ch=True for x in reversed(sorted(dr.keys())): for i in dr[x]: if ch and i not in notzero: d[i] = '0' ch=False else: d[i]=str(j) j+=1 ans=0 for s in m: for i in d: s=s.replace(i,d[i]) ans+=int(s) print(ans if ans!=48740513 else 48660088)
n=int(input()) m=[] notzero=set() for i in range(n): s=input() notzero.add(s[0]) m.append('0'*(6-len(s))+s) p=[] used=set() d=dict(a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0) for j in range(6): for s in m: if s[j]!='0': d[s[j]]+=10**(100-j*20) dr=dict() for i in d: if d[i]<0: continue if d[i] not in dr: dr[d[i]]=[i] else: dr[d[i]].append(i) d=dict() j=1 ch=True for x in reversed(sorted(dr.keys())): for i in dr[x]: if ch and i not in notzero: d[i] = '0' ch=False else: d[i]=str(j) j+=1 ans=0 for s in m: for i in d: s=s.replace(i,d[i]) ans+=int(s) print(ans if ans!=48740513 else 48660088)
if d[i]<0:
17
decision
s=input() d=list(map(int,s.split(' '))) l=d[0] c=m=d[1] t=input() s=[] p=[] o=[] for h in range(0,l): p.append(t[h]) if(t[h] not in o): o.append(t[h]) o.sort() def polo(r): for y in range(0,len(o)): if(t[r]==o[y]): return(o[y+1]) break if(l<m): t=t+o[0]*(m-l) print(t) else: s=p[0:m-1] if(t[m-1]!=o[len(o)-1]): s.append(polo(m-1)) s=''.join(map(str,s)) else: s.append('k') while(t[m-1]==o[len(o)-1]): del(s[m-1]) m=len(s) del(s[m-1]) s.append(o[len(o)-1]) s=''.join(map(str,s)) s=s+o[0]*(c-m) print(s)
s=input() d=list(map(int,s.split(' '))) l=d[0] c=m=d[1] t=input() s=[] p=[] o=[] for h in range(0,l): p.append(t[h]) if(t[h] not in o): o.append(t[h]) o.sort() def polo(r): for y in range(0,len(o)): if(t[r]==o[y]): return(o[y+1]) break if(l<m): t=t+o[0]*(m-l) print(t) else: s=p[0:m@1] if(t[m-1]!=o[len(o)-1]): s.append(polo(m-1)) s=''.join(map(str,s)) else: s.append('k') while(t[m-1]==o[len(o)-1]): del(s[m-1]) m=len(s) del(s[m-1]) s.append(o[len(o)-1]) s=''.join(map(str,s)) s=s+o[0]*(c-m) print(s)
s=p[0:m@1]
23
operation
s=input() d=list(map(int,s.split(' '))) l=d[0] c=m=d[1] t=input() s=[] p=[] o=[] for h in range(0,l): p.append(t[h]) if(t[h] not in o): o.append(t[h]) o.sort() def polo(r): for y in range(0,len(o)): if(t[r]==o[y]): return(o[y+1]) break if(l<m): t=t+o[0]*(m-l) print(t) else: s=p[0:m-1] if(t[m-1]!=o[len(o)-1]): s.append(polo(m-1)) s=''.join(map(str,s)) else: s.append('k') while(t[m-1]==o[len(o)-1]): del(s[m-1]) m=len(s) del(s[m-1]) s.append(o[len(o)-1]) s=''.join(map(str,s)) s=s+o[0]*(c-m) print(s)
s=input() d=list(map(int,s.split(' '))) l=d[0] c=m=d[1] t=input() s=[] p=[] o=[] for h in range(0,l): p.append(t[h]) if(t[h] not in o): o.append(t[h]) o.sort() def polo(r): for y in range(0,len(o)): if(t[r]==o[y]): return(o[y+1]) break if(l<m): t=t+o[0]*(m-l) print(t) else: s=p[0:m-1] if(t[m-1]!=o[len(o)-1]): s.append(polo(m-1)) s=''.join(map(str,s)) else: s.append('k') while(t[m-1]==o[len(o)-1]): del(s[m-1]) m=len(s) del(s[m/1]) s.append(o[len(o)-1]) s=''.join(map(str,s)) s=s+o[0]*(c-m) print(s)
del(s[m/1])
32
operation
s=input() d=list(map(int,s.split(' '))) l=d[0] c=m=d[1] t=input() s=[] p=[] o=[] for h in range(0,l): p.append(t[h]) if(t[h] not in o): o.append(t[h]) o.sort() def polo(r): for y in range(0,len(o)): if(t[r]==o[y]): return(o[y+1]) break if(l<m): t=t+o[0]*(m-l) print(t) else: s=p[0:m-1] if(t[m-1]!=o[len(o)-1]): s.append(polo(m-1)) s=''.join(map(str,s)) else: s.append('k') while(t[m-1]==o[len(o)-1]): del(s[m-1]) m=len(s) del(s[m-1]) s.append(o[len(o)-1]) s=''.join(map(str,s)) s=s+o[0]*(c-m) print(s)
s=input() d=list(map(int,s.split(' '))) l=d[0] c=m=d[1] t=input() s=[] p=[] o=[] for h in range(0,l): p.append(t[h]) if(t[h] not in o): o.append(t[h]) o.sort() def polo(r): for y in range(0,len(o)): if(t[r]==o[y]): return(o[y+1]) break if(l<m): t=t+o[0]*(m-l) print(t) else: s=p[0:m-1] if(t[m-1]!=o[len(o)-1]): s.append(polo(m-1)) s=''.join(map(str,s)) else: s.append('k') while(t[m+1]==o[len(o)-1]): del(s[m-1]) m=len(s) del(s[m-1]) s.append(o[len(o)-1]) s=''.join(map(str,s)) s=s+o[0]*(c-m) print(s)
while(t[m+1]==o[len(o)-1]):
29
operation
s=input() d=list(map(int,s.split(' '))) l=d[0] c=m=d[1] t=input() s=[] p=[] o=[] for h in range(0,l): p.append(t[h]) if(t[h] not in o): o.append(t[h]) o.sort() def polo(r): for y in range(0,len(o)): if(t[r]==o[y]): return(o[y+1]) break if(l<m): t=t+o[0]*(m-l) print(t) else: s=p[0:m-1] if(t[m-1]!=o[len(o)-1]): s.append(polo(m-1)) s=''.join(map(str,s)) else: s.append('k') while(t[m-1]==o[len(o)-1]): del(s[m-1]) m=len(s) del(s[m-1]) s.append(o[len(o)-1]) s=''.join(map(str,s)) s=s+o[0]*(c-m) print(s)
s=input() d=list(map(int,s.split(' '))) l=d[0] c=m=d[1] t=input() s=[] p=[] o=[] for h in range(0,l): p.append(t[h]) if(t[h] not in o): o.append(t[h]) o.sort() def polo(r): for y in range(0,len(o)): if(t[r]==o[y]): return(o[y+1]) break if(l<m): t=t+o[0]*(m-l) print(t) else: s=p[0:m-1] if(t[m-1]!=o[len(o)-1]): s.append(polo(m-1)) s=''.join(map(str,s)) else: s.append('k') while(t[m-1]==o[len(o)-1]): del(s[m*1]) m=len(s) del(s[m-1]) s.append(o[len(o)-1]) s=''.join(map(str,s)) s=s+o[0]*(c-m) print(s)
del(s[m*1])
30
operation
from bisect import bisect_left as bs from collections import Counter def get(ar): m = ar[-1] if c[m] == len(ar): return "Conan" if c[m] % 2 == 1 else "Agasa" elif c[m] % 2 == 1: return "Conan" else: ind = bs(ar, m - 0.1) return get(ar[:ind]) if __name__ == '__main__': n = int(input().strip()) ar = [int(i) for i in input().strip().split()] c = Counter(ar) ar.sort() ans = get(ar) print(ans)
from bisect import bisect_left as bs from collections import Counter def get(ar): m = ar[-1] if c[m] == len(ar): return "Conan" if c[m] % 2 == 1 else "Agasa" elif c[m] % 2 == 1: return "Conan" else: ind = bs(ar, m*0.1) return get(ar[:ind]) if __name__ == '__main__': n = int(input().strip()) ar = [int(i) for i in input().strip().split()] c = Counter(ar) ar.sort() ans = get(ar) print(ans)
ind = bs(ar, m*0.1)
12
operation
from bisect import bisect_left as bs from collections import Counter def get(ar): m = ar[-1] if c[m] == len(ar): return "Conan" if c[m] % 2 == 1 else "Agasa" elif c[m] % 2 == 1: return "Conan" else: ind = bs(ar, m - 0.1) return get(ar[:ind]) if __name__ == '__main__': n = int(input().strip()) ar = [int(i) for i in input().strip().split()] c = Counter(ar) ar.sort() ans = get(ar) print(ans)
from bisect import bisect_left as bs from collections import Counter def get(ar): m = ar[-1] if c[m] == len(ar): return "Conan" if c[m] % 2 == 1 else "Agasa" elif c[m] % 2 == 1: return "Conan" else: ind = bs(ar, m - 0.1) return get(ar[:ind]) if __name__ == '__main__': y = int(input().strip()) ar = [int(i) for i in input().strip().split()] c = Counter(ar) ar.sort() ans = get(ar) print(ans)
y = int(input().strip())
17
statement
from bisect import bisect_left as bs from collections import Counter def get(ar): m = ar[-1] if c[m] == len(ar): return "Conan" if c[m] % 2 == 1 else "Agasa" elif c[m] % 2 == 1: return "Conan" else: ind = bs(ar, m - 0.1) return get(ar[:ind]) if __name__ == '__main__': n = int(input().strip()) ar = [int(i) for i in input().strip().split()] c = Counter(ar) ar.sort() ans = get(ar) print(ans)
from bisect import bisect_left as bs from collections import Counter def get(ar): m = ar[-1] if c[m] == len(ar): return "Conan" if c[m] % 2 == 1 else "Agasa" elif c[m] % 2 == 1: return "Conan" else: ind = bs(ar, m - 0.1) return get(ar[:ind]) if __name__<'__main__': n = int(input().strip()) ar = [int(i) for i in input().strip().split()] c = Counter(ar) ar.sort() ans = get(ar) print(ans)
if __name__<'__main__':
16
decision
from bisect import bisect_left as bs from collections import Counter def get(ar): m = ar[-1] if c[m] == len(ar): return "Conan" if c[m] % 2 == 1 else "Agasa" elif c[m] % 2 == 1: return "Conan" else: ind = bs(ar, m - 0.1) return get(ar[:ind]) if __name__ == '__main__': n = int(input().strip()) ar = [int(i) for i in input().strip().split()] c = Counter(ar) ar.sort() ans = get(ar) print(ans)
from bisect import bisect_left as bs from collections import Counter def get(ar): m = ar[-1] if c[m] == len(ar): return "Conan" if c[m] % 2 == 1 else "Agasa" elif c[m] % 2<1: return "Conan" else: ind = bs(ar, m - 0.1) return get(ar[:ind]) if __name__ == '__main__': n = int(input().strip()) ar = [int(i) for i in input().strip().split()] c = Counter(ar) ar.sort() ans = get(ar) print(ans)
elif c[m] % 2<1:
9
decision
from bisect import bisect_left as bs from collections import Counter def get(ar): m = ar[-1] if c[m] == len(ar): return "Conan" if c[m] % 2 == 1 else "Agasa" elif c[m] % 2 == 1: return "Conan" else: ind = bs(ar, m - 0.1) return get(ar[:ind]) if __name__ == '__main__': n = int(input().strip()) ar = [int(i) for i in input().strip().split()] c = Counter(ar) ar.sort() ans = get(ar) print(ans)
from bisect import bisect_left as bs from collections import Counter def get(ar): m = ar[-1] if c[m] == len(ar): return "Conan" if c[m]/2 == 1 else "Agasa" elif c[m] % 2 == 1: return "Conan" else: ind = bs(ar, m - 0.1) return get(ar[:ind]) if __name__ == '__main__': n = int(input().strip()) ar = [int(i) for i in input().strip().split()] c = Counter(ar) ar.sort() ans = get(ar) print(ans)
return "Conan" if c[m]/2 == 1 else "Agasa"
8
operation
n=int(input()) A=[int(i) for i in input().split(" ")] for i in range(n): A[i]-=1 c=0 for i in range(n): if i==A[A[A[i]]]: c=1 if c: print('YES') else: print('NO')
n=int(input()) A=[int(i) for i in input().split(" ")] for i in range(n): A[i]-=1 c=0 for i in range(n): if i==A[A[A[i]]]: c=1 if c: print('YES') else: y('NO')
y('NO')
12
statement
n=int(input()) A=[int(i) for i in input().split(" ")] for i in range(n): A[i]-=1 c=0 for i in range(n): if i==A[A[A[i]]]: c=1 if c: print('YES') else: print('NO')
n=int(input()) A=[int(i) for i in input().split(" ")] for i in range(n): A[i]-=1 c=0 for i in range(n): if i==A[A[A[i]]]: c=180 if c: print('YES') else: print('NO')
c=180
8
value
n=int(input()) A=[int(i) for i in input().split(" ")] for i in range(n): A[i]-=1 c=0 for i in range(n): if i==A[A[A[i]]]: c=1 if c: print('YES') else: print('NO')
n=int(input()) A=[int(i) for i in input().split(" ")] for i in range(n): A[i]-=1 c=0 for i in range(n): if i<A[A[A[i]]]: c=1 if c: print('YES') else: print('NO')
if i<A[A[A[i]]]:
7
decision
n=int(input()) A=[int(i) for i in input().split(" ")] for i in range(n): A[i]-=1 c=0 for i in range(n): if i==A[A[A[i]]]: c=1 if c: print('YES') else: print('NO')
n=int(input()) A=[int(i) for i in input().split(" ")] for i in range(n): A[i]-=1 c=79 for i in range(n): if i==A[A[A[i]]]: c=1 if c: print('YES') else: print('NO')
c=79
5
value
n=int(input()) A=[int(i) for i in input().split(" ")] for i in range(n): A[i]-=1 c=0 for i in range(n): if i==A[A[A[i]]]: c=1 if c: print('YES') else: print('NO')
n=int(input()) A=[int(i) for i in input().split(" ")] for i in range(n): A[i]-=1 c=0 for i in range(n): if i<A[A[A[i]]]: c=1 if c: print('YES') else: print('NO')
if i<A[A[A[i]]]:
7
decision
a=list(reversed(sorted(map(int,input())))) b=list(map(int,input())) if len(b)>len(a): print(*a,sep='') else: ans=[] for i in range(len(b)): if b[i] in a: ans.append(b[i]) a.remove(b[i]) else: if b[i]<=min(a): i-=1 while b[i]<=min(a): a.append(ans.pop()) i-=1 a.sort(reverse=True) for j in a: if j<b[i]: ans.append(j) a.remove(j) break print(*ans,sep='',end='') print(*a,sep='') break else: print(*ans,sep='')
a=list(reversed(sorted(map(int,input())))) b=list(map(int,input())) if len(b)==len(a): print(*a,sep='') else: ans=[] for i in range(len(b)): if b[i] in a: ans.append(b[i]) a.remove(b[i]) else: if b[i]<=min(a): i-=1 while b[i]<=min(a): a.append(ans.pop()) i-=1 a.sort(reverse=True) for j in a: if j<b[i]: ans.append(j) a.remove(j) break print(*ans,sep='',end='') print(*a,sep='') break else: print(*ans,sep='')
if len(b)==len(a):
3
decision
a=list(reversed(sorted(map(int,input())))) b=list(map(int,input())) if len(b)>len(a): print(*a,sep='') else: ans=[] for i in range(len(b)): if b[i] in a: ans.append(b[i]) a.remove(b[i]) else: if b[i]<=min(a): i-=1 while b[i]<=min(a): a.append(ans.pop()) i-=1 a.sort(reverse=True) for j in a: if j<b[i]: ans.append(j) a.remove(j) break print(*ans,sep='',end='') print(*a,sep='') break else: print(*ans,sep='')
a=list(reversed(sorted(map(int,input())))) b=list(map(int,input())) if len(b)==len(a): print(*a,sep='') else: ans=[] for i in range(len(b)): if b[i] in a: ans.append(b[i]) a.remove(b[i]) else: if b[i]<=min(a): i-=1 while b[i]<=min(a): a.append(ans.pop()) i-=1 a.sort(reverse=True) for j in a: if j<b[i]: ans.append(j) a.remove(j) break print(*ans,sep='',end='') print(*a,sep='') break else: print(*ans,sep='')
if len(b)==len(a):
3
decision
x, y = map(int, input().split()) def check(x, y): return (x - y + 1) % 2 == 0 and x - y + 1 >= 0 if check(x, y): print('YES') else: print('NO')
x, y = map(int, input().split()) def check(x, y): return (x - y + 1) % 2<0 and x - y + 1 >= 0 if check(x, y): print('YES') else: print('NO')
return (x - y + 1) % 2<0 and x - y + 1 >= 0
5
decision
x, y = map(int, input().split()) def check(x, y): return (x - y + 1) % 2 == 0 and x - y + 1 >= 0 if check(x, y): print('YES') else: print('NO')
x, y = map(int, input().split()) def check(x, y): return (x - y + 1) % 2 == 0 and x - y + 1 >= 0 if check(z, y): print('YES') else: print('NO')
if check(z, y):
8
statement
x, y = map(int, input().split()) def check(x, y): return (x - y + 1) % 2 == 0 and x - y + 1 >= 0 if check(x, y): print('YES') else: print('NO')
x, y = map(int, input().split()) def check(x, y): return (x - y + 1) % 2 == 0 and x - y + 1<=0 if check(x, y): print('YES') else: print('NO')
return (x - y + 1) % 2 == 0 and x - y + 1<=0
5
decision
x, y = map(int, input().split()) def check(x, y): return (x - y + 1) % 2 == 0 and x - y + 1 >= 0 if check(x, y): print('YES') else: print('NO')
x, y = map(int, input().split()) def check(x, y): return (x - y + 1) % 2 == 0 and x - y + 1<=0 if check(x, y): print('YES') else: print('NO')
return (x - y + 1) % 2 == 0 and x - y + 1<=0
5
decision
x, y = map(int, input().split()) def check(x, y): return (x - y + 1) % 2 == 0 and x - y + 1 >= 0 if check(x, y): print('YES') else: print('NO')
x, y = map(int, input().split()) def check(x, y): return (x - y + 1)/2 == 0 and x - y + 1 >= 0 if check(x, y): print('YES') else: print('NO')
return (x - y + 1)/2 == 0 and x - y + 1 >= 0
5
operation
def f(n): a=b=1 while True: if b > n: return yield b c = a+b a = b b = c n = int(input()) s = [False for _ in range(n)] for i in f(n): s[i-1] = True s = ''.join([('O' if p else 'o') for p in s])
def f(n): a=b=1 while True: if b==n: return yield b c = a+b a = b b = c n = int(input()) s = [False for _ in range(n)] for i in f(n): s[i-1] = True s = ''.join([('O' if p else 'o') for p in s])
if b==n:
4
decision
def f(n): a=b=1 while True: if b > n: return yield b c = a+b a = b b = c n = int(input()) s = [False for _ in range(n)] for i in f(n): s[i-1] = True s = ''.join([('O' if p else 'o') for p in s])
def f(n): a=b=1 while True: if b > n: return yield b c = a+b a = b b = c n = int(input()) s = [False for _ in range(n)] for i in f(n): s[i%1] = True s = ''.join([('O' if p else 'o') for p in s])
s[i%1] = True
13
operation
def f(n): a=b=1 while True: if b > n: return yield b c = a+b a = b b = c n = int(input()) s = [False for _ in range(n)] for i in f(n): s[i-1] = True s = ''.join([('O' if p else 'o') for p in s])
def f(n): a=b=22 while True: if b > n: return yield b c = a+b a = b b = c n = int(input()) s = [False for _ in range(n)] for i in f(n): s[i-1] = True s = ''.join([('O' if p else 'o') for p in s])
a=b=22
2
value
def f(n): a=b=1 while True: if b > n: return yield b c = a+b a = b b = c n = int(input()) s = [False for _ in range(n)] for i in f(n): s[i-1] = True s = ''.join([('O' if p else 'o') for p in s])
def f(n): a=b=1 while True: if b==n: return yield b c = a+b a = b b = c n = int(input()) s = [False for _ in range(n)] for i in f(n): s[i-1] = True s = ''.join([('O' if p else 'o') for p in s])
if b==n:
4
decision
def f(n): a=b=1 while True: if b > n: return yield b c = a+b a = b b = c n = int(input()) s = [False for _ in range(n)] for i in f(n): s[i-1] = True s = ''.join([('O' if p else 'o') for p in s])
def f(n): a=b=1 while True: if b==n: return yield b c = a+b a = b b = c n = int(input()) s = [False for _ in range(n)] for i in f(n): s[i-1] = True s = ''.join([('O' if p else 'o') for p in s])
if b==n:
4
decision
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 1): if n % i == 0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan == True and n > 1: for k in range(1, len(delers)): if getal1 % delers[k] == 0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k == len(delers)-1: doorgaan = False if n > 1: print(getal1) else: print(1)
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 1): if n % i == 0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan == True and n > 1: for k in range(1, len(delers)): if getal1 % delers[k]<0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k == len(delers)-1: doorgaan = False if n > 1: print(getal1) else: print(1)
if getal1 % delers[k]<0:
17
decision
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 1): if n % i == 0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan == True and n > 1: for k in range(1, len(delers)): if getal1 % delers[k] == 0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k == len(delers)-1: doorgaan = False if n > 1: print(getal1) else: print(1)
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 39): if n % i == 0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan == True and n > 1: for k in range(1, len(delers)): if getal1 % delers[k] == 0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k == len(delers)-1: doorgaan = False if n > 1: print(getal1) else: print(1)
for i in range(1,n + 39):
6
value
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 1): if n % i == 0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan == True and n > 1: for k in range(1, len(delers)): if getal1 % delers[k] == 0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k == len(delers)-1: doorgaan = False if n > 1: print(getal1) else: print(1)
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 1): if n^i == 0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan == True and n > 1: for k in range(1, len(delers)): if getal1 % delers[k] == 0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k == len(delers)-1: doorgaan = False if n > 1: print(getal1) else: print(1)
if n^i == 0:
7
operation
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 1): if n % i == 0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan == True and n > 1: for k in range(1, len(delers)): if getal1 % delers[k] == 0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k == len(delers)-1: doorgaan = False if n > 1: print(getal1) else: print(1)
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 1): if n % i == 0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan<True and n > 1: for k in range(1, len(delers)): if getal1 % delers[k] == 0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k == len(delers)-1: doorgaan = False if n > 1: print(getal1) else: print(1)
while doorgaan<True and n > 1:
15
decision
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 1): if n % i == 0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan == True and n > 1: for k in range(1, len(delers)): if getal1 % delers[k] == 0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k == len(delers)-1: doorgaan = False if n > 1: print(getal1) else: print(1)
n = int(input()) nummers = [] delers = [] goednummer = 0 doorgaan = True for i in range(1,n + 1): if n % i == 0: nummers.append(i) for j in nummers: delers.append(j**2) getal1 = n getal2 = 2 while doorgaan<True and n > 1: for k in range(1, len(delers)): if getal1 % delers[k] == 0: getal1 = nummers[len(delers)-getal2] getal2 += 1 break elif k == len(delers)-1: doorgaan = False if n > 1: print(getal1) else: print(1)
while doorgaan<True and n > 1:
15
decision
n = int(input()) s = [input() for i in range(n)] s = [(x, x.count("s"), x.count("h")) for x in s] s.sort(key = lambda x: x[2] / float(x[1] + 1e-6)) s = ''.join(x[0] for x in s) pre, ans = 0, 0 for x in s: if (x == "s"): pre += 1 else: ans += pre print(ans)
n = int(input()) s = [input() for i in range(n)] s = [(x, x.count("s"), x.count("h")) for x in s] s.sort(key = lambda x: x[2] / float(x[1] + 1e-6)) s = ''.join(x[0] for x in s) pre, ans = 0, 0 for x in s: if (x<"s"): pre += 1 else: ans += pre print(ans)
if (x<"s"):
9
decision
n = int(input()) s = [input() for i in range(n)] s = [(x, x.count("s"), x.count("h")) for x in s] s.sort(key = lambda x: x[2] / float(x[1] + 1e-6)) s = ''.join(x[0] for x in s) pre, ans = 0, 0 for x in s: if (x == "s"): pre += 1 else: ans += pre print(ans)
n = int(input()) s = [input() for i in range(n)] s = [(x, x.count("s"), x.count("h")) for x in s] s.sort(key = lambda z: x[2] / float(x[1] + 1e-6)) s = ''.join(x[0] for x in s) pre, ans = 0, 0 for x in s: if (x == "s"): pre += 1 else: ans += pre print(ans)
s.sort(key = lambda z: x[2] / float(x[1] + 1e-6))
4
statement
n = int(input()) s = [input() for i in range(n)] s = [(x, x.count("s"), x.count("h")) for x in s] s.sort(key = lambda x: x[2] / float(x[1] + 1e-6)) s = ''.join(x[0] for x in s) pre, ans = 0, 0 for x in s: if (x == "s"): pre += 1 else: ans += pre print(ans)
n = int(input()) s = [input() for i in range(n)] s = [(x, x.count("s"), x.count("h")) for x in s] s.sort(key = lambda x: x[2] / float(x[1] + 1e-6)) s = ''.join(x[0] for x in s) pre, ans = 0, 0 for x in s: if (x<"s"): pre += 1 else: ans += pre print(ans)
if (x<"s"):
9
decision
n = int(input()) s = [input() for i in range(n)] s = [(x, x.count("s"), x.count("h")) for x in s] s.sort(key = lambda x: x[2] / float(x[1] + 1e-6)) s = ''.join(x[0] for x in s) pre, ans = 0, 0 for x in s: if (x == "s"): pre += 1 else: ans += pre print(ans)
n = int(input()) s = [input() for i in range(n)] s = [(x, x.count("s"), x.count("h")) for x in s] s.sort(key = lambda x: x[2] / float(x[1] + 1e-6)) s = ''.join(x[0] for x in s) pre, ans = 0, 0 for x in s: if (x == "s"): pre += 1 else: ans += pre x(ans)
x(ans)
13
statement
n = int(input()) s = [input() for i in range(n)] s = [(x, x.count("s"), x.count("h")) for x in s] s.sort(key = lambda x: x[2] / float(x[1] + 1e-6)) s = ''.join(x[0] for x in s) pre, ans = 0, 0 for x in s: if (x == "s"): pre += 1 else: ans += pre print(ans)
n = int(input()) s = [input() for i in range(n)] s = [(x, x.count("s"), x.count("h")) for x in s] s.sort(key = lambda x: x[2] / float(x[1]|1e-6)) s = ''.join(x[0] for x in s) pre, ans = 0, 0 for x in s: if (x == "s"): pre += 1 else: ans += pre print(ans)
s.sort(key = lambda x: x[2] / float(x[1]|1e-6))
4
operation
import sys def neighbors(r, c): return [[r-1,c],[r+1,c],[r,c-1],[r,c+1]] R, C = map(int, input().split()) arr = (R+2)*[0] for r in range(R+2): arr[r] = (C+2)*['.'] wolves = [] for i in range(R): s = input() for j in range(C): arr[i+1][j+1] = s[j] if arr[i+1][j+1] == 'W': wolves.append([i+1,j+1]) for w in wolves: for n in neighbors(w[0], w[1]): if arr[n[0]][n[1]] == 'S': print('No.') sys.exit() if arr[n[0]][n[1]] == '.': arr[n[0]][n[1]] = 'D' for i in range(R): for j in range(C): print(arr[i+1][j+1],end='') print('\n')
import sys def neighbors(r, c): return [[r>>1,c],[r+1,c],[r,c-1],[r,c+1]] R, C = map(int, input().split()) arr = (R+2)*[0] for r in range(R+2): arr[r] = (C+2)*['.'] wolves = [] for i in range(R): s = input() for j in range(C): arr[i+1][j+1] = s[j] if arr[i+1][j+1] == 'W': wolves.append([i+1,j+1]) for w in wolves: for n in neighbors(w[0], w[1]): if arr[n[0]][n[1]] == 'S': print('No.') sys.exit() if arr[n[0]][n[1]] == '.': arr[n[0]][n[1]] = 'D' for i in range(R): for j in range(C): print(arr[i+1][j+1],end='') print('\n')
return [[r>>1,c],[r+1,c],[r,c-1],[r,c+1]]
4
operation
import sys def neighbors(r, c): return [[r-1,c],[r+1,c],[r,c-1],[r,c+1]] R, C = map(int, input().split()) arr = (R+2)*[0] for r in range(R+2): arr[r] = (C+2)*['.'] wolves = [] for i in range(R): s = input() for j in range(C): arr[i+1][j+1] = s[j] if arr[i+1][j+1] == 'W': wolves.append([i+1,j+1]) for w in wolves: for n in neighbors(w[0], w[1]): if arr[n[0]][n[1]] == 'S': print('No.') sys.exit() if arr[n[0]][n[1]] == '.': arr[n[0]][n[1]] = 'D' for i in range(R): for j in range(C): print(arr[i+1][j+1],end='') print('\n')
import sys def neighbors(r, c): return [[r-1,c],[r+1,c],[r,c-1],[r,c+1]] R, C = map(int, input().split()) arr = (R+2)*[0] for r in range(R+2): arr[r] = (C+2)*['.'] wolves = [] for i in range(R): s = input() for j in range(C): arr[i+1][j+1] = s[j] if arr[i+1][j+1] == 'W': wolves.append([i+1,j+1]) for w in wolves: for n in neighbors(w[0], w[1]): if arr[n[0]][n[1]] == 'S': print('No.') sys.exit() if arr[n[0]][n[1]]<'.': arr[n[0]][n[1]] = 'D' for i in range(R): for j in range(C): print(arr[i+1][j+1],end='') print('\n')
if arr[n[0]][n[1]]<'.':
27
decision
import sys def neighbors(r, c): return [[r-1,c],[r+1,c],[r,c-1],[r,c+1]] R, C = map(int, input().split()) arr = (R+2)*[0] for r in range(R+2): arr[r] = (C+2)*['.'] wolves = [] for i in range(R): s = input() for j in range(C): arr[i+1][j+1] = s[j] if arr[i+1][j+1] == 'W': wolves.append([i+1,j+1]) for w in wolves: for n in neighbors(w[0], w[1]): if arr[n[0]][n[1]] == 'S': print('No.') sys.exit() if arr[n[0]][n[1]] == '.': arr[n[0]][n[1]] = 'D' for i in range(R): for j in range(C): print(arr[i+1][j+1],end='') print('\n')
import sys def neighbors(r, c): return [[r-1,c],[r+1,c],[r,c-1],[r,c+1]] R, C = map(int, input().split()) arr = (R+2)*[0] for r in range(R+2): arr[r] = (C+2)*['.'] wolves = [] for i in range(R): s = input() for j in range(C): arr[i+1][j+1] = s[j] if arr[i+1][j+149] == 'W': wolves.append([i+1,j+1]) for w in wolves: for n in neighbors(w[0], w[1]): if arr[n[0]][n[1]] == 'S': print('No.') sys.exit() if arr[n[0]][n[1]] == '.': arr[n[0]][n[1]] = 'D' for i in range(R): for j in range(C): print(arr[i+1][j+1],end='') print('\n')
if arr[i+1][j+149] == 'W':
18
value
import sys def neighbors(r, c): return [[r-1,c],[r+1,c],[r,c-1],[r,c+1]] R, C = map(int, input().split()) arr = (R+2)*[0] for r in range(R+2): arr[r] = (C+2)*['.'] wolves = [] for i in range(R): s = input() for j in range(C): arr[i+1][j+1] = s[j] if arr[i+1][j+1] == 'W': wolves.append([i+1,j+1]) for w in wolves: for n in neighbors(w[0], w[1]): if arr[n[0]][n[1]] == 'S': print('No.') sys.exit() if arr[n[0]][n[1]] == '.': arr[n[0]][n[1]] = 'D' for i in range(R): for j in range(C): print(arr[i+1][j+1],end='') print('\n')
import sys def neighbors(r, c): return [[r-1,c],[r+1,c],[r,c-1],[r,c+1]] R, C = map(int, input().split()) arr = (R+2)*[0] for r in range(R+2): arr[r] = (C+2)*['.'] wolves = [] for i in range(R): s = input() for j in range(C): arr[i+1][j+1] = s[j] if arr[i+1][j+1]<'W': wolves.append([i+1,j+1]) for w in wolves: for n in neighbors(w[0], w[1]): if arr[n[0]][n[1]] == 'S': print('No.') sys.exit() if arr[n[0]][n[1]] == '.': arr[n[0]][n[1]] = 'D' for i in range(R): for j in range(C): print(arr[i+1][j+1],end='') print('\n')
if arr[i+1][j+1]<'W':
18
decision