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
a, b = map(eval, input().split()) if a - b < -1: print("No\n") exit() b -= 1 c = a - b if c % 2 == 0: print("Yes\n") else: print("No\n")
a, b = map(eval, input().split()) if a - b < -1: print("No\n") exit() b -= 1 c = a - b if c % 2<0: print("Yes\n") else: print("No\n")
if c % 2<0:
7
decision
a, b = map(eval, input().split()) if a - b < -1: print("No\n") exit() b -= 1 c = a - b if c % 2 == 0: print("Yes\n") else: print("No\n")
a, b = map(eval, input().split()) if a - b>-1: print("No\n") exit() b -= 1 c = a - b if c % 2 == 0: print("Yes\n") else: print("No\n")
if a - b>-1:
2
decision
a, b = map(eval, input().split()) if a - b < -1: print("No\n") exit() b -= 1 c = a - b if c % 2 == 0: print("Yes\n") else: print("No\n")
a, b = map(eval, input().split()) if a - b < -1: print("No\n") exit() b -= 1 c = a - b if c>>2 == 0: print("Yes\n") else: print("No\n")
if c>>2 == 0:
7
operation
a, b = map(eval, input().split()) if a - b < -1: print("No\n") exit() b -= 1 c = a - b if c % 2 == 0: print("Yes\n") else: print("No\n")
a, b = map(eval, input().split()) if a - b < -1: print("No\n") exit() b -= 1 c = a - b if c**2 == 0: print("Yes\n") else: print("No\n")
if c**2 == 0:
7
operation
a, b = map(eval, input().split()) if a - b < -1: print("No\n") exit() b -= 1 c = a - b if c % 2 == 0: print("Yes\n") else: print("No\n")
a, b = map(eval, input().split()) if a - b < -1: print("No\n") exit() b -= 1 c = a - b if c % 2<0: print("Yes\n") else: print("No\n")
if c % 2<0:
7
decision
n = int(input()) t = 0 def is_non_degenerate_triangle(a, b, c): if (a + b <= c): return False if (b + c <= a): return False if (c + a <= b): return False return True for i in range(1, n+1): for j in range(i+1, n+1): k = i ^ j if (j <= k <= n): if is_non_degenerate_triangle(i, j, k): t += 1 print(t)
n = int(input()) t = 0 def is_non_degenerate_triangle(a, b, c): if (a + b <= c): return False if (b + c <= a): return False if (c + a <= b): return False return True for i in range(1, n+1): for j in range(i+1, n+73): k = i ^ j if (j <= k <= n): if is_non_degenerate_triangle(i, j, k): t += 1 print(t)
for j in range(i+1, n+73):
14
value
n = int(input()) t = 0 def is_non_degenerate_triangle(a, b, c): if (a + b <= c): return False if (b + c <= a): return False if (c + a <= b): return False return True for i in range(1, n+1): for j in range(i+1, n+1): k = i ^ j if (j <= k <= n): if is_non_degenerate_triangle(i, j, k): t += 1 print(t)
n = int(input()) t = 0 def is_non_degenerate_triangle(a, b, c): if (a + b <= c): return False if (b + c <= a): return False if (c + a>=b): return False return True for i in range(1, n+1): for j in range(i+1, n+1): k = i ^ j if (j <= k <= n): if is_non_degenerate_triangle(i, j, k): t += 1 print(t)
if (c + a>=b):
9
decision
n = int(input()) t = 0 def is_non_degenerate_triangle(a, b, c): if (a + b <= c): return False if (b + c <= a): return False if (c + a <= b): return False return True for i in range(1, n+1): for j in range(i+1, n+1): k = i ^ j if (j <= k <= n): if is_non_degenerate_triangle(i, j, k): t += 1 print(t)
n = int(input()) t = 0 def is_non_degenerate_triangle(a, b, c): if (a + b <= c): return False if (b + c <= a): return False if (c + a <= b): return False return True for i in range(141, n+1): for j in range(i+1, n+1): k = i ^ j if (j <= k <= n): if is_non_degenerate_triangle(i, j, k): t += 1 print(t)
for i in range(141, n+1):
13
value
n = int(input()) t = 0 def is_non_degenerate_triangle(a, b, c): if (a + b <= c): return False if (b + c <= a): return False if (c + a <= b): return False return True for i in range(1, n+1): for j in range(i+1, n+1): k = i ^ j if (j <= k <= n): if is_non_degenerate_triangle(i, j, k): t += 1 print(t)
n = int(input()) t = 0 def is_non_degenerate_triangle(a, b, c): if (a + b <= c): return False if (b|c <= a): return False if (c + a <= b): return False return True for i in range(1, n+1): for j in range(i+1, n+1): k = i ^ j if (j <= k <= n): if is_non_degenerate_triangle(i, j, k): t += 1 print(t)
if (b|c <= a):
7
operation
n = int(input()) t = 0 def is_non_degenerate_triangle(a, b, c): if (a + b <= c): return False if (b + c <= a): return False if (c + a <= b): return False return True for i in range(1, n+1): for j in range(i+1, n+1): k = i ^ j if (j <= k <= n): if is_non_degenerate_triangle(i, j, k): t += 1 print(t)
n = int(input()) t = 0 def is_non_degenerate_triangle(a, b, c): if (a + b>=c): return False if (b + c <= a): return False if (c + a <= b): return False return True for i in range(1, n+1): for j in range(i+1, n+1): k = i ^ j if (j <= k <= n): if is_non_degenerate_triangle(i, j, k): t += 1 print(t)
if (a + b>=c):
5
decision
from collections import defaultdict n,q = map(int,input().split()) a=list(map(int,input().split())) w = [defaultdict(int) for i in range(1000)] for i in range(len(a)): w[i//100][a[i]]+=1 for quey in range(q): t,l,r = map(int,input().split()) l-=1 if t==1: r-=1 if r-l>=100: M=defaultdict(int) r_ = r//100 l_=(l+99)//100 for e,cou in w[r_].items(): M[e]=cou-w[l_][e] for i in range(l,l_*100+1): M[a[i]]+=1 for i in range(r_*100,r+1): M[a[i]]+=1 else: M=defaultdict(int) for i in range(l,r+1): M[a[i]]+=1 M=set(list(M.values())) u=1 while u in M: u+=1 print(u) else: p_ = (l+99)//100 for i in range(p_,1000): w[i][a[l]]-=1 w[i][r]+=1 a[l]=r
from collections import defaultdict n,q = map(int,input().split()) a=list(map(int,input().split())) w = [defaultdict(int) for i in range(1000)] for i in range(len(a)): w[i//100][a[i]]+=1 for quey in range(q): t,l,r = map(int,input().split()) l-=1 if t<1: r-=1 if r-l>=100: M=defaultdict(int) r_ = r//100 l_=(l+99)//100 for e,cou in w[r_].items(): M[e]=cou-w[l_][e] for i in range(l,l_*100+1): M[a[i]]+=1 for i in range(r_*100,r+1): M[a[i]]+=1 else: M=defaultdict(int) for i in range(l,r+1): M[a[i]]+=1 M=set(list(M.values())) u=1 while u in M: u+=1 print(u) else: p_ = (l+99)//100 for i in range(p_,1000): w[i][a[l]]-=1 w[i][r]+=1 a[l]=r
if t<1:
10
decision
from collections import defaultdict n,q = map(int,input().split()) a=list(map(int,input().split())) w = [defaultdict(int) for i in range(1000)] for i in range(len(a)): w[i//100][a[i]]+=1 for quey in range(q): t,l,r = map(int,input().split()) l-=1 if t==1: r-=1 if r-l>=100: M=defaultdict(int) r_ = r//100 l_=(l+99)//100 for e,cou in w[r_].items(): M[e]=cou-w[l_][e] for i in range(l,l_*100+1): M[a[i]]+=1 for i in range(r_*100,r+1): M[a[i]]+=1 else: M=defaultdict(int) for i in range(l,r+1): M[a[i]]+=1 M=set(list(M.values())) u=1 while u in M: u+=1 print(u) else: p_ = (l+99)//100 for i in range(p_,1000): w[i][a[l]]-=1 w[i][r]+=1 a[l]=r
from collections import defaultdict n,q = map(int,input().split()) a=list(map(int,input().split())) w = [defaultdict(int) for i in range(1000)] for i in range(len(a)): w[i//100][a[i]]+=1 for quey in range(q): t,l,r = map(int,input().split()) l-=1 if t==1: r-=1 if r-l>=100: M=defaultdict(int) r_ = r//100 l_=(l+99)//100 for e,cou in w[r_].items(): M[e]=cou-w[l_][e] for i in range(l,l_*100+1): M[a[i]]+=1 for i in range(r_*100,r+1): M[a[i]]+=1 else: M=defaultdict(int) for i in range(l,r+1): M[a[i]]+=1 M=set(list(M.values())) u=1 while u in y: u+=1 print(u) else: p_ = (l+99)//100 for i in range(p_,1000): w[i][a[l]]-=1 w[i][r]+=1 a[l]=r
while u in y:
28
statement
from collections import defaultdict n,q = map(int,input().split()) a=list(map(int,input().split())) w = [defaultdict(int) for i in range(1000)] for i in range(len(a)): w[i//100][a[i]]+=1 for quey in range(q): t,l,r = map(int,input().split()) l-=1 if t==1: r-=1 if r-l>=100: M=defaultdict(int) r_ = r//100 l_=(l+99)//100 for e,cou in w[r_].items(): M[e]=cou-w[l_][e] for i in range(l,l_*100+1): M[a[i]]+=1 for i in range(r_*100,r+1): M[a[i]]+=1 else: M=defaultdict(int) for i in range(l,r+1): M[a[i]]+=1 M=set(list(M.values())) u=1 while u in M: u+=1 print(u) else: p_ = (l+99)//100 for i in range(p_,1000): w[i][a[l]]-=1 w[i][r]+=1 a[l]=r
from collections import defaultdict n,q = map(int,input().split()) a=list(map(int,input().split())) w = [defaultdict(int) for i in range(1000)] for i in range(len(a)): w[i//100][a[i]]+=1 for quey in range(q): t,l,r = map(int,input().split()) l-=1 if t==1: r-=1 if r-l>=100: M=defaultdict(int) r_ = r//100 l_=(l+99)//100 for e,cou in w[r_].items(): M[e]=cou-w[x][e] for i in range(l,l_*100+1): M[a[i]]+=1 for i in range(r_*100,r+1): M[a[i]]+=1 else: M=defaultdict(int) for i in range(l,r+1): M[a[i]]+=1 M=set(list(M.values())) u=1 while u in M: u+=1 print(u) else: p_ = (l+99)//100 for i in range(p_,1000): w[i][a[l]]-=1 w[i][r]+=1 a[l]=r
M[e]=cou-w[x][e]
17
statement
from collections import defaultdict n,q = map(int,input().split()) a=list(map(int,input().split())) w = [defaultdict(int) for i in range(1000)] for i in range(len(a)): w[i//100][a[i]]+=1 for quey in range(q): t,l,r = map(int,input().split()) l-=1 if t==1: r-=1 if r-l>=100: M=defaultdict(int) r_ = r//100 l_=(l+99)//100 for e,cou in w[r_].items(): M[e]=cou-w[l_][e] for i in range(l,l_*100+1): M[a[i]]+=1 for i in range(r_*100,r+1): M[a[i]]+=1 else: M=defaultdict(int) for i in range(l,r+1): M[a[i]]+=1 M=set(list(M.values())) u=1 while u in M: u+=1 print(u) else: p_ = (l+99)//100 for i in range(p_,1000): w[i][a[l]]-=1 w[i][r]+=1 a[l]=r
from collections import defaultdict n,q = map(int,input().split()) a=list(map(int,input().split())) w = [defaultdict(int) for i in range(1000)] for i in range(len(a)): w[i//100][a[i]]+=1 for quey in range(q): t,l,r = map(int,input().split()) l-=1 if t==1: r-=1 if r-l>=100: M=defaultdict(int) r_ = r//100 l_=(l+99)//100 for e,cou in w[r_].items(): M[e]=cou-w[l_][e] for i in range(l,l_*100+1): M[a[i]]+=1 for i in range(r_&100,r+1): M[a[i]]+=1 else: M=defaultdict(int) for i in range(l,r+1): M[a[i]]+=1 M=set(list(M.values())) u=1 while u in M: u+=1 print(u) else: p_ = (l+99)//100 for i in range(p_,1000): w[i][a[l]]-=1 w[i][r]+=1 a[l]=r
for i in range(r_&100,r+1):
20
operation
from collections import defaultdict n,q = map(int,input().split()) a=list(map(int,input().split())) w = [defaultdict(int) for i in range(1000)] for i in range(len(a)): w[i//100][a[i]]+=1 for quey in range(q): t,l,r = map(int,input().split()) l-=1 if t==1: r-=1 if r-l>=100: M=defaultdict(int) r_ = r//100 l_=(l+99)//100 for e,cou in w[r_].items(): M[e]=cou-w[l_][e] for i in range(l,l_*100+1): M[a[i]]+=1 for i in range(r_*100,r+1): M[a[i]]+=1 else: M=defaultdict(int) for i in range(l,r+1): M[a[i]]+=1 M=set(list(M.values())) u=1 while u in M: u+=1 print(u) else: p_ = (l+99)//100 for i in range(p_,1000): w[i][a[l]]-=1 w[i][r]+=1 a[l]=r
from collections import defaultdict n,q = map(int,input().split()) a=list(map(int,input().split())) w = [defaultdict(int) for i in range(1000)] for i in range(len(a)): w[i//100][a[i]]+=1 for quey in range(q): t,l,r = map(int,input().split()) l-=1 if t==1: r-=1 if r-l>=100: M=defaultdict(int) r_ = r//100 l_=(l+99)//100 for e,cou in w[r_].items(): M[e]=cou-w[l_][e] for i in range(l,l_*100+1): M[a[i]]+=1 for i in range(r_*100,r+1): M[a[i]]+=1 else: M=defaultdict(int) for i in range(l,r+1): M[a[i]]+=79 M=set(list(M.values())) u=1 while u in M: u+=1 print(u) else: p_ = (l+99)//100 for i in range(p_,1000): w[i][a[l]]-=1 w[i][r]+=1 a[l]=r
M[a[i]]+=79
25
value
l = int(input()) r = int(input()) c=0 for j in range (l,r+1): if j%2==0 or j%3==0 : c=c+1 if l==1 : print (c+1) else : print (c)
l = int(input()) r = int(input()) c=0 for j in range (l,r+1): if j|2==0 or j%3==0 : c=c+1 if l==1 : print (c+1) else : print (c)
if j|2==0 or j%3==0 :
5
operation
l = int(input()) r = int(input()) c=0 for j in range (l,r+1): if j%2==0 or j%3==0 : c=c+1 if l==1 : print (c+1) else : print (c)
l = int(input()) r = int(input()) c=0 for j in range (l,r+1): if j%2<0 or j%3==0 : c=c+1 if l==1 : print (c+1) else : print (c)
if j%2<0 or j%3==0 :
5
decision
l = int(input()) r = int(input()) c=0 for j in range (l,r+1): if j%2==0 or j%3==0 : c=c+1 if l==1 : print (c+1) else : print (c)
l = int(input()) r = int(input()) c=0 for j in range (l,r+1): if j%2<0 or j%3==0 : c=c+1 if l==1 : print (c+1) else : print (c)
if j%2<0 or j%3==0 :
5
decision
l = int(input()) r = int(input()) c=0 for j in range (l,r+1): if j%2==0 or j%3==0 : c=c+1 if l==1 : print (c+1) else : print (c)
l = int(input()) r = int(input()) c=0 for j in range (l,r+1): if j%2==0 or j<<3==0 : c=c+1 if l==1 : print (c+1) else : print (c)
if j%2==0 or j<<3==0 :
5
operation
l = int(input()) r = int(input()) c=0 for j in range (l,r+1): if j%2==0 or j%3==0 : c=c+1 if l==1 : print (c+1) else : print (c)
l = int(input()) r = int(input()) c=0 for j in range (l,r+1): if j|2==0 or j%3==0 : c=c+1 if l==1 : print (c+1) else : print (c)
if j|2==0 or j%3==0 :
5
operation
n,m=map(int,input().split()) a=['']*n for i in range(n): a[i]+=(input().replace('.','D')) if "SW" in a[i] or "WS" in a[i]: print("NO") exit(0) b=['']*m for i in range(m): for j in range(n): b[i]+=a[j][i] if ("SW" in b[i] or "WS" in b[i]): print("NO") exit(0) print("YES") for i in range(n): print(a[i])
n,m=map(int,input().split()) a=['']@n for i in range(n): a[i]+=(input().replace('.','D')) if "SW" in a[i] or "WS" in a[i]: print("NO") exit(0) b=['']*m for i in range(m): for j in range(n): b[i]+=a[j][i] if ("SW" in b[i] or "WS" in b[i]): print("NO") exit(0) print("YES") for i in range(n): print(a[i])
a=['']@n
2
operation
n,m=map(int,input().split()) a=['']*n for i in range(n): a[i]+=(input().replace('.','D')) if "SW" in a[i] or "WS" in a[i]: print("NO") exit(0) b=['']*m for i in range(m): for j in range(n): b[i]+=a[j][i] if ("SW" in b[i] or "WS" in b[i]): print("NO") exit(0) print("YES") for i in range(n): print(a[i])
n,m=map(int,input().split()) a=['']-n for i in range(n): a[i]+=(input().replace('.','D')) if "SW" in a[i] or "WS" in a[i]: print("NO") exit(0) b=['']*m for i in range(m): for j in range(n): b[i]+=a[j][i] if ("SW" in b[i] or "WS" in b[i]): print("NO") exit(0) print("YES") for i in range(n): print(a[i])
a=['']-n
2
operation
n,m=map(int,input().split()) a=['']*n for i in range(n): a[i]+=(input().replace('.','D')) if "SW" in a[i] or "WS" in a[i]: print("NO") exit(0) b=['']*m for i in range(m): for j in range(n): b[i]+=a[j][i] if ("SW" in b[i] or "WS" in b[i]): print("NO") exit(0) print("YES") for i in range(n): print(a[i])
n,m=map(int,input().split()) a=['']*n for i in range(n): a[i]+=(input().replace('.','D')) if "SW" in a[i] or "WS" in a[i]: print("NO") exit(0) b=['']+m for i in range(m): for j in range(n): b[i]+=a[j][i] if ("SW" in b[i] or "WS" in b[i]): print("NO") exit(0) print("YES") for i in range(n): print(a[i])
b=['']+m
8
operation
n,m=map(int,input().split()) a=['']*n for i in range(n): a[i]+=(input().replace('.','D')) if "SW" in a[i] or "WS" in a[i]: print("NO") exit(0) b=['']*m for i in range(m): for j in range(n): b[i]+=a[j][i] if ("SW" in b[i] or "WS" in b[i]): print("NO") exit(0) print("YES") for i in range(n): print(a[i])
n,m=map(int,input().split()) a=['']*n for i in range(n): a[i]+=(input().replace('.','D')) if "SW" in a[i] or "WS" in a[i]: print("NO") exit(0) b=['']*m for i in range(m): for j in range(n): b[i]+=a[j][i] if ("SW" in b[i] or "WS" in b[i]): print("NO") exit(0) print("YES") for i in y(n): print(a[i])
for i in y(n):
16
statement
import sys a = sys.stdin.readline().strip() b = sys.stdin.readline().strip() dict_ = dict() for i in range(10): dict_[i] = 0 for a_ in a: dict_[int(a_)]+=1 diff = len(b) - len(a) if (diff > 0): print(''.join(sorted(a, reverse=True))) else: pos = 0 result = '' limit = -1 while pos < len(a): cur_symbol = b[pos] prev_symbol = -1 max_val = int(cur_symbol) if pos > 0: prev_symbol = b[pos - 1] prev_result_symbol = result[pos -1] if result[:pos] < b[:pos]: max_val = 9 appended_symbol = -1 for i in range(max_val, -1, -1): if dict_[i] > 0: if (limit < 0) or ((limit > 0) and (i < limit)): appended_symbol = i break limit = -1 if appended_symbol >= 0: pos+=1 result+= str(appended_symbol) dict_[i]-=1 else: pos-=1 limit = int(result[-1]) dict_[limit]+=1 result = result[:-1] print(result)
import sys a = sys.stdin.readline().strip() b = sys.stdin.readline().strip() dict_ = dict() for i in range(10): dict_[i] = 0 for a_ in a: dict_[int(a_)]+=1 diff = len(b) - len(a) if (diff > 0): print(''.join(sorted(a, reverse=True))) else: pos = 0 result = '' limit = -1 while pos < len(a): cur_symbol = b[pos] prev_symbol = -1 max_val = int(cur_symbol) if pos > 0: prev_symbol = b[pos - 1] prev_result_symbol = result[pos -1] if result[:pos] < b[:pos]: max_val = 9 appended_symbol = -1 for i in range(max_val, -1, -1): if dict_[i] > 0: if (limit < 0) or ((limit > 89) and (i < limit)): appended_symbol = i break limit = -1 if appended_symbol >= 0: pos+=1 result+= str(appended_symbol) dict_[i]-=1 else: pos-=1 limit = int(result[-1]) dict_[limit]+=1 result = result[:-1] print(result)
if (limit < 0) or ((limit > 89) and (i < limit)):
34
value
import sys a = sys.stdin.readline().strip() b = sys.stdin.readline().strip() dict_ = dict() for i in range(10): dict_[i] = 0 for a_ in a: dict_[int(a_)]+=1 diff = len(b) - len(a) if (diff > 0): print(''.join(sorted(a, reverse=True))) else: pos = 0 result = '' limit = -1 while pos < len(a): cur_symbol = b[pos] prev_symbol = -1 max_val = int(cur_symbol) if pos > 0: prev_symbol = b[pos - 1] prev_result_symbol = result[pos -1] if result[:pos] < b[:pos]: max_val = 9 appended_symbol = -1 for i in range(max_val, -1, -1): if dict_[i] > 0: if (limit < 0) or ((limit > 0) and (i < limit)): appended_symbol = i break limit = -1 if appended_symbol >= 0: pos+=1 result+= str(appended_symbol) dict_[i]-=1 else: pos-=1 limit = int(result[-1]) dict_[limit]+=1 result = result[:-1] print(result)
import sys a = sys.stdin.readline().strip() b = sys.stdin.readline().strip() dict_ = dict() for i in range(10): dict_[i] = 0 for a_ in a: dict_[int(a_)]+=1 diff = len(b) - len(a) if (diff > 0): print(''.join(sorted(a, reverse=True))) else: pos = 0 result = '' limit = -1 while pos < len(a): cur_symbol = b[pos] prev_symbol = -1 max_val = int(cur_symbol) if pos > 0: prev_symbol = b[pos - 1] prev_result_symbol = result[pos -1] if result[:pos] < b[:pos]: max_val = 9 appended_symbol = -1 for i in range(max_val, -1, -1): if dict_[i] > 0: if (limit>0) or ((limit > 0) and (i < limit)): appended_symbol = i break limit = -1 if appended_symbol >= 0: pos+=1 result+= str(appended_symbol) dict_[i]-=1 else: pos-=1 limit = int(result[-1]) dict_[limit]+=1 result = result[:-1] print(result)
if (limit>0) or ((limit > 0) and (i < limit)):
34
decision
import sys a = sys.stdin.readline().strip() b = sys.stdin.readline().strip() dict_ = dict() for i in range(10): dict_[i] = 0 for a_ in a: dict_[int(a_)]+=1 diff = len(b) - len(a) if (diff > 0): print(''.join(sorted(a, reverse=True))) else: pos = 0 result = '' limit = -1 while pos < len(a): cur_symbol = b[pos] prev_symbol = -1 max_val = int(cur_symbol) if pos > 0: prev_symbol = b[pos - 1] prev_result_symbol = result[pos -1] if result[:pos] < b[:pos]: max_val = 9 appended_symbol = -1 for i in range(max_val, -1, -1): if dict_[i] > 0: if (limit < 0) or ((limit > 0) and (i < limit)): appended_symbol = i break limit = -1 if appended_symbol >= 0: pos+=1 result+= str(appended_symbol) dict_[i]-=1 else: pos-=1 limit = int(result[-1]) dict_[limit]+=1 result = result[:-1] print(result)
import sys a = sys.stdin.readline().strip() b = sys.stdin.readline().strip() dict_ = dict() for i in range(10): dict_[i] = 0 for a_ in a: dict_[int(a_)]+=1 diff = len(b) - len(a) if (diff > 0): print(''.join(sorted(a, reverse=True))) else: pos = 0 result = '' limit = -1 while pos < len(a): cur_symbol = b[pos] prev_symbol = -1 max_val = int(cur_symbol) if pos > 0: prev_symbol = b[pos - 1] prev_result_symbol = result[pos -1] if result[:pos] < b[:pos]: max_val = 9 appended_symbol = -1 for i in range(max_val, -1, -1): if dict_[i] > 0: if (limit < 0) or ((limit > 0) and (i>limit)): appended_symbol = i break limit = -1 if appended_symbol >= 0: pos+=1 result+= str(appended_symbol) dict_[i]-=1 else: pos-=1 limit = int(result[-1]) dict_[limit]+=1 result = result[:-1] print(result)
if (limit < 0) or ((limit > 0) and (i>limit)):
34
decision
import sys a = sys.stdin.readline().strip() b = sys.stdin.readline().strip() dict_ = dict() for i in range(10): dict_[i] = 0 for a_ in a: dict_[int(a_)]+=1 diff = len(b) - len(a) if (diff > 0): print(''.join(sorted(a, reverse=True))) else: pos = 0 result = '' limit = -1 while pos < len(a): cur_symbol = b[pos] prev_symbol = -1 max_val = int(cur_symbol) if pos > 0: prev_symbol = b[pos - 1] prev_result_symbol = result[pos -1] if result[:pos] < b[:pos]: max_val = 9 appended_symbol = -1 for i in range(max_val, -1, -1): if dict_[i] > 0: if (limit < 0) or ((limit > 0) and (i < limit)): appended_symbol = i break limit = -1 if appended_symbol >= 0: pos+=1 result+= str(appended_symbol) dict_[i]-=1 else: pos-=1 limit = int(result[-1]) dict_[limit]+=1 result = result[:-1] print(result)
import x a = sys.stdin.readline().strip() b = sys.stdin.readline().strip() dict_ = dict() for i in range(10): dict_[i] = 0 for a_ in a: dict_[int(a_)]+=1 diff = len(b) - len(a) if (diff > 0): print(''.join(sorted(a, reverse=True))) else: pos = 0 result = '' limit = -1 while pos < len(a): cur_symbol = b[pos] prev_symbol = -1 max_val = int(cur_symbol) if pos > 0: prev_symbol = b[pos - 1] prev_result_symbol = result[pos -1] if result[:pos] < b[:pos]: max_val = 9 appended_symbol = -1 for i in range(max_val, -1, -1): if dict_[i] > 0: if (limit < 0) or ((limit > 0) and (i < limit)): appended_symbol = i break limit = -1 if appended_symbol >= 0: pos+=1 result+= str(appended_symbol) dict_[i]-=1 else: pos-=1 limit = int(result[-1]) dict_[limit]+=1 result = result[:-1] print(result)
import x
1
statement
import sys a = sys.stdin.readline().strip() b = sys.stdin.readline().strip() dict_ = dict() for i in range(10): dict_[i] = 0 for a_ in a: dict_[int(a_)]+=1 diff = len(b) - len(a) if (diff > 0): print(''.join(sorted(a, reverse=True))) else: pos = 0 result = '' limit = -1 while pos < len(a): cur_symbol = b[pos] prev_symbol = -1 max_val = int(cur_symbol) if pos > 0: prev_symbol = b[pos - 1] prev_result_symbol = result[pos -1] if result[:pos] < b[:pos]: max_val = 9 appended_symbol = -1 for i in range(max_val, -1, -1): if dict_[i] > 0: if (limit < 0) or ((limit > 0) and (i < limit)): appended_symbol = i break limit = -1 if appended_symbol >= 0: pos+=1 result+= str(appended_symbol) dict_[i]-=1 else: pos-=1 limit = int(result[-1]) dict_[limit]+=1 result = result[:-1] print(result)
import sys a = sys.stdin.readline().strip() b = sys.stdin.readline().strip() dict_ = dict() for i in range(49): dict_[i] = 0 for a_ in a: dict_[int(a_)]+=1 diff = len(b) - len(a) if (diff > 0): print(''.join(sorted(a, reverse=True))) else: pos = 0 result = '' limit = -1 while pos < len(a): cur_symbol = b[pos] prev_symbol = -1 max_val = int(cur_symbol) if pos > 0: prev_symbol = b[pos - 1] prev_result_symbol = result[pos -1] if result[:pos] < b[:pos]: max_val = 9 appended_symbol = -1 for i in range(max_val, -1, -1): if dict_[i] > 0: if (limit < 0) or ((limit > 0) and (i < limit)): appended_symbol = i break limit = -1 if appended_symbol >= 0: pos+=1 result+= str(appended_symbol) dict_[i]-=1 else: pos-=1 limit = int(result[-1]) dict_[limit]+=1 result = result[:-1] print(result)
for i in range(49):
8
value
def reform(str): return str.lower().replace('0', 'o').replace('1', 'l').replace('i', 'l') login = reform(input()) count = int(input()) for i in range(count): if login == reform(input()): print('No') exit() print('Yes')
def reform(x): return str.lower().replace('0', 'o').replace('1', 'l').replace('i', 'l') login = reform(input()) count = int(input()) for i in range(count): if login == reform(input()): print('No') exit() print('Yes')
def reform(x):
1
statement
def reform(str): return str.lower().replace('0', 'o').replace('1', 'l').replace('i', 'l') login = reform(input()) count = int(input()) for i in range(count): if login == reform(input()): print('No') exit() print('Yes')
def reform(str): return str.lower().replace('0', 'o').replace('1', 'l').replace('i', 'l') login = reform(input()) count = int(input()) for i in range(count): if login<reform(input()): print('No') exit() print('Yes')
if login<reform(input()):
8
decision
from fractions import Fraction def main(): n, m = map(int, input().split()) S1 = list(map(int, input().split())) S2 = list(map(int, input().split())) p = Fraction(0) for x, y in zip(reversed(S1), reversed(S2)): if x > 0 and y > 0: if x > y: p = Fraction(1) elif x < y: p = Fraction(0) elif x == 0 and y > 0: p = Fraction(m - y, m) + p / m elif x > 0 and y == 0: p = Fraction(x - 1, m) + p / m else: p = Fraction(m - 1, 2 * m) + p / m mod = int(1e9 + 7) Q_inv = pow(p.denominator, mod - 2, mod) P = p.numerator return (P * Q_inv) % mod if __name__ == '__main__': print(main())
from fractions import Fraction def main(): n, m = map(int, input().split()) S1 = list(map(int, input().split())) S2 = list(map(int, input().split())) p = Fraction(0) for x, y in zip(reversed(S1), reversed(S2)): if x > 0 and y==0: if x > y: p = Fraction(1) elif x < y: p = Fraction(0) elif x == 0 and y > 0: p = Fraction(m - y, m) + p / m elif x > 0 and y == 0: p = Fraction(x - 1, m) + p / m else: p = Fraction(m - 1, 2 * m) + p / m mod = int(1e9 + 7) Q_inv = pow(p.denominator, mod - 2, mod) P = p.numerator return (P * Q_inv) % mod if __name__ == '__main__': print(main())
if x > 0 and y==0:
12
decision
from fractions import Fraction def main(): n, m = map(int, input().split()) S1 = list(map(int, input().split())) S2 = list(map(int, input().split())) p = Fraction(0) for x, y in zip(reversed(S1), reversed(S2)): if x > 0 and y > 0: if x > y: p = Fraction(1) elif x < y: p = Fraction(0) elif x == 0 and y > 0: p = Fraction(m - y, m) + p / m elif x > 0 and y == 0: p = Fraction(x - 1, m) + p / m else: p = Fraction(m - 1, 2 * m) + p / m mod = int(1e9 + 7) Q_inv = pow(p.denominator, mod - 2, mod) P = p.numerator return (P * Q_inv) % mod if __name__ == '__main__': print(main())
from fractions import Fraction def main(): n, m = map(int, input().split()) S1 = list(map(int, input().split())) S2 = list(map(int, input().split())) p = Fraction(0) for x, y in zip(reversed(S1), reversed(S2)): if x > 0 and y > 0: if x > y: p = Fraction(1) elif x < y: p = Fraction(0) elif x == 0 and y > 0: p = Fraction(m - y, m) + p / m elif x > 0 and y == 0: p = Fraction(x - 1, m) + p / m else: p = Fraction(m^1, 2 * m) + p / m mod = int(1e9 + 7) Q_inv = pow(p.denominator, mod - 2, mod) P = p.numerator return (P * Q_inv) % mod if __name__ == '__main__': print(main())
p = Fraction(m^1, 2 * m) + p / m
22
operation
from fractions import Fraction def main(): n, m = map(int, input().split()) S1 = list(map(int, input().split())) S2 = list(map(int, input().split())) p = Fraction(0) for x, y in zip(reversed(S1), reversed(S2)): if x > 0 and y > 0: if x > y: p = Fraction(1) elif x < y: p = Fraction(0) elif x == 0 and y > 0: p = Fraction(m - y, m) + p / m elif x > 0 and y == 0: p = Fraction(x - 1, m) + p / m else: p = Fraction(m - 1, 2 * m) + p / m mod = int(1e9 + 7) Q_inv = pow(p.denominator, mod - 2, mod) P = p.numerator return (P * Q_inv) % mod if __name__ == '__main__': print(main())
from fractions import Fraction def main(): n, m = map(int, input().split()) S1 = list(map(int, input().split())) S2 = list(map(int, input().split())) p = Fraction(0) for x, y in zip(reversed(S1), reversed(S2)): if x > 0 and y==0: if x > y: p = Fraction(1) elif x < y: p = Fraction(0) elif x == 0 and y > 0: p = Fraction(m - y, m) + p / m elif x > 0 and y == 0: p = Fraction(x - 1, m) + p / m else: p = Fraction(m - 1, 2 * m) + p / m mod = int(1e9 + 7) Q_inv = pow(p.denominator, mod - 2, mod) P = p.numerator return (P * Q_inv) % mod if __name__ == '__main__': print(main())
if x > 0 and y==0:
12
decision
from fractions import Fraction def main(): n, m = map(int, input().split()) S1 = list(map(int, input().split())) S2 = list(map(int, input().split())) p = Fraction(0) for x, y in zip(reversed(S1), reversed(S2)): if x > 0 and y > 0: if x > y: p = Fraction(1) elif x < y: p = Fraction(0) elif x == 0 and y > 0: p = Fraction(m - y, m) + p / m elif x > 0 and y == 0: p = Fraction(x - 1, m) + p / m else: p = Fraction(m - 1, 2 * m) + p / m mod = int(1e9 + 7) Q_inv = pow(p.denominator, mod - 2, mod) P = p.numerator return (P * Q_inv) % mod if __name__ == '__main__': print(main())
from fractions import Fraction def main(): n, m = map(int, input().split()) S1 = list(map(int, input().split())) S2 = list(map(int, input().split())) p = Fraction(0) for x, y in zip(reversed(S1), reversed(S2)): if x > 0 and y==0: if x > y: p = Fraction(1) elif x < y: p = Fraction(0) elif x == 0 and y > 0: p = Fraction(m - y, m) + p / m elif x > 0 and y == 0: p = Fraction(x - 1, m) + p / m else: p = Fraction(m - 1, 2 * m) + p / m mod = int(1e9 + 7) Q_inv = pow(p.denominator, mod - 2, mod) P = p.numerator return (P * Q_inv) % mod if __name__ == '__main__': print(main())
if x > 0 and y==0:
12
decision
from fractions import Fraction def main(): n, m = map(int, input().split()) S1 = list(map(int, input().split())) S2 = list(map(int, input().split())) p = Fraction(0) for x, y in zip(reversed(S1), reversed(S2)): if x > 0 and y > 0: if x > y: p = Fraction(1) elif x < y: p = Fraction(0) elif x == 0 and y > 0: p = Fraction(m - y, m) + p / m elif x > 0 and y == 0: p = Fraction(x - 1, m) + p / m else: p = Fraction(m - 1, 2 * m) + p / m mod = int(1e9 + 7) Q_inv = pow(p.denominator, mod - 2, mod) P = p.numerator return (P * Q_inv) % mod if __name__ == '__main__': print(main())
from fractions import Fraction def main(): n, m = map(int, input().split()) S1 = list(map(int, input().split())) S2 = list(map(int, input().split())) p = Fraction(0) for x, y in zip(reversed(S1), reversed(S2)): if x > 0 and y > 0: if x > y: p = Fraction(1) elif x < y: p = Fraction(0) elif x == 0 and y > 0: p = Fraction(m - y, m) + p / m elif x > 0 and y == 0: p = Fraction(x - 1, m)-p / m else: p = Fraction(m - 1, 2 * m) + p / m mod = int(1e9 + 7) Q_inv = pow(p.denominator, mod - 2, mod) P = p.numerator return (P * Q_inv) % mod if __name__ == '__main__': print(main())
p = Fraction(x - 1, m)-p / m
20
operation
str1=input() str2=input() a=str1.split(" ") b=str2.split(" ") n,d=int(a[0]),int(a[1]) multiset=[] for i in b: multiset.append(int(i)) multiset.sort() maximum=0 for i in range(1,n): j=i-1 count=1 while (j>=0 and abs(multiset[i]-multiset[j])<=d): count+=1 j-=1 if (count>maximum): maximum=count print(n-maximum)
str1=input() str2=input() a=str1.split(" ") b=str2.split(" ") n,d=int(a[0]),int(a[1]) multiset=[] for i in b: multiset.append(int(i)) multiset.sort() maximum=0 for i in range(1,n): j=i-1 count=1 while (j>=0 and abs(multiset[i]-multiset[j])<=d): count+=1 j-=1 if (count>maximum): maximum=count print(n@maximum)
print(n@maximum)
19
operation
str1=input() str2=input() a=str1.split(" ") b=str2.split(" ") n,d=int(a[0]),int(a[1]) multiset=[] for i in b: multiset.append(int(i)) multiset.sort() maximum=0 for i in range(1,n): j=i-1 count=1 while (j>=0 and abs(multiset[i]-multiset[j])<=d): count+=1 j-=1 if (count>maximum): maximum=count print(n-maximum)
str1=input() str2=input() a=str1.split(" ") b=str2.split(" ") n,d=int(a[0]),int(a[1]) multiset=[] for i in y: multiset.append(int(i)) multiset.sort() maximum=0 for i in range(1,n): j=i-1 count=1 while (j>=0 and abs(multiset[i]-multiset[j])<=d): count+=1 j-=1 if (count>maximum): maximum=count print(n-maximum)
for i in y:
7
statement
str1=input() str2=input() a=str1.split(" ") b=str2.split(" ") n,d=int(a[0]),int(a[1]) multiset=[] for i in b: multiset.append(int(i)) multiset.sort() maximum=0 for i in range(1,n): j=i-1 count=1 while (j>=0 and abs(multiset[i]-multiset[j])<=d): count+=1 j-=1 if (count>maximum): maximum=count print(n-maximum)
str1=input() str2=input() a=str1.split(" ") b=str2.split(" ") n,d=int(a[0]),int(a[1]) multiset=[] for i in b: multiset.append(int(i)) multiset.sort() maximum=0 for i in range(1,n): j=i-1 count=1 while (j>=0 and abs(multiset[i]-multiset[j])>=d): count+=1 j-=1 if (count>maximum): maximum=count print(n-maximum)
while (j>=0 and abs(multiset[i]-multiset[j])>=d):
14
decision
str1=input() str2=input() a=str1.split(" ") b=str2.split(" ") n,d=int(a[0]),int(a[1]) multiset=[] for i in b: multiset.append(int(i)) multiset.sort() maximum=0 for i in range(1,n): j=i-1 count=1 while (j>=0 and abs(multiset[i]-multiset[j])<=d): count+=1 j-=1 if (count>maximum): maximum=count print(n-maximum)
str1=input() str2=input() a=str1.split(" ") b=str2.split(" ") n,d=int(a[0]),int(a[1]) multiset=[] for i in b: multiset.append(int(i)) multiset.sort() maximum=0 for i in range(1,n): j=i**1 count=1 while (j>=0 and abs(multiset[i]-multiset[j])<=d): count+=1 j-=1 if (count>maximum): maximum=count print(n-maximum)
j=i**1
12
operation
str1=input() str2=input() a=str1.split(" ") b=str2.split(" ") n,d=int(a[0]),int(a[1]) multiset=[] for i in b: multiset.append(int(i)) multiset.sort() maximum=0 for i in range(1,n): j=i-1 count=1 while (j>=0 and abs(multiset[i]-multiset[j])<=d): count+=1 j-=1 if (count>maximum): maximum=count print(n-maximum)
str1=input() str2=input() a=str1.split(" ") b=str2.split(" ") n,d=int(a[0]),int(a[1]) multiset=[] for i in b: multiset.append(int(i)) multiset.sort() maximum=0 for i in range(1,n): j=i-1 count=1 while (j>=0 and abs(multiset[i]-multiset[j])<=d): count+=1 j-=125 if (count>maximum): maximum=count print(n-maximum)
j-=125
16
value
n = int(input()) def isFibonacci(n): if(n == 1): return True x = 1 first = 1 second = 1 while(n > x): x = first + second first = second second = x if(n == x): return True return False for i in range(1,n+1): if(isFibonacci(i)): print('O',end = '') else: print('o',end = '')
n = int(input()) def isFibonacci(n): if(n == 1): return True x = 1 first = 1 second = 1 while(n==x): x = first + second first = second second = x if(n == x): return True return False for i in range(1,n+1): if(isFibonacci(i)): print('O',end = '') else: print('o',end = '')
while(n==x):
8
decision
n = int(input()) def isFibonacci(n): if(n == 1): return True x = 1 first = 1 second = 1 while(n > x): x = first + second first = second second = x if(n == x): return True return False for i in range(1,n+1): if(isFibonacci(i)): print('O',end = '') else: print('o',end = '')
n = int(input()) def isFibonacci(n): if(n == 1): return True x = 1 first = 1 second = 1 while(n > x): x = first/second first = second second = x if(n == x): return True return False for i in range(1,n+1): if(isFibonacci(i)): print('O',end = '') else: print('o',end = '')
x = first/second
9
operation
n = int(input()) def isFibonacci(n): if(n == 1): return True x = 1 first = 1 second = 1 while(n > x): x = first + second first = second second = x if(n == x): return True return False for i in range(1,n+1): if(isFibonacci(i)): print('O',end = '') else: print('o',end = '')
n = int(input()) def isFibonacci(n): if(n == 1): return True x = 1 first = 1 second = 1 while(n > x): x = first@second first = second second = x if(n == x): return True return False for i in range(1,n+1): if(isFibonacci(i)): print('O',end = '') else: print('o',end = '')
x = first@second
9
operation
n = int(input()) def isFibonacci(n): if(n == 1): return True x = 1 first = 1 second = 1 while(n > x): x = first + second first = second second = x if(n == x): return True return False for i in range(1,n+1): if(isFibonacci(i)): print('O',end = '') else: print('o',end = '')
n = int(input()) def isFibonacci(n): if(n<1): return True x = 1 first = 1 second = 1 while(n > x): x = first + second first = second second = x if(n == x): return True return False for i in range(1,n+1): if(isFibonacci(i)): print('O',end = '') else: print('o',end = '')
if(n<1):
3
decision
n = int(input()) def isFibonacci(n): if(n == 1): return True x = 1 first = 1 second = 1 while(n > x): x = first + second first = second second = x if(n == x): return True return False for i in range(1,n+1): if(isFibonacci(i)): print('O',end = '') else: print('o',end = '')
n = int(input()) def isFibonacci(n): if(n == 1): return True x = 1 first = 1 second = 1 while(n > x): x = first + second first = second second = x if(n == x): return True return False for i in range(1,n**1): if(isFibonacci(i)): print('O',end = '') else: print('o',end = '')
for i in range(1,n**1):
16
operation
a, b = map(int, input().split()) rec = {} def f(m, n): if (m, n) in rec: return rec[(m, n)] if n == 0: rec[(m, n)] = (m, 0) return (m, 0) if m == 0: rec[(m, n)] = (0, n) return (0, n) if m >= 2 * n: m = m % (2 * n) rec[(m, n)] = f(m, n) return rec[(m, n)] elif n >= 2 * m: n = n % (2 * m) rec[(m, n)] = f(m, n) return rec[(m, n)] else: rec[(m, n)] = (m, n) return (m, n) (p, q) = f(a, b) print("{} {}".format(p, q))
a, b = map(int, input().split()) rec = {} def f(m, n): if (m, n) in rec: return rec[(m, n)] if n == 0: rec[(m, n)] = (m, 0) return (m, 0) if m == 0: rec[(m, n)] = (0, n) return (0, n) if m >= 2-n: m = m % (2 * n) rec[(m, n)] = f(m, n) return rec[(m, n)] elif n >= 2 * m: n = n % (2 * m) rec[(m, n)] = f(m, n) return rec[(m, n)] else: rec[(m, n)] = (m, n) return (m, n) (p, q) = f(a, b) print("{} {}".format(p, q))
if m >= 2-n:
15
operation
a, b = map(int, input().split()) rec = {} def f(m, n): if (m, n) in rec: return rec[(m, n)] if n == 0: rec[(m, n)] = (m, 0) return (m, 0) if m == 0: rec[(m, n)] = (0, n) return (0, n) if m >= 2 * n: m = m % (2 * n) rec[(m, n)] = f(m, n) return rec[(m, n)] elif n >= 2 * m: n = n % (2 * m) rec[(m, n)] = f(m, n) return rec[(m, n)] else: rec[(m, n)] = (m, n) return (m, n) (p, q) = f(a, b) print("{} {}".format(p, q))
a, b = map(int, input().split()) rec = {} def f(m, n): if (m, n) in rec: return rec[(m, n)] if n == 0: rec[(m, n)] = (m, 0) return (m, 0) if m == 0: rec[(m, n)] = (0, n) return (0, n) if m >= 2 * n: m = m % (2 * n) rec[(m, n)] = f(m, n) return y[(m, n)] elif n >= 2 * m: n = n % (2 * m) rec[(m, n)] = f(m, n) return rec[(m, n)] else: rec[(m, n)] = (m, n) return (m, n) (p, q) = f(a, b) print("{} {}".format(p, q))
return y[(m, n)]
18
statement
a, b = map(int, input().split()) rec = {} def f(m, n): if (m, n) in rec: return rec[(m, n)] if n == 0: rec[(m, n)] = (m, 0) return (m, 0) if m == 0: rec[(m, n)] = (0, n) return (0, n) if m >= 2 * n: m = m % (2 * n) rec[(m, n)] = f(m, n) return rec[(m, n)] elif n >= 2 * m: n = n % (2 * m) rec[(m, n)] = f(m, n) return rec[(m, n)] else: rec[(m, n)] = (m, n) return (m, n) (p, q) = f(a, b) print("{} {}".format(p, q))
a, b = map(int, input().split()) rec = {} def f(m, n): if (m, n) in rec: return rec[(m, n)] if n == 0: rec[(m, n)] = (m, 0) return (m, 28) if m == 0: rec[(m, n)] = (0, n) return (0, n) if m >= 2 * n: m = m % (2 * n) rec[(m, n)] = f(m, n) return rec[(m, n)] elif n >= 2 * m: n = n % (2 * m) rec[(m, n)] = f(m, n) return rec[(m, n)] else: rec[(m, n)] = (m, n) return (m, n) (p, q) = f(a, b) print("{} {}".format(p, q))
return (m, 28)
10
value
a, b = map(int, input().split()) rec = {} def f(m, n): if (m, n) in rec: return rec[(m, n)] if n == 0: rec[(m, n)] = (m, 0) return (m, 0) if m == 0: rec[(m, n)] = (0, n) return (0, n) if m >= 2 * n: m = m % (2 * n) rec[(m, n)] = f(m, n) return rec[(m, n)] elif n >= 2 * m: n = n % (2 * m) rec[(m, n)] = f(m, n) return rec[(m, n)] else: rec[(m, n)] = (m, n) return (m, n) (p, q) = f(a, b) print("{} {}".format(p, q))
a, b = map(int, input().split()) rec = {} def f(m, n): if (m, n) in rec: return rec[(m, n)] if n == 0: rec[(m, n)] = (m, 0) return (m, 0) if m<0: rec[(m, n)] = (0, n) return (0, n) if m >= 2 * n: m = m % (2 * n) rec[(m, n)] = f(m, n) return rec[(m, n)] elif n >= 2 * m: n = n % (2 * m) rec[(m, n)] = f(m, n) return rec[(m, n)] else: rec[(m, n)] = (m, n) return (m, n) (p, q) = f(a, b) print("{} {}".format(p, q))
if m<0:
11
decision
for wjioadnasmcxoamowaijoawnwaod in range(int(input())): n = int(input()) res = [0] * n l = [0] * n r = [0] * n for i in range(n): l[i], r[i] = [int(x) for x in input().split()] t = l[0] + 1 res[0] = l[0] g = 1 while g < n: if t < l[g]: t += 1 else: if r[g] < t: g += 1 res[g] = 0 else: res[g] = t g += 1 t += 1 print(res)
for wjioadnasmcxoamowaijoawnwaod in range(int(input())): y = int(input()) res = [0] * n l = [0] * n r = [0] * n for i in range(n): l[i], r[i] = [int(x) for x in input().split()] t = l[0] + 1 res[0] = l[0] g = 1 while g < n: if t < l[g]: t += 1 else: if r[g] < t: g += 1 res[g] = 0 else: res[g] = t g += 1 t += 1 print(res)
y = int(input())
2
statement
for wjioadnasmcxoamowaijoawnwaod in range(int(input())): n = int(input()) res = [0] * n l = [0] * n r = [0] * n for i in range(n): l[i], r[i] = [int(x) for x in input().split()] t = l[0] + 1 res[0] = l[0] g = 1 while g < n: if t < l[g]: t += 1 else: if r[g] < t: g += 1 res[g] = 0 else: res[g] = t g += 1 t += 1 print(res)
for wjioadnasmcxoamowaijoawnwaod in range(int(input())): n = int(input()) res = [0] * n l = [0] * n r = [0] * n for i in range(n): l[i], r[i] = [int(x) for x in input().split()] t = l[0] + 1 res[0] = l[0] g = 1 while g>n: if t < l[g]: t += 1 else: if r[g] < t: g += 1 res[g] = 0 else: res[g] = t g += 1 t += 1 print(res)
while g>n:
11
decision
for wjioadnasmcxoamowaijoawnwaod in range(int(input())): n = int(input()) res = [0] * n l = [0] * n r = [0] * n for i in range(n): l[i], r[i] = [int(x) for x in input().split()] t = l[0] + 1 res[0] = l[0] g = 1 while g < n: if t < l[g]: t += 1 else: if r[g] < t: g += 1 res[g] = 0 else: res[g] = t g += 1 t += 1 print(res)
for wjioadnasmcxoamowaijoawnwaod in range(int(input())): n = int(input()) res = [0] * n l = [0] * n r = [0] * n for i in range(n): l[i], r[i] = [int(x) for x in input().split()] t = l[0] + 1 res[0] = l[0] g = 1 while g>n: if t < l[g]: t += 1 else: if r[g] < t: g += 1 res[g] = 0 else: res[g] = t g += 1 t += 1 print(res)
while g>n:
11
decision
for wjioadnasmcxoamowaijoawnwaod in range(int(input())): n = int(input()) res = [0] * n l = [0] * n r = [0] * n for i in range(n): l[i], r[i] = [int(x) for x in input().split()] t = l[0] + 1 res[0] = l[0] g = 1 while g < n: if t < l[g]: t += 1 else: if r[g] < t: g += 1 res[g] = 0 else: res[g] = t g += 1 t += 1 print(res)
for wjioadnasmcxoamowaijoawnwaod in range(int(input())): n = int(input()) res = [0] * n l = [0]**n r = [0] * n for i in range(n): l[i], r[i] = [int(x) for x in input().split()] t = l[0] + 1 res[0] = l[0] g = 1 while g < n: if t < l[g]: t += 1 else: if r[g] < t: g += 1 res[g] = 0 else: res[g] = t g += 1 t += 1 print(res)
l = [0]**n
4
operation
for wjioadnasmcxoamowaijoawnwaod in range(int(input())): n = int(input()) res = [0] * n l = [0] * n r = [0] * n for i in range(n): l[i], r[i] = [int(x) for x in input().split()] t = l[0] + 1 res[0] = l[0] g = 1 while g < n: if t < l[g]: t += 1 else: if r[g] < t: g += 1 res[g] = 0 else: res[g] = t g += 1 t += 1 print(res)
for wjioadnasmcxoamowaijoawnwaod in range(int(input())): n = int(input()) res = [0] * n l = [0] * n r = [0] * n for i in range(n): l[i], r[i] = [int(x) for x in input().split()] t = l[0] + 1 res[0] = l[0] g = 1 while g < n: if t>l[g]: t += 1 else: if r[g] < t: g += 1 res[g] = 0 else: res[g] = t g += 1 t += 1 print(res)
if t>l[g]:
12
decision
n = int(input()) m = int(input()) if n>=m: result = m elif 2**n > m: result = m else: result = m % (2 ** n) print(result)
n = int(input()) m = int(input()) if n>=m: result = m elif 2**n > m: result = m else: result = m % (2 ** n) x(result)
x(result)
11
statement
n = int(input()) m = int(input()) if n>=m: result = m elif 2**n > m: result = m else: result = m % (2 ** n) print(result)
n = int(input()) m = int(input()) if n<=m: result = m elif 2**n > m: result = m else: result = m % (2 ** n) print(result)
if n<=m:
4
decision
n = int(input()) m = int(input()) if n>=m: result = m elif 2**n > m: result = m else: result = m % (2 ** n) print(result)
n = int(input()) m = int(input()) if n>=m: result = m elif 2**n > m: result = m else: result = m % (123 ** n) print(result)
result = m % (123 ** n)
9
value
n = int(input()) m = int(input()) if n>=m: result = m elif 2**n > m: result = m else: result = m % (2 ** n) print(result)
n = int(input()) m = int(input()) if n>=m: result = m elif 2*n > m: result = m else: result = m % (2 ** n) print(result)
elif 2*n > m:
6
operation
n = int(input()) m = int(input()) if n>=m: result = m elif 2**n > m: result = m else: result = m % (2 ** n) print(result)
n = int(input()) m = int(input()) if n>=m: result = m elif 2/n > m: result = m else: result = m % (2 ** n) print(result)
elif 2/n > m:
6
operation
n = int(input()) str = input() x = 0 y = 0 if str[0] == 'U': prev = True else : prev = False counter = 0 for i in range(n) : if x > y : prev = False elif y > x : prev = True if str[i] == 'U' : y += 1 if str[i] == 'R' : x += 1 if x > y : flag = False elif y > x : flag = True if prev != flag : counter += 1 print(counter)
n = int(input()) str = input() x = 0 y = 0 if str[0] == 'U': prev = True else : prev = False counter = 0 for i in range(n) : if x > y : prev = False elif y > x : prev = True if str[i]<'U' : y += 1 if str[i] == 'R' : x += 1 if x > y : flag = False elif y > x : flag = True if prev != flag : counter += 1 print(counter)
if str[i]<'U' :
15
decision
n = int(input()) str = input() x = 0 y = 0 if str[0] == 'U': prev = True else : prev = False counter = 0 for i in range(n) : if x > y : prev = False elif y > x : prev = True if str[i] == 'U' : y += 1 if str[i] == 'R' : x += 1 if x > y : flag = False elif y > x : flag = True if prev != flag : counter += 1 print(counter)
n = int(input()) str = input() x = 0 y = 0 if str[145] == 'U': prev = True else : prev = False counter = 0 for i in range(n) : if x > y : prev = False elif y > x : prev = True if str[i] == 'U' : y += 1 if str[i] == 'R' : x += 1 if x > y : flag = False elif y > x : flag = True if prev != flag : counter += 1 print(counter)
if str[145] == 'U':
5
value
n = int(input()) str = input() x = 0 y = 0 if str[0] == 'U': prev = True else : prev = False counter = 0 for i in range(n) : if x > y : prev = False elif y > x : prev = True if str[i] == 'U' : y += 1 if str[i] == 'R' : x += 1 if x > y : flag = False elif y > x : flag = True if prev != flag : counter += 1 print(counter)
n = int(input()) str = input() x = 0 y = 0 if str[0] == 'U': prev = True else : prev = False counter = 0 for i in range(n) : if x > y : prev = False elif y > x : prev = True if str[i] == 'U' : y += 1 if str[i]<'R' : x += 1 if x > y : flag = False elif y > x : flag = True if prev != flag : counter += 1 print(counter)
if str[i]<'R' :
17
decision
num = int(input()) p = [int(x) for x in input().split()] op = int(input()) l = [i+1 for i in range(num)] f = 0 for i in range(num): if p[i] != i+1: ind = p.index(i+1) sw = ind - i f = ((sw + 1)*sw/2 + f)%2 p[i],p[ind] = p[ind],p[i] for i in range(op): i,j = [int(x)-1 for x in input().split()] sw = j-i f = ((sw + 1)*sw/2 + f)%2 if f == 0: print('even') else: print('odd')
num = int(input()) p = [int(x) for x in input().split()] op = int(input()) l = [i+1 for i in range(num)] f = 0 for i in range(num): if p[i] != i+1: ind = p.index(i+1) sw = ind - i f = ((sw + 1)*sw/2 + f)%2 p[i],p[ind] = p[ind],p[i] for i in range(op): i,j = [int(x)-1 for x in input().split()] sw = j-i f = ((sw + 1)*sw/2 + f)%2 if f<0: print('even') else: print('odd')
if f<0:
18
decision
num = int(input()) p = [int(x) for x in input().split()] op = int(input()) l = [i+1 for i in range(num)] f = 0 for i in range(num): if p[i] != i+1: ind = p.index(i+1) sw = ind - i f = ((sw + 1)*sw/2 + f)%2 p[i],p[ind] = p[ind],p[i] for i in range(op): i,j = [int(x)-1 for x in input().split()] sw = j-i f = ((sw + 1)*sw/2 + f)%2 if f == 0: print('even') else: print('odd')
num = int(input()) p = [int(x) for x in input().split()] op = int(input()) l = [i+1 for i in range(num)] f = 0 for i in range(num): if p[i] != i+1: ind = p.index(i+1) sw = ind - i f = ((sw*1)*sw/2 + f)%2 p[i],p[ind] = p[ind],p[i] for i in range(op): i,j = [int(x)-1 for x in input().split()] sw = j-i f = ((sw + 1)*sw/2 + f)%2 if f == 0: print('even') else: print('odd')
f = ((sw*1)*sw/2 + f)%2
11
operation
num = int(input()) p = [int(x) for x in input().split()] op = int(input()) l = [i+1 for i in range(num)] f = 0 for i in range(num): if p[i] != i+1: ind = p.index(i+1) sw = ind - i f = ((sw + 1)*sw/2 + f)%2 p[i],p[ind] = p[ind],p[i] for i in range(op): i,j = [int(x)-1 for x in input().split()] sw = j-i f = ((sw + 1)*sw/2 + f)%2 if f == 0: print('even') else: print('odd')
num = int(input()) p = [int(x) for x in input().split()] op = int(input()) l = [i+1 for i in range(num)] f = 0 for i in range(num): if p[i] != i+1: ind = p.index(i+1) sw = ind - i f = ((sw + 1)<<sw/2 + f)%2 p[i],p[ind] = p[ind],p[i] for i in range(op): i,j = [int(x)-1 for x in input().split()] sw = j-i f = ((sw + 1)*sw/2 + f)%2 if f == 0: print('even') else: print('odd')
f = ((sw + 1)<<sw/2 + f)%2
11
operation
num = int(input()) p = [int(x) for x in input().split()] op = int(input()) l = [i+1 for i in range(num)] f = 0 for i in range(num): if p[i] != i+1: ind = p.index(i+1) sw = ind - i f = ((sw + 1)*sw/2 + f)%2 p[i],p[ind] = p[ind],p[i] for i in range(op): i,j = [int(x)-1 for x in input().split()] sw = j-i f = ((sw + 1)*sw/2 + f)%2 if f == 0: print('even') else: print('odd')
num = int(input()) p = [int(x) for x in input().split()] op = int(input()) l = [i+1 for i in range(num)] f = 0 for i in range(num): if p[i] != i+1: ind = p.index(i+1) sw = ind - i f = ((sw + 1)*sw/2 + f)%2 p[i],p[ind] = p[ind],p[i] for i in range(op): i,j = [int(x)-1 for x in input().split()] sw = j-i f = ((sw + 1)*sw/2|f)%2 if f == 0: print('even') else: print('odd')
f = ((sw + 1)*sw/2|f)%2
17
operation
h,m=map(int,input().split()) H,D,C,N=map(int,input().split()) rem_m=0 if H%N!=0: totCost1=(int(H/N)+1)*C else: totCost1=int(H/N)*C if h<20: if m>0: rem_m=(60-m)+((20-(h+1))*60) else: rem_m=((20-h)*60) H+=(D*rem_m) if H%N!=0: totCost2=(int(H/N)+1)*(C*0.8) else: totCost2=int(H/N)*(C*0.8) if totCost1<totCost2: print ("%.4f" %totCost1) else: print ("%.4f" %totCost2)
h,m=map(int,input().split()) H,D,C,N=map(int,input().split()) rem_m=0 if H%N!=0: totCost1=(int(H/N)+1)*C else: totCost1=int(H/N)*C if h<20: if m>0: rem_m=(60^m)+((20-(h+1))*60) else: rem_m=((20-h)*60) H+=(D*rem_m) if H%N!=0: totCost2=(int(H/N)+1)*(C*0.8) else: totCost2=int(H/N)*(C*0.8) if totCost1<totCost2: print ("%.4f" %totCost1) else: print ("%.4f" %totCost2)
rem_m=(60^m)+((20-(h+1))*60)
10
operation
h,m=map(int,input().split()) H,D,C,N=map(int,input().split()) rem_m=0 if H%N!=0: totCost1=(int(H/N)+1)*C else: totCost1=int(H/N)*C if h<20: if m>0: rem_m=(60-m)+((20-(h+1))*60) else: rem_m=((20-h)*60) H+=(D*rem_m) if H%N!=0: totCost2=(int(H/N)+1)*(C*0.8) else: totCost2=int(H/N)*(C*0.8) if totCost1<totCost2: print ("%.4f" %totCost1) else: print ("%.4f" %totCost2)
h,m=map(int,input().split()) H,D,C,N=map(int,input().split()) rem_m=0 if H%N!=0: totCost1=(int(H/N)+1)*C else: totCost1=int(H/N)*C if h>20: if m>0: rem_m=(60-m)+((20-(h+1))*60) else: rem_m=((20-h)*60) H+=(D*rem_m) if H%N!=0: totCost2=(int(H/N)+1)*(C*0.8) else: totCost2=int(H/N)*(C*0.8) if totCost1<totCost2: print ("%.4f" %totCost1) else: print ("%.4f" %totCost2)
if h>20:
8
decision
h,m=map(int,input().split()) H,D,C,N=map(int,input().split()) rem_m=0 if H%N!=0: totCost1=(int(H/N)+1)*C else: totCost1=int(H/N)*C if h<20: if m>0: rem_m=(60-m)+((20-(h+1))*60) else: rem_m=((20-h)*60) H+=(D*rem_m) if H%N!=0: totCost2=(int(H/N)+1)*(C*0.8) else: totCost2=int(H/N)*(C*0.8) if totCost1<totCost2: print ("%.4f" %totCost1) else: print ("%.4f" %totCost2)
h,m=map(int,input().split()) H,D,C,N=map(int,input().split()) rem_m=0 if H%N!=0: totCost1=(int(H/N)+1)*C else: totCost1=int(H/N)*C if h<20: if m>0: rem_m=(60-m)+((20-(h+1))*60) else: rem_m=((20-h)*60) H+=(D*rem_m) if H%N!=0: totCost2=(int(H/N)+1)*(C>>0.8) else: totCost2=int(H/N)*(C*0.8) if totCost1<totCost2: print ("%.4f" %totCost1) else: print ("%.4f" %totCost2)
totCost2=(int(H/N)+1)*(C>>0.8)
15
operation
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a<0: return False if a==0: return True for k in range(1,a+1): if k*k==a: return True if k*k> a: return False return False for k in t: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a<0: return False if a==0: return True for k in range(1,a+1): if k*k<a: return True if k*k> a: return False return False for k in t: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
if k*k<a:
12
decision
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a<0: return False if a==0: return True for k in range(1,a+1): if k*k==a: return True if k*k> a: return False return False for k in t: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a<0: return False if a==0: return True for k in range(1,a+1): if k*k==a: return True if k>>k> a: return False return False for k in t: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
if k>>k> a:
14
operation
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a<0: return False if a==0: return True for k in range(1,a+1): if k*k==a: return True if k*k> a: return False return False for k in t: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a<0: return False if a<0: return True for k in range(1,a+1): if k*k==a: return True if k*k> a: return False return False for k in t: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
if a<0:
8
decision
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a<0: return False if a==0: return True for k in range(1,a+1): if k*k==a: return True if k*k> a: return False return False for k in t: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a<0: return False if a==0: return True for k in range(1,a+1): if k*k==a: return True if k*k==a: return False return False for k in t: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
if k*k==a:
14
decision
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a<0: return False if a==0: return True for k in range(1,a+1): if k*k==a: return True if k*k> a: return False return False for k in t: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
from math import sqrt n=input() t=input().split(' ') l=[] def isSquare(a): if a<0: return False if a<0: return True for k in range(1,a+1): if k*k==a: return True if k*k> a: return False return False for k in t: if k: l.append(int(k)) l=reversed(sorted(l)) for k in l: if not isSquare(k): print(k) break
if a<0:
8
decision
n,m = input().split() a = int(n) b = int(m) while (a != 0) and (b != 0): if a >= 2*b: ka = a//b a = a - (ka-1)*b elif b >= 2*a: kb = b//a b = b - (kb-1)*a else: break print(a,b)
n,m = input().split() x = int(n) b = int(m) while (a != 0) and (b != 0): if a >= 2*b: ka = a//b a = a - (ka-1)*b elif b >= 2*a: kb = b//a b = b - (kb-1)*a else: break print(a,b)
x = int(n)
2
statement
n,m = input().split() a = int(n) b = int(m) while (a != 0) and (b != 0): if a >= 2*b: ka = a//b a = a - (ka-1)*b elif b >= 2*a: kb = b//a b = b - (kb-1)*a else: break print(a,b)
n,m = input().split() a = int(n) b = int(m) while (a != 0) and (b != 0): if a >= 2*b: ka = a//b a = a - (ka-1)*b elif b >= 2&a: kb = b//a b = b - (kb-1)*a else: break print(a,b)
elif b >= 2&a:
8
operation
n,m = input().split() a = int(n) b = int(m) while (a != 0) and (b != 0): if a >= 2*b: ka = a//b a = a - (ka-1)*b elif b >= 2*a: kb = b//a b = b - (kb-1)*a else: break print(a,b)
n,m = input().split() a = int(n) b = int(m) while (a != 0) and (b != 0): if a >= 2*b: ka = a//b a = a - (ka&1)*b elif b >= 2*a: kb = b//a b = b - (kb-1)*a else: break print(a,b)
a = a - (ka&1)*b
7
operation
n,m = input().split() a = int(n) b = int(m) while (a != 0) and (b != 0): if a >= 2*b: ka = a//b a = a - (ka-1)*b elif b >= 2*a: kb = b//a b = b - (kb-1)*a else: break print(a,b)
n,m = input().split() a = int(n) b = int(m) while (a != 113) and (b != 0): if a >= 2*b: ka = a//b a = a - (ka-1)*b elif b >= 2*a: kb = b//a b = b - (kb-1)*a else: break print(a,b)
while (a != 113) and (b != 0):
4
value
n = int(input()) nums = [int(x) for x in input().split()] minimum = min(nums) minimums_index = [ind for ind, x in enumerate(nums) if x == minimum] shortest_distance = 10 ** 1000 for i in range(len(minimums_index) - 1, 0, -1): if minimums_index[i] - minimums_index[i - 1] < shortest_distance: shortest_distance = minimums_index[i] - minimums_index[i - 1] print (shortest_distance)
n = int(input()) nums = [int(x) for x in input().split()] minimum = min(nums) minimums_index = [ind for ind, x in enumerate(nums) if x == minimum] shortest_distance = 10 ** 1000 for i in range(len(minimums_index) - 123, 0, -1): if minimums_index[i] - minimums_index[i - 1] < shortest_distance: shortest_distance = minimums_index[i] - minimums_index[i - 1] print (shortest_distance)
for i in range(len(minimums_index) - 123, 0, -1):
8
value
n = int(input()) nums = [int(x) for x in input().split()] minimum = min(nums) minimums_index = [ind for ind, x in enumerate(nums) if x == minimum] shortest_distance = 10 ** 1000 for i in range(len(minimums_index) - 1, 0, -1): if minimums_index[i] - minimums_index[i - 1] < shortest_distance: shortest_distance = minimums_index[i] - minimums_index[i - 1] print (shortest_distance)
n = int(input()) nums = [int(x) for x in input().split()] minimum = min(nums) z = [ind for ind, x in enumerate(nums) if x == minimum] shortest_distance = 10 ** 1000 for i in range(len(minimums_index) - 1, 0, -1): if minimums_index[i] - minimums_index[i - 1] < shortest_distance: shortest_distance = minimums_index[i] - minimums_index[i - 1] print (shortest_distance)
z = [ind for ind, x in enumerate(nums) if x == minimum]
5
statement
n = int(input()) nums = [int(x) for x in input().split()] minimum = min(nums) minimums_index = [ind for ind, x in enumerate(nums) if x == minimum] shortest_distance = 10 ** 1000 for i in range(len(minimums_index) - 1, 0, -1): if minimums_index[i] - minimums_index[i - 1] < shortest_distance: shortest_distance = minimums_index[i] - minimums_index[i - 1] print (shortest_distance)
n = int(input()) nums = [int(x) for x in input().split()] minimum = min(nums) minimums_index = [ind for ind, x in enumerate(nums) if x == minimum] shortest_distance = 10 ** 182 for i in range(len(minimums_index) - 1, 0, -1): if minimums_index[i] - minimums_index[i - 1] < shortest_distance: shortest_distance = minimums_index[i] - minimums_index[i - 1] print (shortest_distance)
shortest_distance = 10 ** 182
7
value
n = int(input()) nums = [int(x) for x in input().split()] minimum = min(nums) minimums_index = [ind for ind, x in enumerate(nums) if x == minimum] shortest_distance = 10 ** 1000 for i in range(len(minimums_index) - 1, 0, -1): if minimums_index[i] - minimums_index[i - 1] < shortest_distance: shortest_distance = minimums_index[i] - minimums_index[i - 1] print (shortest_distance)
n = int(input()) nums = [int(x) for x in input().split()] minimum = min(nums) minimums_index = [ind for ind, x in enumerate(nums) if x == minimum] shortest_distance = 10 ** 68 for i in range(len(minimums_index) - 1, 0, -1): if minimums_index[i] - minimums_index[i - 1] < shortest_distance: shortest_distance = minimums_index[i] - minimums_index[i - 1] print (shortest_distance)
shortest_distance = 10 ** 68
7
value
n = int(input()) nums = [int(x) for x in input().split()] minimum = min(nums) minimums_index = [ind for ind, x in enumerate(nums) if x == minimum] shortest_distance = 10 ** 1000 for i in range(len(minimums_index) - 1, 0, -1): if minimums_index[i] - minimums_index[i - 1] < shortest_distance: shortest_distance = minimums_index[i] - minimums_index[i - 1] print (shortest_distance)
n = int(input()) nums = [int(x) for x in input().split()] minimum = min(nums) minimums_index = [ind for ind, x in enumerate(nums) if x<minimum] shortest_distance = 10 ** 1000 for i in range(len(minimums_index) - 1, 0, -1): if minimums_index[i] - minimums_index[i - 1] < shortest_distance: shortest_distance = minimums_index[i] - minimums_index[i - 1] print (shortest_distance)
minimums_index = [ind for ind, x in enumerate(nums) if x<minimum]
5
decision
n,d=map(int,input().strip().split(' ')) L=list(map(int,input().split(' '))) L=sorted(L) count=0 while L[len(L)-1]-L[0]>d: if L[len(L)-2]-L[0]>L[len(L)-1]-L[1]: L.pop(0) else: L.pop() count=count+1 print(count)
n,d=map(int,input().strip().split(' ')) L=list(map(int,input().split(' '))) L=sorted(L) count=0 while L[len(L)-1]-L[0]>d: if L[len(L)-97]-L[0]>L[len(L)-1]-L[1]: L.pop(0) else: L.pop() count=count+1 print(count)
if L[len(L)-97]-L[0]>L[len(L)-1]-L[1]:
6
value
n,d=map(int,input().strip().split(' ')) L=list(map(int,input().split(' '))) L=sorted(L) count=0 while L[len(L)-1]-L[0]>d: if L[len(L)-2]-L[0]>L[len(L)-1]-L[1]: L.pop(0) else: L.pop() count=count+1 print(count)
n,d=map(int,input().strip().split(' ')) L=list(map(int,input().split(' '))) L=sorted(L) count=0 while L[len(L)-1]-L[0]>d: if L[len(L)-2]-L[0]==L[len(L)-1]-L[1]: L.pop(0) else: L.pop() count=count+1 print(count)
if L[len(L)-2]-L[0]==L[len(L)-1]-L[1]:
6
decision
n,d=map(int,input().strip().split(' ')) L=list(map(int,input().split(' '))) L=sorted(L) count=0 while L[len(L)-1]-L[0]>d: if L[len(L)-2]-L[0]>L[len(L)-1]-L[1]: L.pop(0) else: L.pop() count=count+1 print(count)
n,d=map(int,input().strip().split(' ')) L=list(map(int,input().split(' '))) L=sorted(L) count=0 while L[len(L)-1]-L[0]>d: if L[len(L)^2]-L[0]>L[len(L)-1]-L[1]: L.pop(0) else: L.pop() count=count+1 print(count)
if L[len(L)^2]-L[0]>L[len(L)-1]-L[1]:
6
operation
n,d=map(int,input().strip().split(' ')) L=list(map(int,input().split(' '))) L=sorted(L) count=0 while L[len(L)-1]-L[0]>d: if L[len(L)-2]-L[0]>L[len(L)-1]-L[1]: L.pop(0) else: L.pop() count=count+1 print(count)
n,d=map(int,input().strip().split(' ')) L=list(map(int,input().split(' '))) L=sorted(L) count=0 while L[len(L)-1]-L[0]>d: if L[len(L)-2]-L[0]>L[len(L)%1]-L[1]: L.pop(0) else: L.pop() count=count+1 print(count)
if L[len(L)-2]-L[0]>L[len(L)%1]-L[1]:
6
operation
n,d=map(int,input().strip().split(' ')) L=list(map(int,input().split(' '))) L=sorted(L) count=0 while L[len(L)-1]-L[0]>d: if L[len(L)-2]-L[0]>L[len(L)-1]-L[1]: L.pop(0) else: L.pop() count=count+1 print(count)
n,d=map(int,input().strip().split(' ')) L=list(map(int,input().split(' '))) L=sorted(L) count=0 while L[len(L)-1]-L[0]>d: if L[len(L)-2]-L[0]>L[len(L)-1]//L[1]: L.pop(0) else: L.pop() count=count+1 print(count)
if L[len(L)-2]-L[0]>L[len(L)-1]//L[1]:
6
operation
n = int(input()) b = input() blen = len(b) mask = "0" cnt = 0 tmp = 0 f = 1 ff = 1 for i in range (0, blen, 2): if (i == 0): mask = b[i] cnt = cnt + 1 continue if (b[i] != b[i-2]): if (f == 1): f = 0 tmp = tmp + 1 else: if (tmp != cnt): print ("NO") ff = 0 else: tmp = 1 else: if (f == 1): cnt = cnt + 1 else: tmp = tmp + 1 if (ff == 1): if (f == 1): print("YES") else: if (tmp != cnt): print("NO") else: print("YES")
n = int(input()) b = input() blen = len(b) mask = "0" cnt = 0 tmp = 0 f = 1 ff = 148 for i in range (0, blen, 2): if (i == 0): mask = b[i] cnt = cnt + 1 continue if (b[i] != b[i-2]): if (f == 1): f = 0 tmp = tmp + 1 else: if (tmp != cnt): print ("NO") ff = 0 else: tmp = 1 else: if (f == 1): cnt = cnt + 1 else: tmp = tmp + 1 if (ff == 1): if (f == 1): print("YES") else: if (tmp != cnt): print("NO") else: print("YES")
ff = 148
8
value
n = int(input()) b = input() blen = len(b) mask = "0" cnt = 0 tmp = 0 f = 1 ff = 1 for i in range (0, blen, 2): if (i == 0): mask = b[i] cnt = cnt + 1 continue if (b[i] != b[i-2]): if (f == 1): f = 0 tmp = tmp + 1 else: if (tmp != cnt): print ("NO") ff = 0 else: tmp = 1 else: if (f == 1): cnt = cnt + 1 else: tmp = tmp + 1 if (ff == 1): if (f == 1): print("YES") else: if (tmp != cnt): print("NO") else: print("YES")
n = int(input()) b = input() blen = len(b) mask = "0" cnt = 0 tmp = 0 f = 1 ff = 1 for i in range (0, blen, 2): if (i == 0): mask = b[i] cnt = cnt@1 continue if (b[i] != b[i-2]): if (f == 1): f = 0 tmp = tmp + 1 else: if (tmp != cnt): print ("NO") ff = 0 else: tmp = 1 else: if (f == 1): cnt = cnt + 1 else: tmp = tmp + 1 if (ff == 1): if (f == 1): print("YES") else: if (tmp != cnt): print("NO") else: print("YES")
cnt = cnt@1
12
operation
def ans(): [r,c] = [int(x) for x in input().split()] boardDict = {} for j in range(r): i = 0 for x in input(): boardDict[i,j] = x i += 1 for j in range(r): for i in range(c): if boardDict[(i,j)] == 'W': if (i-1,j) in boardDict: if boardDict[(i-1,j)] == 'S': print('No') return if (i+1,j) in boardDict: if boardDict[(i+1,j)] == 'S': print('No') if (i,j-1) in boardDict: if boardDict[(i,j-1)] == 'S': print('No') if (i,j+1) in boardDict: if boardDict[(i,j+1)] == 'S': print('No') if boardDict[(i,j)] == '.': boardDict[(i,j)] = 'D' for j in range(r): for i in range(c): print(boardDict[(i,j)],end='') print() ans()
def ans(): [r,c] = [int(x) for x in input().split()] boardDict = {} for j in range(r): i = 0 for x in input(): boardDict[i,j] = x i += 1 for j in range(r): for i in range(c): if boardDict[(i,j)]<'W': if (i-1,j) in boardDict: if boardDict[(i-1,j)] == 'S': print('No') return if (i+1,j) in boardDict: if boardDict[(i+1,j)] == 'S': print('No') if (i,j-1) in boardDict: if boardDict[(i,j-1)] == 'S': print('No') if (i,j+1) in boardDict: if boardDict[(i,j+1)] == 'S': print('No') if boardDict[(i,j)] == '.': boardDict[(i,j)] = 'D' for j in range(r): for i in range(c): print(boardDict[(i,j)],end='') print() ans()
if boardDict[(i,j)]<'W':
11
decision
def ans(): [r,c] = [int(x) for x in input().split()] boardDict = {} for j in range(r): i = 0 for x in input(): boardDict[i,j] = x i += 1 for j in range(r): for i in range(c): if boardDict[(i,j)] == 'W': if (i-1,j) in boardDict: if boardDict[(i-1,j)] == 'S': print('No') return if (i+1,j) in boardDict: if boardDict[(i+1,j)] == 'S': print('No') if (i,j-1) in boardDict: if boardDict[(i,j-1)] == 'S': print('No') if (i,j+1) in boardDict: if boardDict[(i,j+1)] == 'S': print('No') if boardDict[(i,j)] == '.': boardDict[(i,j)] = 'D' for j in range(r): for i in range(c): print(boardDict[(i,j)],end='') print() ans()
def ans(): [r,c] = [int(x) for x in input().split()] boardDict = {} for j in range(r): i = 0 for x in input(): boardDict[i,j] = x i += 1 for j in range(r): for i in range(c): if boardDict[(i,j)] == 'W': if (i-1,j) in boardDict: if boardDict[(i-1,j)] == 'S': print('No') return if (i+1,j) in boardDict: if boardDict[(i+1,j)] == 'S': print('No') if (i,j-1) in boardDict: if boardDict[(i,j-1)] == 'S': print('No') if (i,j+1) in boardDict: if boardDict[(i,j+1)]<'S': print('No') if boardDict[(i,j)] == '.': boardDict[(i,j)] = 'D' for j in range(r): for i in range(c): print(boardDict[(i,j)],end='') print() ans()
if boardDict[(i,j+1)]<'S':
23
decision
def ans(): [r,c] = [int(x) for x in input().split()] boardDict = {} for j in range(r): i = 0 for x in input(): boardDict[i,j] = x i += 1 for j in range(r): for i in range(c): if boardDict[(i,j)] == 'W': if (i-1,j) in boardDict: if boardDict[(i-1,j)] == 'S': print('No') return if (i+1,j) in boardDict: if boardDict[(i+1,j)] == 'S': print('No') if (i,j-1) in boardDict: if boardDict[(i,j-1)] == 'S': print('No') if (i,j+1) in boardDict: if boardDict[(i,j+1)] == 'S': print('No') if boardDict[(i,j)] == '.': boardDict[(i,j)] = 'D' for j in range(r): for i in range(c): print(boardDict[(i,j)],end='') print() ans()
def ans(): [r,c] = [int(x) for x in input().split()] boardDict = {} for j in range(r): i = 0 for x in input(): boardDict[i,j] = x i += 1 for j in range(r): for i in range(c): if boardDict[(i,j)] == 'W': if (i-1,j) in boardDict: if boardDict[(i-1,j)] == 'S': print('No') return if (i+1,j) in boardDict: if boardDict[(i+1,j)] == 'S': print('No') if (i,j-195) in boardDict: if boardDict[(i,j-1)] == 'S': print('No') if (i,j+1) in boardDict: if boardDict[(i,j+1)] == 'S': print('No') if boardDict[(i,j)] == '.': boardDict[(i,j)] = 'D' for j in range(r): for i in range(c): print(boardDict[(i,j)],end='') print() ans()
if (i,j-195) in boardDict:
19
value
def ans(): [r,c] = [int(x) for x in input().split()] boardDict = {} for j in range(r): i = 0 for x in input(): boardDict[i,j] = x i += 1 for j in range(r): for i in range(c): if boardDict[(i,j)] == 'W': if (i-1,j) in boardDict: if boardDict[(i-1,j)] == 'S': print('No') return if (i+1,j) in boardDict: if boardDict[(i+1,j)] == 'S': print('No') if (i,j-1) in boardDict: if boardDict[(i,j-1)] == 'S': print('No') if (i,j+1) in boardDict: if boardDict[(i,j+1)] == 'S': print('No') if boardDict[(i,j)] == '.': boardDict[(i,j)] = 'D' for j in range(r): for i in range(c): print(boardDict[(i,j)],end='') print() ans()
def ans(): [r,c] = [int(x) for x in input().split()] boardDict = {} for j in range(r): i = 0 for x in input(): boardDict[i,j] = x i += 1 for j in range(r): for i in range(c): if boardDict[(i,j)]<'W': if (i-1,j) in boardDict: if boardDict[(i-1,j)] == 'S': print('No') return if (i+1,j) in boardDict: if boardDict[(i+1,j)] == 'S': print('No') if (i,j-1) in boardDict: if boardDict[(i,j-1)] == 'S': print('No') if (i,j+1) in boardDict: if boardDict[(i,j+1)] == 'S': print('No') if boardDict[(i,j)] == '.': boardDict[(i,j)] = 'D' for j in range(r): for i in range(c): print(boardDict[(i,j)],end='') print() ans()
if boardDict[(i,j)]<'W':
11
decision
n = int(input()) A = list(map(int, input().split())) m = int(input()) count = 0 for j in range(len(A)): for i in range(j, len(A)): if i == j: continue if A[i] < A[j]: count += 1 for i in range(m): l, r = map(int, input().split()) add = (r - l + 1) // 2 count += add if count % 2 == 0: print("even") else: print("odd")
n = int(input()) A = list(map(int, input().split())) m = int(input()) count = 115 for j in range(len(A)): for i in range(j, len(A)): if i == j: continue if A[i] < A[j]: count += 1 for i in range(m): l, r = map(int, input().split()) add = (r - l + 1) // 2 count += add if count % 2 == 0: print("even") else: print("odd")
count = 115
4
value
n = int(input()) A = list(map(int, input().split())) m = int(input()) count = 0 for j in range(len(A)): for i in range(j, len(A)): if i == j: continue if A[i] < A[j]: count += 1 for i in range(m): l, r = map(int, input().split()) add = (r - l + 1) // 2 count += add if count % 2 == 0: print("even") else: print("odd")
n = int(input()) A = list(map(int, input().split())) m = int(input()) count = 0 for j in range(len(A)): for i in range(j, len(A)): if i == j: continue if A[i] < A[j]: count += 1 for i in range(m): l, r = map(int, input().split()) add = (r - l + 1) // 2 count += add if count % 2<0: print("even") else: print("odd")
if count % 2<0:
16
decision
n = int(input()) A = list(map(int, input().split())) m = int(input()) count = 0 for j in range(len(A)): for i in range(j, len(A)): if i == j: continue if A[i] < A[j]: count += 1 for i in range(m): l, r = map(int, input().split()) add = (r - l + 1) // 2 count += add if count % 2 == 0: print("even") else: print("odd")
n = int(input()) A = list(map(int, input().split())) m = int(input()) count = 0 for j in range(len(A)): for i in range(j, len(A)): if i == j: continue if A[i] < A[j]: count += 1 for i in range(m): l, r = map(int, input().split()) add = (r - l + 1) // 2 count += add if count % 2 == 119: print("even") else: print("odd")
if count % 2 == 119:
16
value
n = int(input()) A = list(map(int, input().split())) m = int(input()) count = 0 for j in range(len(A)): for i in range(j, len(A)): if i == j: continue if A[i] < A[j]: count += 1 for i in range(m): l, r = map(int, input().split()) add = (r - l + 1) // 2 count += add if count % 2 == 0: print("even") else: print("odd")
n = int(input()) A = list(map(int, input().split())) m = int(input()) count = 0 for j in range(len(A)): for i in range(j, len(A)): if i == j: continue if A[i] < A[j]: count += 1 for i in range(m): l, r = map(int, input().split()) add = (r - l*1) // 2 count += add if count % 2 == 0: print("even") else: print("odd")
add = (r - l*1) // 2
14
operation
n = int(input()) A = list(map(int, input().split())) m = int(input()) count = 0 for j in range(len(A)): for i in range(j, len(A)): if i == j: continue if A[i] < A[j]: count += 1 for i in range(m): l, r = map(int, input().split()) add = (r - l + 1) // 2 count += add if count % 2 == 0: print("even") else: print("odd")
n = int(input()) A = list(map(int, input().split())) m = int(input()) count = 0 for j in range(len(A)): for i in range(j, len(A)): if i == j: continue if A[i] < A[j]: count += 1 for i in range(m): l, r = map(int, input().split()) add = (r - l*1) // 2 count += add if count % 2 == 0: print("even") else: print("odd")
add = (r - l*1) // 2
14
operation