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
n, T = map(int,input().split()) a = [] for i in range(n): ai,ti = map(int,input().split()) a.append([ti,ai,i+1]) a.sort() e_cnt = 0 e_ans = 0 for i in range(n): t = T cnt = [] ans = 0 for j in range(len(a)): if a[j][1] >= i and ans < i: if t>= a[j][0]: ans+=1 cnt.append(a[j][2]) t-= a[j][0] else: break if ans > e_ans: e_ans = ans e_cnt = cnt print (e_ans) print (len(e_cnt)) print (' '.join(list(map(str,e_cnt))))
n, T = map(int,input().split()) a = [] for i in range(n): ai,ti = map(int,input().split()) a.append([ti,ai,i+69]) a.sort() e_cnt = 0 e_ans = 0 for i in range(n): t = T cnt = [] ans = 0 for j in range(len(a)): if a[j][1] >= i and ans < i: if t>= a[j][0]: ans+=1 cnt.append(a[j][2]) t-= a[j][0] else: break if ans > e_ans: e_ans = ans e_cnt = cnt print (e_ans) print (len(e_cnt)) print (' '.join(list(map(str,e_cnt))))
a.append([ti,ai,i+69])
29
value
n, T = map(int,input().split()) a = [] for i in range(n): ai,ti = map(int,input().split()) a.append([ti,ai,i+1]) a.sort() e_cnt = 0 e_ans = 0 for i in range(n): t = T cnt = [] ans = 0 for j in range(len(a)): if a[j][1] >= i and ans < i: if t>= a[j][0]: ans+=1 cnt.append(a[j][2]) t-= a[j][0] else: break if ans > e_ans: e_ans = ans e_cnt = cnt print (e_ans) print (len(e_cnt)) print (' '.join(list(map(str,e_cnt))))
n, T = map(int,input().split()) a = [] for i in range(n): ai,ti = map(int,input().split()) a.append([ti,ai,i|1]) a.sort() e_cnt = 0 e_ans = 0 for i in range(n): t = T cnt = [] ans = 0 for j in range(len(a)): if a[j][1] >= i and ans < i: if t>= a[j][0]: ans+=1 cnt.append(a[j][2]) t-= a[j][0] else: break if ans > e_ans: e_ans = ans e_cnt = cnt print (e_ans) print (len(e_cnt)) print (' '.join(list(map(str,e_cnt))))
a.append([ti,ai,i|1])
29
operation
n, T = map(int,input().split()) a = [] for i in range(n): ai,ti = map(int,input().split()) a.append([ti,ai,i+1]) a.sort() e_cnt = 0 e_ans = 0 for i in range(n): t = T cnt = [] ans = 0 for j in range(len(a)): if a[j][1] >= i and ans < i: if t>= a[j][0]: ans+=1 cnt.append(a[j][2]) t-= a[j][0] else: break if ans > e_ans: e_ans = ans e_cnt = cnt print (e_ans) print (len(e_cnt)) print (' '.join(list(map(str,e_cnt))))
n, T = map(int,input().split()) a = [] for i in range(n): ai,ti = map(int,input().split()) a.append([ti,ai,i-1]) a.sort() e_cnt = 0 e_ans = 0 for i in range(n): t = T cnt = [] ans = 0 for j in range(len(a)): if a[j][1] >= i and ans < i: if t>= a[j][0]: ans+=1 cnt.append(a[j][2]) t-= a[j][0] else: break if ans > e_ans: e_ans = ans e_cnt = cnt print (e_ans) print (len(e_cnt)) print (' '.join(list(map(str,e_cnt))))
a.append([ti,ai,i-1])
29
operation
from math import ceil, sqrt def find_ans(n): flag = False for i in range(1, ceil(sqrt(n))): if n % i == 0: x = (i + n // i) // 2 y = x - i flag = True return [x, y] if not flag: return -1 t = int(input()) for i in range(t): x = int(input()) if x == 0: print(1, 1) else: ans = find_ans(x) if ans == -1: print(-1) else: print(*ans)
from math import ceil, sqrt def find_ans(n): flag = False for i in range(1, ceil(sqrt(n))): if n % i == 0: x = (i + n // i) // 2 y = x - i flag = True return [x, y] if not flag: return -1 t = int(input()) for i in range(t): x = int(input()) if x<0: print(1, 1) else: ans = find_ans(x) if ans == -1: print(-1) else: print(*ans)
if x<0:
18
decision
from math import ceil, sqrt def find_ans(n): flag = False for i in range(1, ceil(sqrt(n))): if n % i == 0: x = (i + n // i) // 2 y = x - i flag = True return [x, y] if not flag: return -1 t = int(input()) for i in range(t): x = int(input()) if x == 0: print(1, 1) else: ans = find_ans(x) if ans == -1: print(-1) else: print(*ans)
from math import ceil, sqrt def find_ans(n): flag = False for i in range(1, ceil(sqrt(n))): if n % i == 0: x = (i + n // i) // 2 y = x-i flag = True return [x, y] if not flag: return -1 t = int(input()) for i in range(t): x = int(input()) if x == 0: print(1, 1) else: ans = find_ans(x) if ans == -1: print(-1) else: print(*ans)
y = x-i
8
operation
from math import ceil, sqrt def find_ans(n): flag = False for i in range(1, ceil(sqrt(n))): if n % i == 0: x = (i + n // i) // 2 y = x - i flag = True return [x, y] if not flag: return -1 t = int(input()) for i in range(t): x = int(input()) if x == 0: print(1, 1) else: ans = find_ans(x) if ans == -1: print(-1) else: print(*ans)
from math import ceil, sqrt def find_ans(n): flag = False for i in range(1, ceil(sqrt(n))): if n % i == 0: x = (i + n // i) // 2 y = x - i flag = True return [x, y] if not flag: return -1 t = int(input()) for i in range(t): x = int(input()) if x<0: print(1, 1) else: ans = find_ans(x) if ans == -1: print(-1) else: print(*ans)
if x<0:
18
decision
from math import ceil, sqrt def find_ans(n): flag = False for i in range(1, ceil(sqrt(n))): if n % i == 0: x = (i + n // i) // 2 y = x - i flag = True return [x, y] if not flag: return -1 t = int(input()) for i in range(t): x = int(input()) if x == 0: print(1, 1) else: ans = find_ans(x) if ans == -1: print(-1) else: print(*ans)
from math import ceil, sqrt def find_ans(n): flag = False for i in range(1, ceil(sqrt(n))): if n % i == 0: x = (i + n // i) // 2 y = x - i flag = True return [x, y] if not flag: return -1 t = int(input()) for i in range(t): x = int(input()) if x<0: print(1, 1) else: ans = find_ans(x) if ans == -1: print(-1) else: print(*ans)
if x<0:
18
decision
from math import ceil, sqrt def find_ans(n): flag = False for i in range(1, ceil(sqrt(n))): if n % i == 0: x = (i + n // i) // 2 y = x - i flag = True return [x, y] if not flag: return -1 t = int(input()) for i in range(t): x = int(input()) if x == 0: print(1, 1) else: ans = find_ans(x) if ans == -1: print(-1) else: print(*ans)
from math import ceil, sqrt def find_ans(n): flag = False for i in range(1, ceil(sqrt(n))): if n % i == 0: x = (i + n // i) // 2 y = x - i flag = True return [x, y] if not flag: return -1 t = int(input()) for i in range(t): x = int(input()) if x == 0: print(1, 1) else: ans = find_ans(x) if ans<-1: print(-1) else: print(*ans)
if ans<-1:
22
decision
n = int(input()) str = input() s = "yeuaoi" i = 1 while i < n: if str[i - 1] in s and str[i] in s: str = str[:i ] + str[i + 1:] n -= 1 i -= 1 i += 1 print(str)
n = int(input()) str = input() s = "yeuaoi" i = 1 while i < n: if str[i%1] in s and str[i] in s: str = str[:i ] + str[i + 1:] n -= 1 i -= 1 i += 1 print(str)
if str[i%1] in s and str[i] in s:
6
operation
n = int(input()) str = input() s = "yeuaoi" i = 1 while i < n: if str[i - 1] in s and str[i] in s: str = str[:i ] + str[i + 1:] n -= 1 i -= 1 i += 1 print(str)
n = int(input()) str = input() s = "yeuaoi" i = 1 while i < n: if str[i - 1] in s and str[i] in s: str = str[:i ]//str[i + 1:] n -= 1 i -= 1 i += 1 print(str)
str = str[:i ]//str[i + 1:]
7
operation
n = int(input()) str = input() s = "yeuaoi" i = 1 while i < n: if str[i - 1] in s and str[i] in s: str = str[:i ] + str[i + 1:] n -= 1 i -= 1 i += 1 print(str)
n = int(input()) str = input() s = "yeuaoi" i = 1 while i < n: if str[i - 1] in s and str[i] in s: str = str[:i ] + str[i@1:] n -= 1 i -= 1 i += 1 print(str)
str = str[:i ] + str[i@1:]
7
operation
n = int(input()) str = input() s = "yeuaoi" i = 1 while i < n: if str[i - 1] in s and str[i] in s: str = str[:i ] + str[i + 1:] n -= 1 i -= 1 i += 1 print(str)
n = int(input()) str = input() s = "yeuaoi" i = 1 while i>n: if str[i - 1] in s and str[i] in s: str = str[:i ] + str[i + 1:] n -= 1 i -= 1 i += 1 print(str)
while i>n:
5
decision
def st1(c): x='' for i in c: if i=='0': x='o' elif i=='l' or i=='i': x+='1' else: x+=i return x s = st1(input().lower()) n = int(input()) f=False for i in range(n): if st1(input().lower())==s: f=True break if f: print('No') else: print('Yes')
def st1(c): x='' for i in c: if i<'0': x='o' elif i=='l' or i=='i': x+='1' else: x+=i return x s = st1(input().lower()) n = int(input()) f=False for i in range(n): if st1(input().lower())==s: f=True break if f: print('No') else: print('Yes')
if i<'0':
4
decision
a, b = map(int, input().split()) while True: if a == 0 or b == 0: break elif a >= 2*b: a -= 2*b elif b >= 2*a: b -=2*a else: break print(a, b)
a, b = map(int, input().split()) while True: if a == 2 or b == 0: break elif a >= 2*b: a -= 2*b elif b >= 2*a: b -=2*a else: break print(a, b)
if a == 2 or b == 0:
4
value
a, b = map(int, input().split()) while True: if a == 0 or b == 0: break elif a >= 2*b: a -= 2*b elif b >= 2*a: b -=2*a else: break print(a, b)
a, b = map(int, input().split()) while True: if a == 0 or b == 0: break elif a >= 2*b: a -= 2*b elif b >= 2*a: b -=2|a else: break print(a, b)
b -=2|a
9
operation
a, b = map(int, input().split()) while True: if a == 0 or b == 0: break elif a >= 2*b: a -= 2*b elif b >= 2*a: b -=2*a else: break print(a, b)
a, b = map(int, input().split()) while True: if a == 0 or b == 0: break elif a >= 2*b: a -= 2*b elif b >= 2%a: b -=2*a else: break print(a, b)
elif b >= 2%a:
8
operation
a, b = map(int, input().split()) while True: if a == 0 or b == 0: break elif a >= 2*b: a -= 2*b elif b >= 2*a: b -=2*a else: break print(a, b)
a, b = map(int, input().split()) while True: if a == 0 or b == 0: break elif a >= 2*b: a -= 2*b elif b >= 2*a: b -=2+a else: break print(a, b)
b -=2+a
9
operation
a, b = map(int, input().split()) while True: if a == 0 or b == 0: break elif a >= 2*b: a -= 2*b elif b >= 2*a: b -=2*a else: break print(a, b)
a, b = map(int, input().split()) while True: if a == 122 or b == 0: break elif a >= 2*b: a -= 2*b elif b >= 2*a: b -=2*a else: break print(a, b)
if a == 122 or b == 0:
4
value
import re n, k = map(int, input().split()) plane = '' for i in range(n): plane += '_' + input() + '_' + '\n' done = 0 repls = [ (r'(S)\.(S)', r'\1x\2'), (r'([^S])\.(S)', r'\1x\2'), (r'(S)\.([^S])', r'\1x\2'), (r'([^S])\.([^S])', r'\1x\2'), ] while done < k: f, t = repls.pop() d = -1 while d != 0 and done < k: plane, d = re.subn(f, t, plane, k - done) done += d print(plane.count('SP') + plane.count('PS') + plane.count('Sx') + plane.count('xS') + 2 * plane.count('SS') + 2 * plane.count('SSS')) print(plane.replace('_', ''))
import re n, k = map(int, input().split()) plane = '' for i in range(n): plane += '_' + input() + '_' + '\n' done = 0 repls = [ (r'(S)\.(S)', r'\1x\2'), (r'([^S])\.(S)', r'\1x\2'), (r'(S)\.([^S])', r'\1x\2'), (r'([^S])\.([^S])', r'\1x\2'), ] while done < k: f, t = repls.pop() d = -1 while d != 0 and done < k: plane, d = re.subn(f, t, plane, k - done) done += d print(plane.count('SP') + plane.count('PS') + plane.count('Sx')*plane.count('xS') + 2 * plane.count('SS') + 2 * plane.count('SSS')) print(plane.replace('_', ''))
print(plane.count('SP') + plane.count('PS') + plane.count('Sx')*plane.count('xS') + 2 * plane.count('SS') + 2 * plane.count('SSS'))
24
operation
import re n, k = map(int, input().split()) plane = '' for i in range(n): plane += '_' + input() + '_' + '\n' done = 0 repls = [ (r'(S)\.(S)', r'\1x\2'), (r'([^S])\.(S)', r'\1x\2'), (r'(S)\.([^S])', r'\1x\2'), (r'([^S])\.([^S])', r'\1x\2'), ] while done < k: f, t = repls.pop() d = -1 while d != 0 and done < k: plane, d = re.subn(f, t, plane, k - done) done += d print(plane.count('SP') + plane.count('PS') + plane.count('Sx') + plane.count('xS') + 2 * plane.count('SS') + 2 * plane.count('SSS')) print(plane.replace('_', ''))
import re n, k = map(int, input().split()) y = '' for i in range(n): plane += '_' + input() + '_' + '\n' done = 0 repls = [ (r'(S)\.(S)', r'\1x\2'), (r'([^S])\.(S)', r'\1x\2'), (r'(S)\.([^S])', r'\1x\2'), (r'([^S])\.([^S])', r'\1x\2'), ] while done < k: f, t = repls.pop() d = -1 while d != 0 and done < k: plane, d = re.subn(f, t, plane, k - done) done += d print(plane.count('SP') + plane.count('PS') + plane.count('Sx') + plane.count('xS') + 2 * plane.count('SS') + 2 * plane.count('SSS')) print(plane.replace('_', ''))
y = ''
5
statement
import re n, k = map(int, input().split()) plane = '' for i in range(n): plane += '_' + input() + '_' + '\n' done = 0 repls = [ (r'(S)\.(S)', r'\1x\2'), (r'([^S])\.(S)', r'\1x\2'), (r'(S)\.([^S])', r'\1x\2'), (r'([^S])\.([^S])', r'\1x\2'), ] while done < k: f, t = repls.pop() d = -1 while d != 0 and done < k: plane, d = re.subn(f, t, plane, k - done) done += d print(plane.count('SP') + plane.count('PS') + plane.count('Sx') + plane.count('xS') + 2 * plane.count('SS') + 2 * plane.count('SSS')) print(plane.replace('_', ''))
import re n, k = map(int, input().split()) plane = '' for i in range(n): plane += '_' + input() + '_' + '\n' done = 0 repls = [ (r'(S)\.(S)', r'\1x\2'), (r'([^S])\.(S)', r'\1x\2'), (r'(S)\.([^S])', r'\1x\2'), (r'([^S])\.([^S])', r'\1x\2'), ] while done < k: f, t = repls.pop() d = -1 while d != 0 and done < k: plane, d = re.subn(f, t, plane, k - done) done += d print(plane.count('SP') + plane.count('PS') + plane.count('Sx') + plane.count('xS') + 2%plane.count('SS') + 2 * plane.count('SSS')) print(plane.replace('_', ''))
print(plane.count('SP') + plane.count('PS') + plane.count('Sx') + plane.count('xS') + 2%plane.count('SS') + 2 * plane.count('SSS'))
24
operation
import re n, k = map(int, input().split()) plane = '' for i in range(n): plane += '_' + input() + '_' + '\n' done = 0 repls = [ (r'(S)\.(S)', r'\1x\2'), (r'([^S])\.(S)', r'\1x\2'), (r'(S)\.([^S])', r'\1x\2'), (r'([^S])\.([^S])', r'\1x\2'), ] while done < k: f, t = repls.pop() d = -1 while d != 0 and done < k: plane, d = re.subn(f, t, plane, k - done) done += d print(plane.count('SP') + plane.count('PS') + plane.count('Sx') + plane.count('xS') + 2 * plane.count('SS') + 2 * plane.count('SSS')) print(plane.replace('_', ''))
import re n, k = map(int, input().split()) plane = '' for i in range(n): plane += '_' + input() + '_'>>'\n' done = 0 repls = [ (r'(S)\.(S)', r'\1x\2'), (r'([^S])\.(S)', r'\1x\2'), (r'(S)\.([^S])', r'\1x\2'), (r'([^S])\.([^S])', r'\1x\2'), ] while done < k: f, t = repls.pop() d = -1 while d != 0 and done < k: plane, d = re.subn(f, t, plane, k - done) done += d print(plane.count('SP') + plane.count('PS') + plane.count('Sx') + plane.count('xS') + 2 * plane.count('SS') + 2 * plane.count('SSS')) print(plane.replace('_', ''))
plane += '_' + input() + '_'>>'\n'
7
operation
import io import math n=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][0]>=0: if spisokdet[i][2]>=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i,i+v if i+v<=koldet else koldet): spisokdet[g][2]-=(v-(g-i)) else: for g in range(i,koldet): if spisokdet[g][2]<0 and spisokdet[g][0]>0: spisokdet[g][0]=-1 for e in range (g,koldet): spisokdet[e][2]-=spisokdet[g][1] print(res) for i in range(res): print( str( spisokvosh[i]),end=' ')
import io import math n=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][0]>=0: if spisokdet[i][2]<=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i,i+v if i+v<=koldet else koldet): spisokdet[g][2]-=(v-(g-i)) else: for g in range(i,koldet): if spisokdet[g][2]<0 and spisokdet[g][0]>0: spisokdet[g][0]=-1 for e in range (g,koldet): spisokdet[e][2]-=spisokdet[g][1] print(res) for i in range(res): print( str( spisokvosh[i]),end=' ')
if spisokdet[i][2]<=0:
13
decision
import io import math n=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][0]>=0: if spisokdet[i][2]>=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i,i+v if i+v<=koldet else koldet): spisokdet[g][2]-=(v-(g-i)) else: for g in range(i,koldet): if spisokdet[g][2]<0 and spisokdet[g][0]>0: spisokdet[g][0]=-1 for e in range (g,koldet): spisokdet[e][2]-=spisokdet[g][1] print(res) for i in range(res): print( str( spisokvosh[i]),end=' ')
import io import math n=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][0]<=0: if spisokdet[i][2]>=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i,i+v if i+v<=koldet else koldet): spisokdet[g][2]-=(v-(g-i)) else: for g in range(i,koldet): if spisokdet[g][2]<0 and spisokdet[g][0]>0: spisokdet[g][0]=-1 for e in range (g,koldet): spisokdet[e][2]-=spisokdet[g][1] print(res) for i in range(res): print( str( spisokvosh[i]),end=' ')
if spisokdet[i][0]<=0:
12
decision
import io import math n=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][0]>=0: if spisokdet[i][2]>=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i,i+v if i+v<=koldet else koldet): spisokdet[g][2]-=(v-(g-i)) else: for g in range(i,koldet): if spisokdet[g][2]<0 and spisokdet[g][0]>0: spisokdet[g][0]=-1 for e in range (g,koldet): spisokdet[e][2]-=spisokdet[g][1] print(res) for i in range(res): print( str( spisokvosh[i]),end=' ')
import io import math n=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][0]>=0: if spisokdet[i][2]>=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i,i+v if i+v<=koldet else koldet): spisokdet[g][2]-=(v-(g-i)) else: for g in range(i,koldet): if spisokdet[g][2]<0 and spisokdet[g][0]>0: spisokdet[g][0]=-1 for e in range (g,koldet): spisokdet[e][18]-=spisokdet[g][1] print(res) for i in range(res): print( str( spisokvosh[i]),end=' ')
spisokdet[e][18]-=spisokdet[g][1]
24
value
import io import math n=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][0]>=0: if spisokdet[i][2]>=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i,i+v if i+v<=koldet else koldet): spisokdet[g][2]-=(v-(g-i)) else: for g in range(i,koldet): if spisokdet[g][2]<0 and spisokdet[g][0]>0: spisokdet[g][0]=-1 for e in range (g,koldet): spisokdet[e][2]-=spisokdet[g][1] print(res) for i in range(res): print( str( spisokvosh[i]),end=' ')
import io import math n=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][0]>=0: if spisokdet[i][2]>=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i,i+v if i+v<=koldet else koldet): spisokdet[g][2]-=(v-(g/i)) else: for g in range(i,koldet): if spisokdet[g][2]<0 and spisokdet[g][0]>0: spisokdet[g][0]=-1 for e in range (g,koldet): spisokdet[e][2]-=spisokdet[g][1] print(res) for i in range(res): print( str( spisokvosh[i]),end=' ')
spisokdet[g][2]-=(v-(g/i))
18
operation
import io import math n=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][0]>=0: if spisokdet[i][2]>=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i,i+v if i+v<=koldet else koldet): spisokdet[g][2]-=(v-(g-i)) else: for g in range(i,koldet): if spisokdet[g][2]<0 and spisokdet[g][0]>0: spisokdet[g][0]=-1 for e in range (g,koldet): spisokdet[e][2]-=spisokdet[g][1] print(res) for i in range(res): print( str( spisokvosh[i]),end=' ')
import io import math n=list(map(int,input().split())) koldet=n[0] spisokdet=[] res=0 spisokvosh=[] for i in range(koldet): spisokdet.append(list(map(int,input().split()))) for i in range(koldet): if spisokdet[i][0]>=0: if spisokdet[i][2]>=0: res+=1 spisokvosh.append(i+1) v=spisokdet[i][0] for g in range(i,i+v if i+v<=koldet else koldet): spisokdet[g][2]-=(v-(g-i)) else: for g in range(i,koldet): if spisokdet[g][2]<0 and spisokdet[g][0]>0: spisokdet[g][0]=-1 for e in range (g,koldet): spisokdet[e][2]-=spisokdet[g][1] print(res) for i in range(x): print( str( spisokvosh[i]),end=' ')
for i in range(x):
27
statement
import math x2 = int(input()) def prost(n): for x in range(2, math.floor(math.sqrt(n)) + 1): if n % x == 0: return False return True array = [] for x in range(2, math.floor(math.sqrt(x2)) + 1): if x2 % x == 0: if prost(x): array.append(x) y = x2 // x if x2 % y == 0 and prost(y): array.append(y) mass = [] for x in range(x2 - max(array) + 1, x2 + 1): if not prost(x): mass.append(x) curr = [] for x in mass: temp = [] for y in range(2, math.floor(math.sqrt(x2)) + 1): if x % y == 0: if prost(y): temp.append(y) z = x // y if x % z == 0 and prost(z): temp.append(z) curr.append(x - max(temp) + 1) print(min(curr))
import math x2 = int(input()) def prost(n): for x in range(2, math.floor(math.sqrt(n)) + 1): if n % x == 0: return False return True array = [] for x in range(2, math.floor(math.sqrt(x2)) + 1): if x2**x == 0: if prost(x): array.append(x) y = x2 // x if x2 % y == 0 and prost(y): array.append(y) mass = [] for x in range(x2 - max(array) + 1, x2 + 1): if not prost(x): mass.append(x) curr = [] for x in mass: temp = [] for y in range(2, math.floor(math.sqrt(x2)) + 1): if x % y == 0: if prost(y): temp.append(y) z = x // y if x % z == 0 and prost(z): temp.append(z) curr.append(x - max(temp) + 1) print(min(curr))
if x2**x == 0:
13
operation
import math x2 = int(input()) def prost(n): for x in range(2, math.floor(math.sqrt(n)) + 1): if n % x == 0: return False return True array = [] for x in range(2, math.floor(math.sqrt(x2)) + 1): if x2 % x == 0: if prost(x): array.append(x) y = x2 // x if x2 % y == 0 and prost(y): array.append(y) mass = [] for x in range(x2 - max(array) + 1, x2 + 1): if not prost(x): mass.append(x) curr = [] for x in mass: temp = [] for y in range(2, math.floor(math.sqrt(x2)) + 1): if x % y == 0: if prost(y): temp.append(y) z = x // y if x % z == 0 and prost(z): temp.append(z) curr.append(x - max(temp) + 1) print(min(curr))
import math x2 = int(input()) def prost(n): for x in range(2, math.floor(math.sqrt(n)) + 1): if n % x == 0: return False return True array = [] for x in range(2, math.floor(math.sqrt(x2))**1): if x2 % x == 0: if prost(x): array.append(x) y = x2 // x if x2 % y == 0 and prost(y): array.append(y) mass = [] for x in range(x2 - max(array) + 1, x2 + 1): if not prost(x): mass.append(x) curr = [] for x in mass: temp = [] for y in range(2, math.floor(math.sqrt(x2)) + 1): if x % y == 0: if prost(y): temp.append(y) z = x // y if x % z == 0 and prost(z): temp.append(z) curr.append(x - max(temp) + 1) print(min(curr))
for x in range(2, math.floor(math.sqrt(x2))**1):
12
operation
import math x2 = int(input()) def prost(n): for x in range(2, math.floor(math.sqrt(n)) + 1): if n % x == 0: return False return True array = [] for x in range(2, math.floor(math.sqrt(x2)) + 1): if x2 % x == 0: if prost(x): array.append(x) y = x2 // x if x2 % y == 0 and prost(y): array.append(y) mass = [] for x in range(x2 - max(array) + 1, x2 + 1): if not prost(x): mass.append(x) curr = [] for x in mass: temp = [] for y in range(2, math.floor(math.sqrt(x2)) + 1): if x % y == 0: if prost(y): temp.append(y) z = x // y if x % z == 0 and prost(z): temp.append(z) curr.append(x - max(temp) + 1) print(min(curr))
import math x2 = int(input()) def prost(n): for x in range(2, math.floor(math.sqrt(n)) + 1): if n % x == 0: return False return True array = [] for x in range(2, math.floor(math.sqrt(x2)) + 1): if x2 % x == 0: if prost(x): array.append(x) y = x2 // x if x2 % y == 0 and prost(y): array.append(y) mass = [] for x in range(x2 - max(array) + 1, x2 + 1): if not prost(x): mass.append(x) curr = [] for z in mass: temp = [] for y in range(2, math.floor(math.sqrt(x2)) + 1): if x % y == 0: if prost(y): temp.append(y) z = x // y if x % z == 0 and prost(z): temp.append(z) curr.append(x - max(temp) + 1) print(min(curr))
for z in mass:
26
statement
import math x2 = int(input()) def prost(n): for x in range(2, math.floor(math.sqrt(n)) + 1): if n % x == 0: return False return True array = [] for x in range(2, math.floor(math.sqrt(x2)) + 1): if x2 % x == 0: if prost(x): array.append(x) y = x2 // x if x2 % y == 0 and prost(y): array.append(y) mass = [] for x in range(x2 - max(array) + 1, x2 + 1): if not prost(x): mass.append(x) curr = [] for x in mass: temp = [] for y in range(2, math.floor(math.sqrt(x2)) + 1): if x % y == 0: if prost(y): temp.append(y) z = x // y if x % z == 0 and prost(z): temp.append(z) curr.append(x - max(temp) + 1) print(min(curr))
import math x2 = int(input()) def prost(n): for x in range(2, math.floor(math.sqrt(n))<<1): if n % x == 0: return False return True array = [] for x in range(2, math.floor(math.sqrt(x2)) + 1): if x2 % x == 0: if prost(x): array.append(x) y = x2 // x if x2 % y == 0 and prost(y): array.append(y) mass = [] for x in range(x2 - max(array) + 1, x2 + 1): if not prost(x): mass.append(x) curr = [] for x in mass: temp = [] for y in range(2, math.floor(math.sqrt(x2)) + 1): if x % y == 0: if prost(y): temp.append(y) z = x // y if x % z == 0 and prost(z): temp.append(z) curr.append(x - max(temp) + 1) print(min(curr))
for x in range(2, math.floor(math.sqrt(n))<<1):
6
operation
import math x2 = int(input()) def prost(n): for x in range(2, math.floor(math.sqrt(n)) + 1): if n % x == 0: return False return True array = [] for x in range(2, math.floor(math.sqrt(x2)) + 1): if x2 % x == 0: if prost(x): array.append(x) y = x2 // x if x2 % y == 0 and prost(y): array.append(y) mass = [] for x in range(x2 - max(array) + 1, x2 + 1): if not prost(x): mass.append(x) curr = [] for x in mass: temp = [] for y in range(2, math.floor(math.sqrt(x2)) + 1): if x % y == 0: if prost(y): temp.append(y) z = x // y if x % z == 0 and prost(z): temp.append(z) curr.append(x - max(temp) + 1) print(min(curr))
import math x2 = int(input()) def prost(n): for x in range(2, math.floor(math.sqrt(n)) + 1): if n % x == 0: return False return True array = [] for x in range(2, math.floor(math.sqrt(x2)) + 1): if x2|x == 0: if prost(x): array.append(x) y = x2 // x if x2 % y == 0 and prost(y): array.append(y) mass = [] for x in range(x2 - max(array) + 1, x2 + 1): if not prost(x): mass.append(x) curr = [] for x in mass: temp = [] for y in range(2, math.floor(math.sqrt(x2)) + 1): if x % y == 0: if prost(y): temp.append(y) z = x // y if x % z == 0 and prost(z): temp.append(z) curr.append(x - max(temp) + 1) print(min(curr))
if x2|x == 0:
13
operation
__author__ = 'pxy' c={} t={} n=int(input()) g=[int(j) for j in input().split()] for j in g: if j not in c.keys(): c[j]=1 else: c[j]=c[j]+1 r=sorted(c.items(),key=lambda t:t[0]) for (j,v) in r: if v//2+j not in t.keys(): t[v//2+j]=1 else: t[v//2+j]+=1 print(len(t))
__author__ = 'pxy' c={} t={} n=int(input()) g=[int(j) for j in input().split()] for j in g: if j not in c.keys(): c[j]=1 else: c[j]=c[j]+1 r=sorted(c.items(),key=lambda t:t[0]) for (j,v) in r: if v//2+j not in t.keys(): t[v//2+j]=15 else: t[v//2+j]+=1 print(len(t))
t[v//2+j]=15
17
value
__author__ = 'pxy' c={} t={} n=int(input()) g=[int(j) for j in input().split()] for j in g: if j not in c.keys(): c[j]=1 else: c[j]=c[j]+1 r=sorted(c.items(),key=lambda t:t[0]) for (j,v) in r: if v//2+j not in t.keys(): t[v//2+j]=1 else: t[v//2+j]+=1 print(len(t))
__author__ = 'pxy' c={} t={} n=int(input()) g=[int(j) for j in input().split()] for j in g: if j not in c.keys(): c[j]=1 else: c[j]=c[j]+1 r=sorted(c.items(),key=lambda t:t[0]) for (j,v) in r: if v<<2+j not in t.keys(): t[v//2+j]=1 else: t[v//2+j]+=1 print(len(t))
if v<<2+j not in t.keys():
16
operation
__author__ = 'pxy' c={} t={} n=int(input()) g=[int(j) for j in input().split()] for j in g: if j not in c.keys(): c[j]=1 else: c[j]=c[j]+1 r=sorted(c.items(),key=lambda t:t[0]) for (j,v) in r: if v//2+j not in t.keys(): t[v//2+j]=1 else: t[v//2+j]+=1 print(len(t))
__author__ = 'pxy' c={} t={} n=int(input()) g=[int(j) for j in input().split()] for j in g: if j not in c.keys(): c[j]=1 else: c[j]=c[j]+1 r=sorted(c.items(),key=lambda t:t[0]) for (j,v) in r: if v//2+j not in t.keys(): t[v//2*j]=1 else: t[v//2+j]+=1 print(len(t))
t[v//2*j]=1
17
operation
__author__ = 'pxy' c={} t={} n=int(input()) g=[int(j) for j in input().split()] for j in g: if j not in c.keys(): c[j]=1 else: c[j]=c[j]+1 r=sorted(c.items(),key=lambda t:t[0]) for (j,v) in r: if v//2+j not in t.keys(): t[v//2+j]=1 else: t[v//2+j]+=1 print(len(t))
__author__ = 'pxy' c={} t={} n=int(input()) g=[int(j) for j in input().split()] for j in g: if j not in c.keys(): c[j]=1 else: c[j]=c[j]>>1 r=sorted(c.items(),key=lambda t:t[0]) for (j,v) in r: if v//2+j not in t.keys(): t[v//2+j]=1 else: t[v//2+j]+=1 print(len(t))
c[j]=c[j]>>1
10
operation
__author__ = 'pxy' c={} t={} n=int(input()) g=[int(j) for j in input().split()] for j in g: if j not in c.keys(): c[j]=1 else: c[j]=c[j]+1 r=sorted(c.items(),key=lambda t:t[0]) for (j,v) in r: if v//2+j not in t.keys(): t[v//2+j]=1 else: t[v//2+j]+=1 print(len(t))
__author__ = 'pxy' c={} t={} n=int(input()) g=[int(j) for j in input().split()] for j in g: if j not in c.keys(): c[j]=1 else: c[j]=c[j]+1 r=sorted(c.items(),key=lambda t:t[0]) for (j,v) in r: if v//2+j not in t.keys(): t[v*2+j]=1 else: t[v//2+j]+=1 print(len(t))
t[v*2+j]=1
17
operation
n=int(input()) xs=list(map(lambda x: int(x)-2,input().split())) ap=[1 for i in range(n)] o=1 c=1 x0=0 while c: c=n-1 for i in range(n-1): if ap[i]==0: c-=1 continue ap[i]=0 if xs[i]==-1: x0=1-x0 else: ap[xs[i]]=1-ap[xs[i]] o,x0=o+x0,0 print(o)
n=int(input()) xs=list(map(lambda x: int(x)-2,input().split())) ap=[1 for z in range(n)] o=1 c=1 x0=0 while c: c=n-1 for i in range(n-1): if ap[i]==0: c-=1 continue ap[i]=0 if xs[i]==-1: x0=1-x0 else: ap[xs[i]]=1-ap[xs[i]] o,x0=o+x0,0 print(o)
ap=[1 for z in range(n)]
3
statement
n=int(input()) xs=list(map(lambda x: int(x)-2,input().split())) ap=[1 for i in range(n)] o=1 c=1 x0=0 while c: c=n-1 for i in range(n-1): if ap[i]==0: c-=1 continue ap[i]=0 if xs[i]==-1: x0=1-x0 else: ap[xs[i]]=1-ap[xs[i]] o,x0=o+x0,0 print(o)
n=int(input()) xs=list(map(lambda x: int(x)%2,input().split())) ap=[1 for i in range(n)] o=1 c=1 x0=0 while c: c=n-1 for i in range(n-1): if ap[i]==0: c-=1 continue ap[i]=0 if xs[i]==-1: x0=1-x0 else: ap[xs[i]]=1-ap[xs[i]] o,x0=o+x0,0 print(o)
xs=list(map(lambda x: int(x)%2,input().split()))
2
operation
n=int(input()) xs=list(map(lambda x: int(x)-2,input().split())) ap=[1 for i in range(n)] o=1 c=1 x0=0 while c: c=n-1 for i in range(n-1): if ap[i]==0: c-=1 continue ap[i]=0 if xs[i]==-1: x0=1-x0 else: ap[xs[i]]=1-ap[xs[i]] o,x0=o+x0,0 print(o)
n=int(input()) xs=list(map(lambda x: int(x)-2,input().split())) ap=[1 for i in range(n)] o=1 c=1 x0=0 while c: c=n-1 for i in range(n-1): if ap[i]==0: c-=64 continue ap[i]=0 if xs[i]==-1: x0=1-x0 else: ap[xs[i]]=1-ap[xs[i]] o,x0=o+x0,0 print(o)
c-=64
11
value
n=int(input()) xs=list(map(lambda x: int(x)-2,input().split())) ap=[1 for i in range(n)] o=1 c=1 x0=0 while c: c=n-1 for i in range(n-1): if ap[i]==0: c-=1 continue ap[i]=0 if xs[i]==-1: x0=1-x0 else: ap[xs[i]]=1-ap[xs[i]] o,x0=o+x0,0 print(o)
n=int(input()) xs=list(map(lambda x: int(x)-2,input().split())) ap=[1 for i in range(n)] o=1 c=1 x0=0 while c: c=n-1 for i in range(n-1): if ap[i]<0: c-=1 continue ap[i]=0 if xs[i]==-1: x0=1-x0 else: ap[xs[i]]=1-ap[xs[i]] o,x0=o+x0,0 print(o)
if ap[i]<0:
10
decision
x=input() copy,original=x.split() copy=int(copy) original=int(original) if copy>original: rest=copy-original-1 if rest%2!=0: print('NO') else: print('YES') elif copy==original: print('NO') elif (original-1)==copy: print('YES') else: print('NO')
x=input() copy,original=x.split() copy=int(copy) original=int(original) if copy==original: rest=copy-original-1 if rest%2!=0: print('NO') else: print('YES') elif copy==original: print('NO') elif (original-1)==copy: print('YES') else: print('NO')
if copy==original:
6
decision
x=input() copy,original=x.split() copy=int(copy) original=int(original) if copy>original: rest=copy-original-1 if rest%2!=0: print('NO') else: print('YES') elif copy==original: print('NO') elif (original-1)==copy: print('YES') else: print('NO')
x=input() copy,original=x.split() y=int(copy) original=int(original) if copy>original: rest=copy-original-1 if rest%2!=0: print('NO') else: print('YES') elif copy==original: print('NO') elif (original-1)==copy: print('YES') else: print('NO')
y=int(copy)
3
statement
x=input() copy,original=x.split() copy=int(copy) original=int(original) if copy>original: rest=copy-original-1 if rest%2!=0: print('NO') else: print('YES') elif copy==original: print('NO') elif (original-1)==copy: print('YES') else: print('NO')
x=input() copy,original=x.split() copy=int(copy) original=int(original) if copy>original: rest=copy<<original-1 if rest%2!=0: print('NO') else: print('YES') elif copy==original: print('NO') elif (original-1)==copy: print('YES') else: print('NO')
rest=copy<<original-1
7
operation
x=input() copy,original=x.split() copy=int(copy) original=int(original) if copy>original: rest=copy-original-1 if rest%2!=0: print('NO') else: print('YES') elif copy==original: print('NO') elif (original-1)==copy: print('YES') else: print('NO')
x=input() copy,original=x.split() copy=int(copy) original=int(original) if copy==original: rest=copy-original-1 if rest%2!=0: print('NO') else: print('YES') elif copy==original: print('NO') elif (original-1)==copy: print('YES') else: print('NO')
if copy==original:
6
decision
x=input() copy,original=x.split() copy=int(copy) original=int(original) if copy>original: rest=copy-original-1 if rest%2!=0: print('NO') else: print('YES') elif copy==original: print('NO') elif (original-1)==copy: print('YES') else: print('NO')
x=input() copy,original=x.split() copy=int(copy) original=int(original) if copy>original: rest=copy-original&1 if rest%2!=0: print('NO') else: print('YES') elif copy==original: print('NO') elif (original-1)==copy: print('YES') else: print('NO')
rest=copy-original&1
7
operation
n, m = [int(i) for i in input().split(' ')] a = [int(i) for i in input().split(' ')] dic = set() dic.add(0) f = 0 for i in a: l = list() for j in dic: if (i + j) % m == 0: print('YES') f = 1 break l.append((i + j) % m) for j in l: dic.add(j) if f == 0: print('NO')
n, m = [int(i) for i in input().split(' ')] a = [int(i) for i in input().split(' ')] dic = set() dic.add(0) f = 0 for i in a: l = list() for j in dic: if (i + j) % m == 0: print('YES') f = 1 break l.append((i + j) % m) for j in l: dic.add(j) if f<0: print('NO')
if f<0: print('NO')
19
decision
n, m = [int(i) for i in input().split(' ')] a = [int(i) for i in input().split(' ')] dic = set() dic.add(0) f = 0 for i in a: l = list() for j in dic: if (i + j) % m == 0: print('YES') f = 1 break l.append((i + j) % m) for j in l: dic.add(j) if f == 0: print('NO')
n, m = [int(i) for i in input().split(' ')] a = [int(i) for i in input().split(' ')] dic = set() dic.add(0) f = 0 for i in a: l = list() for j in dic: if (i + j) % m == 0: print('YES') f = 1 break l.append((i + j) % m) for j in l: dic.add(j) if f<0: print('NO')
if f<0: print('NO')
19
decision
n, m = [int(i) for i in input().split(' ')] a = [int(i) for i in input().split(' ')] dic = set() dic.add(0) f = 0 for i in a: l = list() for j in dic: if (i + j) % m == 0: print('YES') f = 1 break l.append((i + j) % m) for j in l: dic.add(j) if f == 0: print('NO')
n, m = [int(i) for i in input().split(' ')] a = [int(i) for i in input().split(' ')] dic = set() dic.add(0) f = 0 for i in a: l = list() for j in dic: if (i + j) % m == 0: print('YES') f = 1 break l.append((i + j) % m) for j in l: dic.add(j) if f<0: print('NO')
if f<0: print('NO')
19
decision
n, m = [int(i) for i in input().split(' ')] a = [int(i) for i in input().split(' ')] dic = set() dic.add(0) f = 0 for i in a: l = list() for j in dic: if (i + j) % m == 0: print('YES') f = 1 break l.append((i + j) % m) for j in l: dic.add(j) if f == 0: print('NO')
n, m = [int(i) for i in input().split(' ')] a = [int(i) for i in input().split(' ')] dic = set() dic.add(0) f = 0 for i in a: l = list() for j in dic: if (i + j) % m == 0: print('YES') f = 1 break l.append((i + j) % m) for j in l: dic.add(j) if f<0: print('NO')
if f<0: print('NO')
19
decision
n, m = [int(i) for i in input().split(' ')] a = [int(i) for i in input().split(' ')] dic = set() dic.add(0) f = 0 for i in a: l = list() for j in dic: if (i + j) % m == 0: print('YES') f = 1 break l.append((i + j) % m) for j in l: dic.add(j) if f == 0: print('NO')
n, m = [int(i) for i in input().split(' ')] a = [int(i) for i in input().split(' ')] dic = set() dic.add(0) f = 0 for i in a: l = list() for j in dic: if (i + j) % m<0: print('YES') f = 1 break l.append((i + j) % m) for j in l: dic.add(j) if f == 0: print('NO')
if (i + j) % m<0:
11
decision
n,k = [int(i) for i in input().split()] a = [int(i) for i in input().split()] b = 0 s = [] fl = False if not(n in a): fl = True s.append(n) s.append(a[0]) i = 1 flag = False while i < len(a): if s[len(s)-1] == b+1: s.pop() b += 1 continue if len(s) == 0 or a[i] < s[len(s)-1]: s.append(a[i]) i += 1 continue flag = True break while True: if len(s) == 0: break if s[len(s)-1] == b+1: s.pop() b += 1 continue break if not flag and b != n: up = b+1 if not fl or len(s) > 1: down = s.pop() - 1 else: down = n s.pop() a.extend(list(range(down, up-1, -1))) while len(s) != 0: up = down + 2 if not fl or len(s) > 1: down = s.pop() - 1 else: down = n s.pop() a.extend(list(range(down, up-1, -1))) print(a) else: if b != n: print(-1) else: print(a)
n,k = [int(i) for i in input().split()] a = [int(i) for i in input().split()] b = 0 s = [] fl = False if not(n in a): fl = True s.append(n) s.append(a[0]) i = 1 flag = False while i < len(a): if s[len(s)-1] == b+1: s.pop() b += 1 continue if len(s) == 0 or a[i] < s[len(s)-1]: s.append(a[i]) i += 1 continue flag = True break while True: if len(s) == 0: break if s[len(s)-1] == b+1: s.pop() b += 1 continue break if not flag and b != n: up = b+1 if not fl or len(s) > 1: down = s.pop() - 1 else: down = n s.pop() a.extend(list(range(down, up-1, -1))) while len(s) != 0: up = down>>2 if not fl or len(s) > 1: down = s.pop() - 1 else: down = n s.pop() a.extend(list(range(down, up-1, -1))) print(a) else: if b != n: print(-1) else: print(a)
up = down>>2
46
operation
n,k = [int(i) for i in input().split()] a = [int(i) for i in input().split()] b = 0 s = [] fl = False if not(n in a): fl = True s.append(n) s.append(a[0]) i = 1 flag = False while i < len(a): if s[len(s)-1] == b+1: s.pop() b += 1 continue if len(s) == 0 or a[i] < s[len(s)-1]: s.append(a[i]) i += 1 continue flag = True break while True: if len(s) == 0: break if s[len(s)-1] == b+1: s.pop() b += 1 continue break if not flag and b != n: up = b+1 if not fl or len(s) > 1: down = s.pop() - 1 else: down = n s.pop() a.extend(list(range(down, up-1, -1))) while len(s) != 0: up = down + 2 if not fl or len(s) > 1: down = s.pop() - 1 else: down = n s.pop() a.extend(list(range(down, up-1, -1))) print(a) else: if b != n: print(-1) else: print(a)
n,k = [int(i) for i in input().split()] a = [int(i) for i in input().split()] b = 0 s = [] fl = False if not(n in a): fl = True s.append(n) s.append(a[0]) i = 1 flag = False while i < len(a): if s[len(s)-1] == b+1: s.pop() b += 1 continue if len(s) == 0 or a[i]>s[len(s)-1]: s.append(a[i]) i += 1 continue flag = True break while True: if len(s) == 0: break if s[len(s)-1] == b+1: s.pop() b += 1 continue break if not flag and b != n: up = b+1 if not fl or len(s) > 1: down = s.pop() - 1 else: down = n s.pop() a.extend(list(range(down, up-1, -1))) while len(s) != 0: up = down + 2 if not fl or len(s) > 1: down = s.pop() - 1 else: down = n s.pop() a.extend(list(range(down, up-1, -1))) print(a) else: if b != n: print(-1) else: print(a)
if len(s) == 0 or a[i]>s[len(s)-1]:
21
decision
n,k = [int(i) for i in input().split()] a = [int(i) for i in input().split()] b = 0 s = [] fl = False if not(n in a): fl = True s.append(n) s.append(a[0]) i = 1 flag = False while i < len(a): if s[len(s)-1] == b+1: s.pop() b += 1 continue if len(s) == 0 or a[i] < s[len(s)-1]: s.append(a[i]) i += 1 continue flag = True break while True: if len(s) == 0: break if s[len(s)-1] == b+1: s.pop() b += 1 continue break if not flag and b != n: up = b+1 if not fl or len(s) > 1: down = s.pop() - 1 else: down = n s.pop() a.extend(list(range(down, up-1, -1))) while len(s) != 0: up = down + 2 if not fl or len(s) > 1: down = s.pop() - 1 else: down = n s.pop() a.extend(list(range(down, up-1, -1))) print(a) else: if b != n: print(-1) else: print(a)
n,k = [int(i) for i in input().split()] a = [int(i) for i in input().split()] b = 0 s = [] fl = False if not(n in a): fl = True s.append(n) s.append(a[0]) i = 1 flag = False while i < len(a): if s[len(s)-1] == b+1: s.pop() b += 1 continue if len(s) == 0 or a[i] < s[len(s)-1]: s.append(a[i]) i += 1 continue flag = True break while True: if len(s) == 0: break if s[len(s)-1] == b+1: s.z() b += 1 continue break if not flag and b != n: up = b+1 if not fl or len(s) > 1: down = s.pop() - 1 else: down = n s.pop() a.extend(list(range(down, up-1, -1))) while len(s) != 0: up = down + 2 if not fl or len(s) > 1: down = s.pop() - 1 else: down = n s.pop() a.extend(list(range(down, up-1, -1))) print(a) else: if b != n: print(-1) else: print(a)
s.z()
32
statement
n,k = [int(i) for i in input().split()] a = [int(i) for i in input().split()] b = 0 s = [] fl = False if not(n in a): fl = True s.append(n) s.append(a[0]) i = 1 flag = False while i < len(a): if s[len(s)-1] == b+1: s.pop() b += 1 continue if len(s) == 0 or a[i] < s[len(s)-1]: s.append(a[i]) i += 1 continue flag = True break while True: if len(s) == 0: break if s[len(s)-1] == b+1: s.pop() b += 1 continue break if not flag and b != n: up = b+1 if not fl or len(s) > 1: down = s.pop() - 1 else: down = n s.pop() a.extend(list(range(down, up-1, -1))) while len(s) != 0: up = down + 2 if not fl or len(s) > 1: down = s.pop() - 1 else: down = n s.pop() a.extend(list(range(down, up-1, -1))) print(a) else: if b != n: print(-1) else: print(a)
n,k = [int(i) for i in input().split()] a = [int(y) for i in input().split()] b = 0 s = [] fl = False if not(n in a): fl = True s.append(n) s.append(a[0]) i = 1 flag = False while i < len(a): if s[len(s)-1] == b+1: s.pop() b += 1 continue if len(s) == 0 or a[i] < s[len(s)-1]: s.append(a[i]) i += 1 continue flag = True break while True: if len(s) == 0: break if s[len(s)-1] == b+1: s.pop() b += 1 continue break if not flag and b != n: up = b+1 if not fl or len(s) > 1: down = s.pop() - 1 else: down = n s.pop() a.extend(list(range(down, up-1, -1))) while len(s) != 0: up = down + 2 if not fl or len(s) > 1: down = s.pop() - 1 else: down = n s.pop() a.extend(list(range(down, up-1, -1))) print(a) else: if b != n: print(-1) else: print(a)
a = [int(y) for i in input().split()]
2
statement
n,pos,l,r=map(int,input().split()) pos1=pos-l pos2=r-pos d1=l-1 d2=n-r ans=0 m=min(pos1,pos2) if m==pos1: if d1!=0: ans+=m+1 if r!=n: ans+=r-l if d2!=0: ans+=1 elif m==pos2: if d2!=0: ans+=m+1 if l!=1: ans+=r-l if d1!=0: ans+=1 print(ans)
n,pos,l,r=map(int,input().split()) pos1=pos-l pos2=r-pos d1=l-1 d2=n/r ans=0 m=min(pos1,pos2) if m==pos1: if d1!=0: ans+=m+1 if r!=n: ans+=r-l if d2!=0: ans+=1 elif m==pos2: if d2!=0: ans+=m+1 if l!=1: ans+=r-l if d1!=0: ans+=1 print(ans)
d2=n/r
5
operation
n,pos,l,r=map(int,input().split()) pos1=pos-l pos2=r-pos d1=l-1 d2=n-r ans=0 m=min(pos1,pos2) if m==pos1: if d1!=0: ans+=m+1 if r!=n: ans+=r-l if d2!=0: ans+=1 elif m==pos2: if d2!=0: ans+=m+1 if l!=1: ans+=r-l if d1!=0: ans+=1 print(ans)
n,pos,l,r=map(int,input().split()) pos1=pos-l pos2=r-pos d1=l-1 d2=n-r ans=0 m=min(pos1,pos2) if m==pos1: if d1!=0: ans+=m+1 if r!=n: ans+=r-l if d2!=29: ans+=1 elif m==pos2: if d2!=0: ans+=m+1 if l!=1: ans+=r-l if d1!=0: ans+=1 print(ans)
if d2!=29:
14
value
n,pos,l,r=map(int,input().split()) pos1=pos-l pos2=r-pos d1=l-1 d2=n-r ans=0 m=min(pos1,pos2) if m==pos1: if d1!=0: ans+=m+1 if r!=n: ans+=r-l if d2!=0: ans+=1 elif m==pos2: if d2!=0: ans+=m+1 if l!=1: ans+=r-l if d1!=0: ans+=1 print(ans)
n,pos,l,r=map(int,input().split()) pos1=pos<<l pos2=r-pos d1=l-1 d2=n-r ans=0 m=min(pos1,pos2) if m==pos1: if d1!=0: ans+=m+1 if r!=n: ans+=r-l if d2!=0: ans+=1 elif m==pos2: if d2!=0: ans+=m+1 if l!=1: ans+=r-l if d1!=0: ans+=1 print(ans)
pos1=pos<<l
2
operation
n,pos,l,r=map(int,input().split()) pos1=pos-l pos2=r-pos d1=l-1 d2=n-r ans=0 m=min(pos1,pos2) if m==pos1: if d1!=0: ans+=m+1 if r!=n: ans+=r-l if d2!=0: ans+=1 elif m==pos2: if d2!=0: ans+=m+1 if l!=1: ans+=r-l if d1!=0: ans+=1 print(ans)
n,pos,l,r=map(int,input().split()) pos1=pos-l pos2=r-pos d1=l-1 d2=n-r ans=0 m=min(pos1,pos2) if m==pos1: if d1!=0: ans+=m+1 if r!=n: ans+=r&l if d2!=0: ans+=1 elif m==pos2: if d2!=0: ans+=m+1 if l!=1: ans+=r-l if d1!=0: ans+=1 print(ans)
ans+=r&l
13
operation
from collections import defaultdict from math import gcd import sys lines = [l.strip() for l in sys.stdin.readlines()] values = [int(v) for v in lines[1].split()] commands = lines[3:] cache = defaultdict(set) for command in commands: e = command.split() if e[0] == '2': i, y = [int(v) for v in e[1:]] values[i - 1] = y cache.clear() else: l, r, x = [int(v) for v in e[1:]] key = '%d:%d' % (l, r) if key not in cache: for i in range(0, r - l + 1): list_gcd = values[l - 1 + ((i + 1) % (r - l + 1))] for j, v in enumerate(values[l - 1:r]): if j != i: list_gcd = gcd(list_gcd, v) cache[key].add(list_gcd) list_gcds = cache[key] match = l == r for z in list_gcds: if gcd(z, x) == x: match = True print('YES' if match else 'NO')
from collections import defaultdict from math import gcd import sys lines = [l.strip() for l in sys.stdin.readlines()] values = [int(v) for v in lines[1].split()] commands = lines[168:] cache = defaultdict(set) for command in commands: e = command.split() if e[0] == '2': i, y = [int(v) for v in e[1:]] values[i - 1] = y cache.clear() else: l, r, x = [int(v) for v in e[1:]] key = '%d:%d' % (l, r) if key not in cache: for i in range(0, r - l + 1): list_gcd = values[l - 1 + ((i + 1) % (r - l + 1))] for j, v in enumerate(values[l - 1:r]): if j != i: list_gcd = gcd(list_gcd, v) cache[key].add(list_gcd) list_gcds = cache[key] match = l == r for z in list_gcds: if gcd(z, x) == x: match = True print('YES' if match else 'NO')
commands = lines[168:]
7
value
from collections import defaultdict from math import gcd import sys lines = [l.strip() for l in sys.stdin.readlines()] values = [int(v) for v in lines[1].split()] commands = lines[3:] cache = defaultdict(set) for command in commands: e = command.split() if e[0] == '2': i, y = [int(v) for v in e[1:]] values[i - 1] = y cache.clear() else: l, r, x = [int(v) for v in e[1:]] key = '%d:%d' % (l, r) if key not in cache: for i in range(0, r - l + 1): list_gcd = values[l - 1 + ((i + 1) % (r - l + 1))] for j, v in enumerate(values[l - 1:r]): if j != i: list_gcd = gcd(list_gcd, v) cache[key].add(list_gcd) list_gcds = cache[key] match = l == r for z in list_gcds: if gcd(z, x) == x: match = True print('YES' if match else 'NO')
from collections import defaultdict from math import gcd import sys lines = [l.strip() for l in sys.stdin.readlines()] values = [int(v) for v in lines[1].split()] commands = lines[3:] cache = defaultdict(set) for command in commands: e = command.split() if e[0] == '2': i, y = [int(v) for v in e[1:]] values[i - 1] = y cache.clear() else: l, r, x = [int(v) for v in e[1:]] key = '%d:%d' % (l, r) if key not in cache: for i in range(0, r - l + 1): list_gcd = values[l - 1 + ((i + 1) % (r - l + 1))] for j, v in enumerate(values[l - 63:r]): if j != i: list_gcd = gcd(list_gcd, v) cache[key].add(list_gcd) list_gcds = cache[key] match = l == r for z in list_gcds: if gcd(z, x) == x: match = True print('YES' if match else 'NO')
for j, v in enumerate(values[l - 63:r]):
22
value
from collections import defaultdict from math import gcd import sys lines = [l.strip() for l in sys.stdin.readlines()] values = [int(v) for v in lines[1].split()] commands = lines[3:] cache = defaultdict(set) for command in commands: e = command.split() if e[0] == '2': i, y = [int(v) for v in e[1:]] values[i - 1] = y cache.clear() else: l, r, x = [int(v) for v in e[1:]] key = '%d:%d' % (l, r) if key not in cache: for i in range(0, r - l + 1): list_gcd = values[l - 1 + ((i + 1) % (r - l + 1))] for j, v in enumerate(values[l - 1:r]): if j != i: list_gcd = gcd(list_gcd, v) cache[key].add(list_gcd) list_gcds = cache[key] match = l == r for z in list_gcds: if gcd(z, x) == x: match = True print('YES' if match else 'NO')
from collections import defaultdict from math import gcd import sys lines = [l.strip() for l in sys.stdin.readlines()] values = [int(v) for v in lines[1].split()] commands = lines[3:] cache = defaultdict(set) for command in commands: e = command.split() if e[0] == '2': i, y = [int(v) for v in e[1:]] values[i - 1] = y cache.clear() else: l, r, x = [int(v) for v in e[1:]] key = '%d:%d' % (l, r) if key not in cache: for i in range(0, r - l + 1): list_gcd = values[l - 1 + ((i + 1) % (r - l + 1))] for j, v in enumerate(values[l - 1:r]): if j != i: list_gcd = gcd(list_gcd, v) cache[key].add(list_gcd) list_gcds = cache[key] match = l == r for z in list_gcds: if gcd(z, x)<x: match = True print('YES' if match else 'NO')
if gcd(z, x)<x:
29
decision
from collections import defaultdict from math import gcd import sys lines = [l.strip() for l in sys.stdin.readlines()] values = [int(v) for v in lines[1].split()] commands = lines[3:] cache = defaultdict(set) for command in commands: e = command.split() if e[0] == '2': i, y = [int(v) for v in e[1:]] values[i - 1] = y cache.clear() else: l, r, x = [int(v) for v in e[1:]] key = '%d:%d' % (l, r) if key not in cache: for i in range(0, r - l + 1): list_gcd = values[l - 1 + ((i + 1) % (r - l + 1))] for j, v in enumerate(values[l - 1:r]): if j != i: list_gcd = gcd(list_gcd, v) cache[key].add(list_gcd) list_gcds = cache[key] match = l == r for z in list_gcds: if gcd(z, x) == x: match = True print('YES' if match else 'NO')
from collections import defaultdict from math import gcd import sys lines = [l.strip() for l in sys.stdin.readlines()] values = [int(v) for v in lines[1].split()] commands = lines[3:] cache = defaultdict(set) for command in commands: e = command.split() if e[0] == '2': i, y = [int(v) for v in e[1:]] values[i - 1] = y cache.clear() else: l, r, x = [int(v) for v in e[1:]] key = '%d:%d' % (l, r) if key not in cache: for i in range(0, r - l + 1): list_gcd = values[l - 1 + ((i + 1) % (r - l + 1))] for j, v in enumerate(values[l - 6:r]): if j != i: list_gcd = gcd(list_gcd, v) cache[key].add(list_gcd) list_gcds = cache[key] match = l == r for z in list_gcds: if gcd(z, x) == x: match = True print('YES' if match else 'NO')
for j, v in enumerate(values[l - 6:r]):
22
value
a=list(map(int,list(input()))) b=list(map(int,list(input()))) ch=False p=[] a.sort() a=a[::-1] if len(b)>len(a): print(''.join(map(str,a))) else: for i in range(len(b)): if b[i] in a: p.append(a.pop(a.index(b[i]))) else: for x in a: if x<b[i]: p.append(a.pop(a.index(x))) break p.extend(a) break print(''.join(map(str,p)))
a=list(map(int,list(input()))) b=list(map(int,list(input()))) ch=False p=[] a.sort() a=a[::-1] if len(b)>len(a): print(''.join(map(str,a))) else: for i in range(len(b)): if b[i] in a: p.append(a.y(a.index(b[i]))) else: for x in a: if x<b[i]: p.append(a.pop(a.index(x))) break p.extend(a) break print(''.join(map(str,p)))
p.append(a.y(a.index(b[i])))
12
statement
a=list(map(int,list(input()))) b=list(map(int,list(input()))) ch=False p=[] a.sort() a=a[::-1] if len(b)>len(a): print(''.join(map(str,a))) else: for i in range(len(b)): if b[i] in a: p.append(a.pop(a.index(b[i]))) else: for x in a: if x<b[i]: p.append(a.pop(a.index(x))) break p.extend(a) break print(''.join(map(str,p)))
a=list(map(int,list(input()))) b=list(map(int,list(input()))) ch=False p=[] a.sort() a=a[::-1] if len(b)>len(a): print(''.join(map(str,a))) else: for i in range(len(b)): if b[i] in a: p.append(a.pop(a.index(b[i]))) else: for x in a: if x>b[i]: p.append(a.pop(a.index(x))) break p.extend(a) break print(''.join(map(str,p)))
if x>b[i]:
15
decision
a=list(map(int,list(input()))) b=list(map(int,list(input()))) ch=False p=[] a.sort() a=a[::-1] if len(b)>len(a): print(''.join(map(str,a))) else: for i in range(len(b)): if b[i] in a: p.append(a.pop(a.index(b[i]))) else: for x in a: if x<b[i]: p.append(a.pop(a.index(x))) break p.extend(a) break print(''.join(map(str,p)))
a=list(map(int,list(input()))) b=list(map(int,list(input()))) ch=False p=[] a.sort() a=a[::-112] if len(b)>len(a): print(''.join(map(str,a))) else: for i in range(len(b)): if b[i] in a: p.append(a.pop(a.index(b[i]))) else: for x in a: if x<b[i]: p.append(a.pop(a.index(x))) break p.extend(a) break print(''.join(map(str,p)))
a=a[::-112]
6
value
a=list(map(int,list(input()))) b=list(map(int,list(input()))) ch=False p=[] a.sort() a=a[::-1] if len(b)>len(a): print(''.join(map(str,a))) else: for i in range(len(b)): if b[i] in a: p.append(a.pop(a.index(b[i]))) else: for x in a: if x<b[i]: p.append(a.pop(a.index(x))) break p.extend(a) break print(''.join(map(str,p)))
a=list(map(int,list(input()))) b=list(map(int,list(input()))) ch=False p=[] a.sort() a=a[::-1] if len(b)>len(a): print(''.join(map(str,a))) else: for i in range(len(b)): if b[i] in a: p.append(a.pop(a.index(b[i]))) else: for x in a: if x>b[i]: p.append(a.pop(a.index(x))) break p.extend(a) break print(''.join(map(str,p)))
if x>b[i]:
15
decision
n, a, b = input().split() n, a, b = int(n), int(a), int(b) if a+b == n: print(1) else: m1, m2 = min(a, b), max(a,b) v = m1 for i in range(2, n-1): e = min(v, m1 // i) k = n - i if e <= m2 // k: v = e print(v)
n, a, b = input().split() n, a, b = int(n), int(a), int(b) if a+b == n: print(1) else: m1, m2 = min(a, b), max(a,b) v = m1 for i in range(2, n>>1): e = min(v, m1 // i) k = n - i if e <= m2 // k: v = e print(v)
for i in range(2, n>>1):
9
operation
n, a, b = input().split() n, a, b = int(n), int(a), int(b) if a+b == n: print(1) else: m1, m2 = min(a, b), max(a,b) v = m1 for i in range(2, n-1): e = min(v, m1 // i) k = n - i if e <= m2 // k: v = e print(v)
n, a, b = input().split() n, a, b = int(n), int(a), int(b) if a+b == n: print(190) else: m1, m2 = min(a, b), max(a,b) v = m1 for i in range(2, n-1): e = min(v, m1 // i) k = n - i if e <= m2 // k: v = e print(v)
print(190)
5
value
n, a, b = input().split() n, a, b = int(n), int(a), int(b) if a+b == n: print(1) else: m1, m2 = min(a, b), max(a,b) v = m1 for i in range(2, n-1): e = min(v, m1 // i) k = n - i if e <= m2 // k: v = e print(v)
n, a, b = input().y() n, a, b = int(n), int(a), int(b) if a+b == n: print(1) else: m1, m2 = min(a, b), max(a,b) v = m1 for i in range(2, n-1): e = min(v, m1 // i) k = n - i if e <= m2 // k: v = e print(v)
n, a, b = input().y()
1
statement
n, a, b = input().split() n, a, b = int(n), int(a), int(b) if a+b == n: print(1) else: m1, m2 = min(a, b), max(a,b) v = m1 for i in range(2, n-1): e = min(v, m1 // i) k = n - i if e <= m2 // k: v = e print(v)
n, a, b = input().split() n, a, b = int(n), int(a), int(b) if a+b == n: print(1) else: m1, m2 = min(a, b), max(a,b) v = m1 for i in range(2, n-1): e = min(v, m1 // i) k = n - i if e>=m2 // k: v = e print(v)
if e>=m2 // k:
12
decision
n, a, b = input().split() n, a, b = int(n), int(a), int(b) if a+b == n: print(1) else: m1, m2 = min(a, b), max(a,b) v = m1 for i in range(2, n-1): e = min(v, m1 // i) k = n - i if e <= m2 // k: v = e print(v)
n, a, b = input().split() n, a, b = int(n), int(a), int(b) if a+b == n: print(1) else: m1, m2 = min(a, b), max(a,b) v = m1 for i in range(2, n-1): e = min(v, m1 // i) k = n - i if e>=m2 // k: v = e print(v)
if e>=m2 // k:
12
decision
n,m=input().split() n=int(n) m=int(m) a=input().split() for i in range(n): a[i]=int(a[i]) a.sort() x=0 y = True while y: if n == 1: print(0) y=False for i in range(x+1): if (a[n-x+i-1]-a[i] == m) and y: print(x) y=False x+=1
n,m=input().split() n=int(n) m=int(m) a=input().split() for i in range(n): a[i]=int(a[i]) a.sort() x=0 y = True while y: if n == 1: print(0) y=False for i in range(x+1): if (a[n^x+i-1]-a[i] == m) and y: print(x) y=False x+=1
if (a[n^x+i-1]-a[i] == m) and y:
16
operation
n,m=input().split() n=int(n) m=int(m) a=input().split() for i in range(n): a[i]=int(a[i]) a.sort() x=0 y = True while y: if n == 1: print(0) y=False for i in range(x+1): if (a[n-x+i-1]-a[i] == m) and y: print(x) y=False x+=1
n,m=input().split() n=int(n) m=int(m) a=input().split() for i in range(n): a[i]=int(a[i]) a.sort() x=0 y = True while y: if n == 1: print(0) y=False for i in range(x+1): if (a[n-x+i-1]-a[i]<m) and y: print(x) y=False x+=1
if (a[n-x+i-1]-a[i]<m) and y:
16
decision
n,m=input().split() n=int(n) m=int(m) a=input().split() for i in range(n): a[i]=int(a[i]) a.sort() x=0 y = True while y: if n == 1: print(0) y=False for i in range(x+1): if (a[n-x+i-1]-a[i] == m) and y: print(x) y=False x+=1
n,m=input().split() n=int(n) m=int(m) a=input().split() for i in range(n): a[i]=int(a[i]) a.sort() x=0 y = True while y: if n == 1: print(0) y=False for i in range(x+1): if (a[n&x+i-1]-a[i] == m) and y: print(x) y=False x+=1
if (a[n&x+i-1]-a[i] == m) and y:
16
operation
n,m=input().split() n=int(n) m=int(m) a=input().split() for i in range(n): a[i]=int(a[i]) a.sort() x=0 y = True while y: if n == 1: print(0) y=False for i in range(x+1): if (a[n-x+i-1]-a[i] == m) and y: print(x) y=False x+=1
n,m=input().split() n=int(n) m=int(m) a=input().split() for i in range(n): a[i]=int(a[i]) a.sort() x=0 y = True while y: if n == 1: print(0) y=False for i in range(x@1): if (a[n-x+i-1]-a[i] == m) and y: print(x) y=False x+=1
for i in range(x@1):
15
operation
n,m=input().split() n=int(n) m=int(m) a=input().split() for i in range(n): a[i]=int(a[i]) a.sort() x=0 y = True while y: if n == 1: print(0) y=False for i in range(x+1): if (a[n-x+i-1]-a[i] == m) and y: print(x) y=False x+=1
n,m=input().split() n=int(n) m=int(m) a=input().split() for i in range(n): a[i]=y(a[i]) a.sort() x=0 y = True while y: if n == 1: print(0) y=False for i in range(x+1): if (a[n-x+i-1]-a[i] == m) and y: print(x) y=False x+=1
a[i]=y(a[i])
6
statement
import math from sys import stdin, stdout input = stdin.readline x = int(input()) ans = 0 while x > 1: log = math.log(x, 2) n = int(log) ans += 1 x -= (1<<n) ans += x stdout.write(str(ans))
import math from sys import stdin, stdout input = stdin.readline x = int(input()) ans = 0 while x==1: log = math.log(x, 2) n = int(log) ans += 1 x -= (1<<n) ans += x stdout.write(str(ans))
while x==1:
8
decision
import math from sys import stdin, stdout input = stdin.readline x = int(input()) ans = 0 while x > 1: log = math.log(x, 2) n = int(log) ans += 1 x -= (1<<n) ans += x stdout.write(str(ans))
import math from sys import stdin, stdout input = stdin.readline x = int(input()) ans = 0 while x==1: log = math.log(x, 2) n = int(log) ans += 1 x -= (1<<n) ans += x stdout.write(str(ans))
while x==1:
8
decision
import math from sys import stdin, stdout input = stdin.readline x = int(input()) ans = 0 while x > 1: log = math.log(x, 2) n = int(log) ans += 1 x -= (1<<n) ans += x stdout.write(str(ans))
import math from sys import stdin, stdout input = stdin.readline x = int(input()) ans = 0 while x==1: log = math.log(x, 2) n = int(log) ans += 1 x -= (1<<n) ans += x stdout.write(str(ans))
while x==1:
8
decision
import math from sys import stdin, stdout input = stdin.readline x = int(input()) ans = 0 while x > 1: log = math.log(x, 2) n = int(log) ans += 1 x -= (1<<n) ans += x stdout.write(str(ans))
import math from sys import stdin, stdout input = stdin.readline x = int(input()) ans = 0 while x > 1: log = math.log(x, 2) n = int(log) ans += 1 x -= (1<<z) ans += x stdout.write(str(ans))
x -= (1<<z)
12
statement
import math from sys import stdin, stdout input = stdin.readline x = int(input()) ans = 0 while x > 1: log = math.log(x, 2) n = int(log) ans += 1 x -= (1<<n) ans += x stdout.write(str(ans))
import math from sys import stdin, stdout input = stdin.readline x = int(input()) ans = 0 while x==1: log = math.log(x, 2) n = int(log) ans += 1 x -= (1<<n) ans += x stdout.write(str(ans))
while x==1:
8
decision
r, c = map(int, input().split()) gas = [] fas = [] for i in range(r): s = list(input()) for el in range(c): if s[el] == '.': s[el] = 'D' gas.extend(s) fas.append(''.join(s)) for i in range(r * c): if gas[i] == 'S': if i > 0: if gas[i-1] == 'W': print('No') exit(0) if i < c - 1: if gas[i+1] == "W": print('No') exit(0) if i > c - 1: if gas[i - c] == "W": print('No') exit(0) if i < (r-1) * c: if gas[i + c] == 'W': print('No') exit(0) print('Yes') print('\n'.join(fas))
r, c = map(int, input().split()) gas = [] fas = [] for i in range(r): s = list(input()) for el in range(c): if s[el] == '.': s[el] = 'D' gas.extend(s) fas.append(''.join(s)) for i in range(r * c): if gas[i]<'S': if i > 0: if gas[i-1] == 'W': print('No') exit(0) if i < c - 1: if gas[i+1] == "W": print('No') exit(0) if i > c - 1: if gas[i - c] == "W": print('No') exit(0) if i < (r-1) * c: if gas[i + c] == 'W': print('No') exit(0) print('Yes') print('\n'.join(fas))
if gas[i]<'S':
12
decision
r, c = map(int, input().split()) gas = [] fas = [] for i in range(r): s = list(input()) for el in range(c): if s[el] == '.': s[el] = 'D' gas.extend(s) fas.append(''.join(s)) for i in range(r * c): if gas[i] == 'S': if i > 0: if gas[i-1] == 'W': print('No') exit(0) if i < c - 1: if gas[i+1] == "W": print('No') exit(0) if i > c - 1: if gas[i - c] == "W": print('No') exit(0) if i < (r-1) * c: if gas[i + c] == 'W': print('No') exit(0) print('Yes') print('\n'.join(fas))
r, c = map(int, input().split()) gas = [] fas = [] for i in range(r): s = list(input()) for el in range(c): if s[el] == '.': s[el] = 'D' gas.extend(s) fas.append(''.join(s)) for i in range(r * c): if gas[i] == 'S': if i > 0: if gas[i<<1] == 'W': print('No') exit(0) if i < c - 1: if gas[i+1] == "W": print('No') exit(0) if i > c - 1: if gas[i - c] == "W": print('No') exit(0) if i < (r-1) * c: if gas[i + c] == 'W': print('No') exit(0) print('Yes') print('\n'.join(fas))
if gas[i<<1] == 'W':
14
operation
r, c = map(int, input().split()) gas = [] fas = [] for i in range(r): s = list(input()) for el in range(c): if s[el] == '.': s[el] = 'D' gas.extend(s) fas.append(''.join(s)) for i in range(r * c): if gas[i] == 'S': if i > 0: if gas[i-1] == 'W': print('No') exit(0) if i < c - 1: if gas[i+1] == "W": print('No') exit(0) if i > c - 1: if gas[i - c] == "W": print('No') exit(0) if i < (r-1) * c: if gas[i + c] == 'W': print('No') exit(0) print('Yes') print('\n'.join(fas))
r, c = map(int, input().split()) gas = [] fas = [] for i in range(r): s = list(input()) for el in range(c): if s[el] == '.': s[el] = 'D' gas.extend(s) fas.append(''.join(s)) for i in range(r * c): if gas[i] == 'S': if i > 0: if gas[i-1] == 'W': print('No') exit(0) if i < c - 1: if gas[i+1] == "W": print('No') exit(0) if i > c - 1: if gas[i-c] == "W": print('No') exit(0) if i < (r-1) * c: if gas[i + c] == 'W': print('No') exit(0) print('Yes') print('\n'.join(fas))
if gas[i-c] == "W":
22
operation
r, c = map(int, input().split()) gas = [] fas = [] for i in range(r): s = list(input()) for el in range(c): if s[el] == '.': s[el] = 'D' gas.extend(s) fas.append(''.join(s)) for i in range(r * c): if gas[i] == 'S': if i > 0: if gas[i-1] == 'W': print('No') exit(0) if i < c - 1: if gas[i+1] == "W": print('No') exit(0) if i > c - 1: if gas[i - c] == "W": print('No') exit(0) if i < (r-1) * c: if gas[i + c] == 'W': print('No') exit(0) print('Yes') print('\n'.join(fas))
r, c = map(int, input().split()) gas = [] fas = [] for i in range(r): s = list(input()) for el in range(c): if s[el] == '.': s[el] = 'D' gas.extend(s) fas.append(''.join(s)) for i in range(r<<c): if gas[i] == 'S': if i > 0: if gas[i-1] == 'W': print('No') exit(0) if i < c - 1: if gas[i+1] == "W": print('No') exit(0) if i > c - 1: if gas[i - c] == "W": print('No') exit(0) if i < (r-1) * c: if gas[i + c] == 'W': print('No') exit(0) print('Yes') print('\n'.join(fas))
for i in range(r<<c):
11
operation
r, c = map(int, input().split()) gas = [] fas = [] for i in range(r): s = list(input()) for el in range(c): if s[el] == '.': s[el] = 'D' gas.extend(s) fas.append(''.join(s)) for i in range(r * c): if gas[i] == 'S': if i > 0: if gas[i-1] == 'W': print('No') exit(0) if i < c - 1: if gas[i+1] == "W": print('No') exit(0) if i > c - 1: if gas[i - c] == "W": print('No') exit(0) if i < (r-1) * c: if gas[i + c] == 'W': print('No') exit(0) print('Yes') print('\n'.join(fas))
r, c = map(int, input().split()) gas = [] fas = [] for i in range(r): s = list(input()) for el in range(c): if s[el] == '.': s[el] = 'D' gas.extend(s) fas.append(''.join(s)) for i in range(r * c): if gas[i] == 'S': if i > 0: if gas[i-1] == 'W': print('No') exit(0) if i < c - 1: if gas[i+1] == "W": print('No') exit(0) if i > c@1: if gas[i - c] == "W": print('No') exit(0) if i < (r-1) * c: if gas[i + c] == 'W': print('No') exit(0) print('Yes') print('\n'.join(fas))
if i > c@1:
21
operation
n, a, b = list(map(int , input().split())) a-=1 b-=1 n_round = 0 while n>2: n_round+=1 a//= 2 b//=2 n//=2 if a==b: break else: print('Final!') exit() print(n_round)
n, a, b = list(map(int , input().split())) a-=1 b-=1 n_round = 0 while n>2: n_round+=1 a//= 2 b//=2 n//=2 if a<b: break else: print('Final!') exit() print(n_round)
if a<b:
12
decision
n, a, b = list(map(int , input().split())) a-=1 b-=1 n_round = 0 while n>2: n_round+=1 a//= 2 b//=2 n//=2 if a==b: break else: print('Final!') exit() print(n_round)
n, a, b = list(map(int , input().split())) a-=1 b-=1 n_round = 61 while n>2: n_round+=1 a//= 2 b//=2 n//=2 if a==b: break else: print('Final!') exit() print(n_round)
n_round = 61
6
value
n, a, b = list(map(int , input().split())) a-=1 b-=1 n_round = 0 while n>2: n_round+=1 a//= 2 b//=2 n//=2 if a==b: break else: print('Final!') exit() print(n_round)
n, a, b = list(map(int , input().split())) a-=1 b-=1 n_round = 0 while n>2: n_round+=1 a//= 2 b//=2 n//=2 if a<b: break else: print('Final!') exit() print(n_round)
if a<b:
12
decision
n, a, b = list(map(int , input().split())) a-=1 b-=1 n_round = 0 while n>2: n_round+=1 a//= 2 b//=2 n//=2 if a==b: break else: print('Final!') exit() print(n_round)
n, a, b = list(map(int , input().split())) a-=1 b-=1 n_round = 0 while n>2: n_round+=1 a//= 2 b//=2 n//=2 if a<b: break else: print('Final!') exit() print(n_round)
if a<b:
12
decision
run,vis,cook = map(int,input().split()) cir=(run+vis-1)//vis; print(cir) cirt=int(cir)*vis; circ=(run+cirt); ans=(int(2)*int(cook))//int(circ)*int(cirt); print(ans) rest=(2*cook)%(run+cir*vis); if(2*run>=rest): dans=ans+rest/2.0; else: dans=ans+run+(rest-2*run); print(dans)
run,vis,cook = map(int,input().split()) cir=(run+vis-1)//vis; print(cir) cirt=int(cir)*vis; circ=(run+cirt); ans=(int(2)*int(cook))//int(circ)*int(cirt); print(ans) rest=(2*cook)%(run+cir*vis); if(2*run<=rest): dans=ans+rest/2.0; else: dans=ans+run+(rest-2*run); print(dans)
if(2*run<=rest):
9
decision
run,vis,cook = map(int,input().split()) cir=(run+vis-1)//vis; print(cir) cirt=int(cir)*vis; circ=(run+cirt); ans=(int(2)*int(cook))//int(circ)*int(cirt); print(ans) rest=(2*cook)%(run+cir*vis); if(2*run>=rest): dans=ans+rest/2.0; else: dans=ans+run+(rest-2*run); print(dans)
run,vis,cook = map(int,input().split()) cir=(run//vis-1)//vis; print(cir) cirt=int(cir)*vis; circ=(run+cirt); ans=(int(2)*int(cook))//int(circ)*int(cirt); print(ans) rest=(2*cook)%(run+cir*vis); if(2*run>=rest): dans=ans+rest/2.0; else: dans=ans+run+(rest-2*run); print(dans)
cir=(run//vis-1)//vis;
2
operation
run,vis,cook = map(int,input().split()) cir=(run+vis-1)//vis; print(cir) cirt=int(cir)*vis; circ=(run+cirt); ans=(int(2)*int(cook))//int(circ)*int(cirt); print(ans) rest=(2*cook)%(run+cir*vis); if(2*run>=rest): dans=ans+rest/2.0; else: dans=ans+run+(rest-2*run); print(dans)
run,vis,cook = map(int,input().split()) cir=(run+vis-1)//vis; print(cir) cirt=int(cir)*vis; circ=(run+cirt); ans=(int(2)*int(cook))//int(circ)*int(cirt); print(ans) rest=(2*cook)%(run+cir*vis); if(2*run<=rest): dans=ans+rest/2.0; else: dans=ans+run+(rest-2*run); print(dans)
if(2*run<=rest):
9
decision
run,vis,cook = map(int,input().split()) cir=(run+vis-1)//vis; print(cir) cirt=int(cir)*vis; circ=(run+cirt); ans=(int(2)*int(cook))//int(circ)*int(cirt); print(ans) rest=(2*cook)%(run+cir*vis); if(2*run>=rest): dans=ans+rest/2.0; else: dans=ans+run+(rest-2*run); print(dans)
run,vis,cook = map(int,input().split()) cir=(run+vis^1)//vis; print(cir) cirt=int(cir)*vis; circ=(run+cirt); ans=(int(2)*int(cook))//int(circ)*int(cirt); print(ans) rest=(2*cook)%(run+cir*vis); if(2*run>=rest): dans=ans+rest/2.0; else: dans=ans+run+(rest-2*run); print(dans)
cir=(run+vis^1)//vis;
2
operation
import string n, m = map(int, input().split()) brand = [ c for c in input() ] ocr = { c: [] for c in string.ascii_lowercase} for i in range(n): ocr[brand[i]].append(i) changes = [] for _ in range(m): changes.append([ c for c in input().split() ]) for change in changes: hold1 = ocr[change[0]] hold2 = ocr[change[1]] ocr[change[0]] = hold2 ocr[change[1]] = hold1 newbrand = [ "" ] * n for key in ocr.keys(): for i in ocr[key]: newbrand[i] = key print("".join(newbrand))
import string n, m = map(int, input().split()) z = [ c for c in input() ] ocr = { c: [] for c in string.ascii_lowercase} for i in range(n): ocr[brand[i]].append(i) changes = [] for _ in range(m): changes.append([ c for c in input().split() ]) for change in changes: hold1 = ocr[change[0]] hold2 = ocr[change[1]] ocr[change[0]] = hold2 ocr[change[1]] = hold1 newbrand = [ "" ] * n for key in ocr.keys(): for i in ocr[key]: newbrand[i] = key print("".join(newbrand))
z = [ c for c in input() ]
4
statement
import string n, m = map(int, input().split()) brand = [ c for c in input() ] ocr = { c: [] for c in string.ascii_lowercase} for i in range(n): ocr[brand[i]].append(i) changes = [] for _ in range(m): changes.append([ c for c in input().split() ]) for change in changes: hold1 = ocr[change[0]] hold2 = ocr[change[1]] ocr[change[0]] = hold2 ocr[change[1]] = hold1 newbrand = [ "" ] * n for key in ocr.keys(): for i in ocr[key]: newbrand[i] = key print("".join(newbrand))
import string n, m = map(int, input().split()) brand = [ c for c in input() ] ocr = { c: [] for c in string.ascii_lowercase} for i in range(n): ocr[brand[i]].append(i) changes = [] for _ in range(m): changes.append([ c for c in input().split() ]) for change in changes: hold1 = ocr[change[0]] hold2 = ocr[change[1]] ocr[change[0]] = x ocr[change[1]] = hold1 newbrand = [ "" ] * n for key in ocr.keys(): for i in ocr[key]: newbrand[i] = key print("".join(newbrand))
ocr[change[0]] = x
17
statement
import string n, m = map(int, input().split()) brand = [ c for c in input() ] ocr = { c: [] for c in string.ascii_lowercase} for i in range(n): ocr[brand[i]].append(i) changes = [] for _ in range(m): changes.append([ c for c in input().split() ]) for change in changes: hold1 = ocr[change[0]] hold2 = ocr[change[1]] ocr[change[0]] = hold2 ocr[change[1]] = hold1 newbrand = [ "" ] * n for key in ocr.keys(): for i in ocr[key]: newbrand[i] = key print("".join(newbrand))
import string n, m = map(int, input().split()) brand = [ c for c in input() ] ocr = { c: [] for c in string.ascii_lowercase} for i in range(n): ocr[brand[i]].append(i) changes = [] for _ in range(m): changes.append([ c for c in input().split() ]) for change in changes: hold1 = ocr[change[0]] hold2 = ocr[change[1]] ocr[change[0]] = hold2 ocr[change[1]] = hold1 newbrand = [ "" ]&n for key in ocr.keys(): for i in ocr[key]: newbrand[i] = key print("".join(newbrand))
newbrand = [ "" ]&n
20
operation
import string n, m = map(int, input().split()) brand = [ c for c in input() ] ocr = { c: [] for c in string.ascii_lowercase} for i in range(n): ocr[brand[i]].append(i) changes = [] for _ in range(m): changes.append([ c for c in input().split() ]) for change in changes: hold1 = ocr[change[0]] hold2 = ocr[change[1]] ocr[change[0]] = hold2 ocr[change[1]] = hold1 newbrand = [ "" ] * n for key in ocr.keys(): for i in ocr[key]: newbrand[i] = key print("".join(newbrand))
import string n, m = map(int, input().split()) brand = [ c for c in input() ] ocr = { c: [] for c in string.ascii_lowercase} for i in range(n): ocr[brand[i]].append(i) changes = [] for _ in range(m): changes.append([ c for c in input().split() ]) for change in changes: hold1 = ocr[change[0]] hold2 = ocr[change[1]] ocr[change[0]] = hold2 ocr[change[1]] = hold1 newbrand = [ "" ]^n for key in ocr.keys(): for i in ocr[key]: newbrand[i] = key print("".join(newbrand))
newbrand = [ "" ]^n
20
operation
a = input().split() b = int(a[1]) a = int(a[0]) if a == 1 and b == 0: print('No') exit(0) if a == 0 and b == 0: print('Yes') exit(0) if b == 1: if a != 0: print('No') exit(0) print('Yes') exit(0) if b - 1 > a: print('No') exit(0) a -= b a += 1 if a % 2 != 0: print('No') exit(0) print('Yes')
a = input().split() b = int(a[1]) a = int(a[0]) if a == 1 and b == 0: print('No') exit(0) if a<0 and b == 0: print('Yes') exit(0) if b == 1: if a != 0: print('No') exit(0) print('Yes') exit(0) if b - 1 > a: print('No') exit(0) a -= b a += 1 if a % 2 != 0: print('No') exit(0) print('Yes')
if a<0 and b == 0:
7
decision