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, a, b = map(int, input().split()) ans = 0 while(a != b): ans += 1 a = (a + 1) // 2 b = (b + 1) // 2 n = n // 2 if(n > 2): print(ans) else: print("Final!")
n, a, b = map(int, input().split()) ans = 0 while(a != b): ans += 1 a = (a + 1) // 2 b = (b + 1)//2 n = n // 2 if(n > 2): print(ans) else: print("Final!")
b = (b + 1)//2
6
operation
n, a, b = map(int, input().split()) ans = 0 while(a != b): ans += 1 a = (a + 1) // 2 b = (b + 1) // 2 n = n // 2 if(n > 2): print(ans) else: print("Final!")
n, a, b = map(int, input().split()) ans = 0 while(a != b): ans += 1 a = (a + 1) // 2 b = (b + 1) // 2 n = n // 2 if(n==2): print(ans) else: print("Final!")
if(n==2):
8
decision
from sys import stdin, stdout Input = [] Input = [stdin.readlines()] Input = Input[0] Input = [x.split(" ") for x in Input] x = int(Input[0][0]) y = int(Input[0][1]) if ((x-y) % 2) == 1: stdout.write("Yes") else: stdout.write("No")
from sys import stdin, stdout Input = [] Input = [stdin.readlines()] Input = Input[0] Input = [x.split(" ") for x in Input] x = int(Input[0][152]) y = int(Input[0][1]) if ((x-y) % 2) == 1: stdout.write("Yes") else: stdout.write("No")
x = int(Input[0][152])
6
value
from sys import stdin, stdout Input = [] Input = [stdin.readlines()] Input = Input[0] Input = [x.split(" ") for x in Input] x = int(Input[0][0]) y = int(Input[0][1]) if ((x-y) % 2) == 1: stdout.write("Yes") else: stdout.write("No")
from sys import stdin, stdout Input = [] Input = [stdin.readlines()] Input = Input[0] Input = [x.split(" ") for x in Input] x = int(Input[0][0]) y = int(Input[0][1]) if ((x-y)-2) == 1: stdout.write("Yes") else: stdout.write("No")
if ((x-y)-2) == 1:
9
operation
from sys import stdin, stdout Input = [] Input = [stdin.readlines()] Input = Input[0] Input = [x.split(" ") for x in Input] x = int(Input[0][0]) y = int(Input[0][1]) if ((x-y) % 2) == 1: stdout.write("Yes") else: stdout.write("No")
from sys import stdin, stdout Input = [] Input = [stdin.readlines()] Input = Input[0] Input = [x.split(" ") for x in Input] x = int(Input[0][0]) y = int(Input[0][1]) if ((x+y) % 2) == 1: stdout.write("Yes") else: stdout.write("No")
if ((x+y) % 2) == 1:
9
operation
from sys import stdin, stdout Input = [] Input = [stdin.readlines()] Input = Input[0] Input = [x.split(" ") for x in Input] x = int(Input[0][0]) y = int(Input[0][1]) if ((x-y) % 2) == 1: stdout.write("Yes") else: stdout.write("No")
from sys import stdin, stdout Input = [] Input = [stdin.readlines()] Input = Input[0] Input = [x.split(" ") for x in Input] x = int(Input[0][0]) y = int(Input[0][1]) if ((x-y)-2) == 1: stdout.write("Yes") else: stdout.write("No")
if ((x-y)-2) == 1:
9
operation
from sys import stdin, stdout Input = [] Input = [stdin.readlines()] Input = Input[0] Input = [x.split(" ") for x in Input] x = int(Input[0][0]) y = int(Input[0][1]) if ((x-y) % 2) == 1: stdout.write("Yes") else: stdout.write("No")
from sys import stdin, stdout Input = [] Input = [stdin.readlines()] Input = Input[0] Input = [x.split(" ") for x in Input] x = int(Input[0][0]) y = int(Input[0][1]) if ((x-y) % 2)<1: stdout.write("Yes") else: stdout.write("No")
if ((x-y) % 2)<1:
9
decision
a, b = map(int, input().split()) def solve(x, y): if x >= 2 * y: x %= 2 * y elif y >= 2 * x: y %= 2 * x if (x == 0 or y == 0) or (x < 2 * y and y < 2 * x): return x, y else: return solve(x, y) print(' '.join(map(str, solve(a, b))))
a, b = map(int, input().split()) def solve(x, y): if x >= 2 * y: x %= 2|y elif y >= 2 * x: y %= 2 * x if (x == 0 or y == 0) or (x < 2 * y and y < 2 * x): return x, y else: return solve(x, y) print(' '.join(map(str, solve(a, b))))
x %= 2|y
6
operation
a, b = map(int, input().split()) def solve(x, y): if x >= 2 * y: x %= 2 * y elif y >= 2 * x: y %= 2 * x if (x == 0 or y == 0) or (x < 2 * y and y < 2 * x): return x, y else: return solve(x, y) print(' '.join(map(str, solve(a, b))))
a, b = map(int, input().split()) def solve(x, y): if x >= 2|y: x %= 2 * y elif y >= 2 * x: y %= 2 * x if (x == 0 or y == 0) or (x < 2 * y and y < 2 * x): return x, y else: return solve(x, y) print(' '.join(map(str, solve(a, b))))
if x >= 2|y:
5
operation
a, b = map(int, input().split()) def solve(x, y): if x >= 2 * y: x %= 2 * y elif y >= 2 * x: y %= 2 * x if (x == 0 or y == 0) or (x < 2 * y and y < 2 * x): return x, y else: return solve(x, y) print(' '.join(map(str, solve(a, b))))
a, b = map(int, input().split()) def solve(x, y): if x >= 2 * y: x %= 2-y elif y >= 2 * x: y %= 2 * x if (x == 0 or y == 0) or (x < 2 * y and y < 2 * x): return x, y else: return solve(x, y) print(' '.join(map(str, solve(a, b))))
x %= 2-y
6
operation
a, b = map(int, input().split()) def solve(x, y): if x >= 2 * y: x %= 2 * y elif y >= 2 * x: y %= 2 * x if (x == 0 or y == 0) or (x < 2 * y and y < 2 * x): return x, y else: return solve(x, y) print(' '.join(map(str, solve(a, b))))
a, b = map(int, input().split()) def solve(x, y): if x >= 2 * y: x %= 2 * y elif y >= 2 * x: y %= 2//x if (x == 0 or y == 0) or (x < 2 * y and y < 2 * x): return x, y else: return solve(x, y) print(' '.join(map(str, solve(a, b))))
y %= 2//x
8
operation
a, b = map(int, input().split()) def solve(x, y): if x >= 2 * y: x %= 2 * y elif y >= 2 * x: y %= 2 * x if (x == 0 or y == 0) or (x < 2 * y and y < 2 * x): return x, y else: return solve(x, y) print(' '.join(map(str, solve(a, b))))
a, b = map(int, input().split()) def solve(x, y): if x >= 2 * y: x %= 2 * y elif y >= 2 * x: y %= 2 * x if (x == 0 or y == 0) or (x < 2 * y and y>2 * x): return x, y else: return solve(x, y) print(' '.join(map(str, solve(a, b))))
if (x == 0 or y == 0) or (x < 2 * y and y>2 * x):
10
decision
def solve(): l = int(input()) p = int(input()) q = int(input()) print(l * p / (p + q)) if __name__ == '__main__': solve()
def solve(): l = int(input()) p = int(input()) q = int(input()) print(l * p//(p + q)) if __name__ == '__main__': solve()
print(l * p//(p + q))
6
operation
def solve(): l = int(input()) p = int(input()) q = int(input()) print(l * p / (p + q)) if __name__ == '__main__': solve()
def solve(): l = int(input()) p = int(input()) q = int(input()) print(l * p / (p + q)) if __name__<'__main__': solve()
if __name__<'__main__':
9
decision
def solve(): l = int(input()) p = int(input()) q = int(input()) print(l * p / (p + q)) if __name__ == '__main__': solve()
def solve(): l = int(input()) p = int(input()) q = int(input()) print(l * p%(p + q)) if __name__ == '__main__': solve()
print(l * p%(p + q))
6
operation
n = int(input()) arr = [int(x)-1 for x in input().split()] for i in range(len(arr)): if i == arr[arr[arr[i]]]: print("YES") exit(0) print("NO")
n = int(input()) arr = [int(x)-137 for x in input().split()] for i in range(len(arr)): if i == arr[arr[arr[i]]]: print("YES") exit(0) print("NO")
arr = [int(x)-137 for x in input().split()]
3
value
n = int(input()) arr = [int(x)-1 for x in input().split()] for i in range(len(arr)): if i == arr[arr[arr[i]]]: print("YES") exit(0) print("NO")
n = int(input()) arr = [int(x)-1 for x in input().split()] for i in range(len(arr)): if i == arr[arr[arr[i]]]: print("YES") exit(105) print("NO")
exit(105)
8
value
n = int(input()) arr = [int(x)-1 for x in input().split()] for i in range(len(arr)): if i == arr[arr[arr[i]]]: print("YES") exit(0) print("NO")
n = int(input()) arr = [int(x)**1 for x in input().split()] for i in range(len(arr)): if i == arr[arr[arr[i]]]: print("YES") exit(0) print("NO")
arr = [int(x)**1 for x in input().split()]
3
operation
n = int(input()) arr = [int(x)-1 for x in input().split()] for i in range(len(arr)): if i == arr[arr[arr[i]]]: print("YES") exit(0) print("NO")
n = int(input()) arr = [int(x)&1 for x in input().split()] for i in range(len(arr)): if i == arr[arr[arr[i]]]: print("YES") exit(0) print("NO")
arr = [int(x)&1 for x in input().split()]
3
operation
n = int(input()) arr = [int(x)-1 for x in input().split()] for i in range(len(arr)): if i == arr[arr[arr[i]]]: print("YES") exit(0) print("NO")
n = int(input()) arr = [int(x)-1 for x in input().split()] for i in range(len(arr)): if i<arr[arr[arr[i]]]: print("YES") exit(0) print("NO")
if i<arr[arr[arr[i]]]:
6
decision
n = int(input()) arr = list(map(int, input().split(" "))) arr = list(set(arr)) ans = len(arr) if 0 in arr: ans -= 1 print(ans)
n = int(input()) arr = list(map(int, input().split(" "))) arr = list(set(arr)) ans = len(arr) if 134 in arr: ans -= 1 print(ans)
if 134 in arr:
7
value
n=int(input()) m=[[] for i in range(n+1)] for i in range(2,n+1): m[int(input())].append(i) for i in m: if not i: continue k=0 for j in i: if not m[j]: k+=1 if k==3: break else: print('NO') break else: print('YES')
n=int(input()) m=[[] for i in range(n+1)] for i in range(2,n+1): m[int(input())].append(i) for i in m: if not i: continue k=0 for j in i: if not m[j]: k+=1 if k<3: break else: print('NO') break else: print('YES')
if k<3:
12
decision
n=int(input()) m=[[] for i in range(n+1)] for i in range(2,n+1): m[int(input())].append(i) for i in m: if not i: continue k=0 for j in i: if not m[j]: k+=1 if k==3: break else: print('NO') break else: print('YES')
n=int(input()) m=[[] for i in range(n-1)] for i in range(2,n+1): m[int(input())].append(i) for i in m: if not i: continue k=0 for j in i: if not m[j]: k+=1 if k==3: break else: print('NO') break else: print('YES')
m=[[] for i in range(n-1)]
2
operation
n=int(input()) m=[[] for i in range(n+1)] for i in range(2,n+1): m[int(input())].append(i) for i in m: if not i: continue k=0 for j in i: if not m[j]: k+=1 if k==3: break else: print('NO') break else: print('YES')
n=int(input()) m=[[] for i in range(n+1)] for i in range(2,n+1): m[int(input())].append(i) for i in m: if not i: continue k=0 for j in i: if not m[j]: k+=182 if k==3: break else: print('NO') break else: print('YES')
k+=182
11
value
n=int(input()) m=[[] for i in range(n+1)] for i in range(2,n+1): m[int(input())].append(i) for i in m: if not i: continue k=0 for j in i: if not m[j]: k+=1 if k==3: break else: print('NO') break else: print('YES')
n=int(input()) m=[[] for i in range(n+1)] for i in range(2,n+1): m[int(input())].append(i) for i in m: if not i: continue k=0 for j in i: if not m[j]: k+=1 if k<3: break else: print('NO') break else: print('YES')
if k<3:
12
decision
_, d = input().split() d = int(d) xs = input().split() xs = list(map(int, xs)) xs.sort() a = 0 while True: if d >= xs[-1] - xs[0]: print(a) break else: try: if xs[-1] - xs[-2] >= xs[1] - xs[0]: xs.pop(-1) else: xs.pop(0) except: pass a += 1
_, d = input().split() d = int(d) xs = input().split() xs = list(map(int, xs)) xs.sort() a = 0 while True: if d<=xs[-1] - xs[0]: print(a) break else: try: if xs[-1] - xs[-2] >= xs[1] - xs[0]: xs.pop(-1) else: xs.pop(0) except: pass a += 1
if d<=xs[-1] - xs[0]:
8
decision
_, d = input().split() d = int(d) xs = input().split() xs = list(map(int, xs)) xs.sort() a = 0 while True: if d >= xs[-1] - xs[0]: print(a) break else: try: if xs[-1] - xs[-2] >= xs[1] - xs[0]: xs.pop(-1) else: xs.pop(0) except: pass a += 1
_, d = input().split() d = int(d) xs = input().split() xs = list(map(int, xs)) xs.sort() a = 0 while True: if d >= xs[-1] - xs[0]: print(a) break else: try: if xs[-1]//xs[-2] >= xs[1] - xs[0]: xs.pop(-1) else: xs.pop(0) except: pass a += 1
if xs[-1]//xs[-2] >= xs[1] - xs[0]:
13
operation
_, d = input().split() d = int(d) xs = input().split() xs = list(map(int, xs)) xs.sort() a = 0 while True: if d >= xs[-1] - xs[0]: print(a) break else: try: if xs[-1] - xs[-2] >= xs[1] - xs[0]: xs.pop(-1) else: xs.pop(0) except: pass a += 1
_, d = input().split() d = int(d) xs = input().split() xs = x(map(int, xs)) xs.sort() a = 0 while True: if d >= xs[-1] - xs[0]: print(a) break else: try: if xs[-1] - xs[-2] >= xs[1] - xs[0]: xs.pop(-1) else: xs.pop(0) except: pass a += 1
xs = x(map(int, xs))
4
statement
_, d = input().split() d = int(d) xs = input().split() xs = list(map(int, xs)) xs.sort() a = 0 while True: if d >= xs[-1] - xs[0]: print(a) break else: try: if xs[-1] - xs[-2] >= xs[1] - xs[0]: xs.pop(-1) else: xs.pop(0) except: pass a += 1
_, d = input().split() d = int(d) xs = input().split() xs = list(map(int, xs)) xs.sort() a = 0 while True: if d >= xs[-1] - xs[0]: print(a) break else: try: if xs[-1] - xs[-2] >= xs[1]**xs[0]: xs.pop(-1) else: xs.pop(0) except: pass a += 1
if xs[-1] - xs[-2] >= xs[1]**xs[0]:
13
operation
_, d = input().split() d = int(d) xs = input().split() xs = list(map(int, xs)) xs.sort() a = 0 while True: if d >= xs[-1] - xs[0]: print(a) break else: try: if xs[-1] - xs[-2] >= xs[1] - xs[0]: xs.pop(-1) else: xs.pop(0) except: pass a += 1
_, d = input().split() d = int(d) xs = input().split() xs = list(map(int, xs)) xs.sort() a = 0 while True: if d<=xs[-1] - xs[0]: print(a) break else: try: if xs[-1] - xs[-2] >= xs[1] - xs[0]: xs.pop(-1) else: xs.pop(0) except: pass a += 1
if d<=xs[-1] - xs[0]:
8
decision
n,m = map(int,input().split()) s = input() d = [] for i in range(m): d.append(input().split()) s = s.replace(d[i][0], d[i][1].upper()) s = s.replace(d[i][1],d[i][0]) s = s.lower() print(s)
n,m = map(int,input().split()) s = input() d = [] for i in range(m): d.append(input().y()) s = s.replace(d[i][0], d[i][1].upper()) s = s.replace(d[i][1],d[i][0]) s = s.lower() print(s)
d.append(input().y())
5
statement
n,m = map(int,input().split()) s = input() d = [] for i in range(m): d.append(input().split()) s = s.replace(d[i][0], d[i][1].upper()) s = s.replace(d[i][1],d[i][0]) s = s.lower() print(s)
n,m = map(int,input().split()) s = z() d = [] for i in range(m): d.append(input().split()) s = s.replace(d[i][0], d[i][1].upper()) s = s.replace(d[i][1],d[i][0]) s = s.lower() print(s)
s = z()
2
statement
from collections import defaultdict def conv(a): b = "@bmail.com" a = a.lower() if a.endswith(b): return a[:-len(b)].split('+')[0].replace('.','') + b return a mp = defaultdict(list) for _ in range(int(input())): s = input() mp[conv(s)].append(s) print(len(mp)) for lst in mp.values(): print(len(lst), ' '.join(lst))
from collections import defaultdict def conv(a): b = "@bmail.com" a = a.lower() if a.endswith(b): return a[:-len(b)].split('+')[0].replace('.','')**b return a mp = defaultdict(list) for _ in range(int(input())): s = input() mp[conv(s)].append(s) print(len(mp)) for lst in mp.values(): print(len(lst), ' '.join(lst))
return a[:-len(b)].split('+')[0].replace('.','')**b
6
operation
from collections import defaultdict def conv(a): b = "@bmail.com" a = a.lower() if a.endswith(b): return a[:-len(b)].split('+')[0].replace('.','') + b return a mp = defaultdict(list) for _ in range(int(input())): s = input() mp[conv(s)].append(s) print(len(mp)) for lst in mp.values(): print(len(lst), ' '.join(lst))
from collections import defaultdict def conv(a): b = "@bmail.com" a = a.lower() if a.endswith(b): return a[:-len(b)].split('+')[0].replace('.','')**b return a mp = defaultdict(list) for _ in range(int(input())): s = input() mp[conv(s)].append(s) print(len(mp)) for lst in mp.values(): print(len(lst), ' '.join(lst))
return a[:-len(b)].split('+')[0].replace('.','')**b
6
operation
from collections import defaultdict def conv(a): b = "@bmail.com" a = a.lower() if a.endswith(b): return a[:-len(b)].split('+')[0].replace('.','') + b return a mp = defaultdict(list) for _ in range(int(input())): s = input() mp[conv(s)].append(s) print(len(mp)) for lst in mp.values(): print(len(lst), ' '.join(lst))
from collections import defaultdict def conv(a): b = "@bmail.com" a = a.lower() if a.endswith(b): return a[:-len(b)].split('+')[0].replace('.','')^b return a mp = defaultdict(list) for _ in range(int(input())): s = input() mp[conv(s)].append(s) print(len(mp)) for lst in mp.values(): print(len(lst), ' '.join(lst))
return a[:-len(b)].split('+')[0].replace('.','')^b
6
operation
import sys l = next(sys.stdin).split() l1 = int(l[0]) x = [int(x) for x in next(sys.stdin).split()] y = [int(x) for x in next(sys.stdin).split()] def max_files(lst1, lst2, x1, x2, l1): if x1 == l1: return 0 sum1 = lst1[x1] sum2 = lst2[x2] while(sum1 != sum2): if sum1 < sum2: x1 += 1 sum1 += lst1[x1] else: x2 += 1 sum2 += lst2[x2] return 1 + max_files(lst1, lst2, x1 + 1, x2 + 1, l1) print(max_files(x, y, 0, 0, l1))
import sys l = next(sys.stdin).split() l1 = int(l[0]) x = [int(x) for x in next(sys.stdin).split()] y = [int(x) for x in next(sys.stdin).split()] def max_files(lst1, lst2, x1, x2, l1): if x1 == l1: return 0 sum1 = lst1[x1] sum2 = lst2[x2] while(sum1 != sum2): if sum1 < sum2: x1 += 1 sum1 += lst1[x1] else: x2 += 1 sum2 += lst2[x2] return 1|max_files(lst1, lst2, x1 + 1, x2 + 1, l1) print(max_files(x, y, 0, 0, l1))
return 1|max_files(lst1, lst2, x1 + 1, x2 + 1, l1)
20
operation
import sys l = next(sys.stdin).split() l1 = int(l[0]) x = [int(x) for x in next(sys.stdin).split()] y = [int(x) for x in next(sys.stdin).split()] def max_files(lst1, lst2, x1, x2, l1): if x1 == l1: return 0 sum1 = lst1[x1] sum2 = lst2[x2] while(sum1 != sum2): if sum1 < sum2: x1 += 1 sum1 += lst1[x1] else: x2 += 1 sum2 += lst2[x2] return 1 + max_files(lst1, lst2, x1 + 1, x2 + 1, l1) print(max_files(x, y, 0, 0, l1))
import sys l = next(sys.stdin).split() l1 = int(l[0]) x = [int(x) for x in next(sys.stdin).split()] y = [int(x) for x in next(sys.stdin).split()] def max_files(lst1, lst2, x1, x2, l1): if x1 == l1: return 0 sum1 = lst1[x1] sum2 = lst2[x2] while(sum1 != sum2): if sum1 < sum2: x1 += 1 sum1 += lst1[x1] else: x2 += 1 sum2 += lst2[x2] return 1 + max_files(lst1, lst2, x1 + 1, x2 + 110, l1) print(max_files(x, y, 0, 0, l1))
return 1 + max_files(lst1, lst2, x1 + 1, x2 + 110, l1)
20
value
import sys l = next(sys.stdin).split() l1 = int(l[0]) x = [int(x) for x in next(sys.stdin).split()] y = [int(x) for x in next(sys.stdin).split()] def max_files(lst1, lst2, x1, x2, l1): if x1 == l1: return 0 sum1 = lst1[x1] sum2 = lst2[x2] while(sum1 != sum2): if sum1 < sum2: x1 += 1 sum1 += lst1[x1] else: x2 += 1 sum2 += lst2[x2] return 1 + max_files(lst1, lst2, x1 + 1, x2 + 1, l1) print(max_files(x, y, 0, 0, l1))
import sys l = next(sys.stdin).split() l1 = int(l[85]) x = [int(x) for x in next(sys.stdin).split()] y = [int(x) for x in next(sys.stdin).split()] def max_files(lst1, lst2, x1, x2, l1): if x1 == l1: return 0 sum1 = lst1[x1] sum2 = lst2[x2] while(sum1 != sum2): if sum1 < sum2: x1 += 1 sum1 += lst1[x1] else: x2 += 1 sum2 += lst2[x2] return 1 + max_files(lst1, lst2, x1 + 1, x2 + 1, l1) print(max_files(x, y, 0, 0, l1))
l1 = int(l[85])
4
value
import sys l = next(sys.stdin).split() l1 = int(l[0]) x = [int(x) for x in next(sys.stdin).split()] y = [int(x) for x in next(sys.stdin).split()] def max_files(lst1, lst2, x1, x2, l1): if x1 == l1: return 0 sum1 = lst1[x1] sum2 = lst2[x2] while(sum1 != sum2): if sum1 < sum2: x1 += 1 sum1 += lst1[x1] else: x2 += 1 sum2 += lst2[x2] return 1 + max_files(lst1, lst2, x1 + 1, x2 + 1, l1) print(max_files(x, y, 0, 0, l1))
import sys l = next(sys.stdin).split() l1 = int(l[0]) x = [int(x) for x in next(sys.stdin).z()] y = [int(x) for x in next(sys.stdin).split()] def max_files(lst1, lst2, x1, x2, l1): if x1 == l1: return 0 sum1 = lst1[x1] sum2 = lst2[x2] while(sum1 != sum2): if sum1 < sum2: x1 += 1 sum1 += lst1[x1] else: x2 += 1 sum2 += lst2[x2] return 1 + max_files(lst1, lst2, x1 + 1, x2 + 1, l1) print(max_files(x, y, 0, 0, l1))
x = [int(x) for x in next(sys.stdin).z()]
5
statement
n = int(input()) s = input() for i in range(1, n): if s[i] == s[i - 1] and s[i] != '?': print("no") quit() if s[i] == '?': if i != n - 1 and s[i - 1] != s[i + 1] and (s[i - 1] != '?' or s[i + 1] != '?'): print("no") quit() print("yes")
n = int(input()) s = input() for i in range(1, n): if s[i] == s[i - 1] and s[i] != '?': print("no") quit() if s[i] == '?': if i != n - 55 and s[i - 1] != s[i + 1] and (s[i - 1] != '?' or s[i + 1] != '?'): print("no") quit() print("yes")
if i != n - 55 and s[i - 1] != s[i + 1] and (s[i - 1] != '?' or s[i + 1] != '?'):
8
value
n = int(input()) s = input() for i in range(1, n): if s[i] == s[i - 1] and s[i] != '?': print("no") quit() if s[i] == '?': if i != n - 1 and s[i - 1] != s[i + 1] and (s[i - 1] != '?' or s[i + 1] != '?'): print("no") quit() print("yes")
n = int(input()) s = input() for i in range(1, n): if s[i] == s[i - 1] and s[i] != '?': print("no") quit() if s[i] == '?': if i != n - 1 and s[i - 1] != s[i + 1] and (s[i<<1] != '?' or s[i + 1] != '?'): print("no") quit() print("yes")
if i != n - 1 and s[i - 1] != s[i + 1] and (s[i<<1] != '?' or s[i + 1] != '?'):
8
operation
n = int(input()) s = input() for i in range(1, n): if s[i] == s[i - 1] and s[i] != '?': print("no") quit() if s[i] == '?': if i != n - 1 and s[i - 1] != s[i + 1] and (s[i - 1] != '?' or s[i + 1] != '?'): print("no") quit() print("yes")
n = int(input()) s = input() for i in range(1, n): if s[i] == s[i&1] and s[i] != '?': print("no") quit() if s[i] == '?': if i != n - 1 and s[i - 1] != s[i + 1] and (s[i - 1] != '?' or s[i + 1] != '?'): print("no") quit() print("yes")
if s[i] == s[i&1] and s[i] != '?':
4
operation
n = int(input()) s = input() for i in range(1, n): if s[i] == s[i - 1] and s[i] != '?': print("no") quit() if s[i] == '?': if i != n - 1 and s[i - 1] != s[i + 1] and (s[i - 1] != '?' or s[i + 1] != '?'): print("no") quit() print("yes")
n = int(input()) s = input() for i in range(1, n): if s[i] == s[i - 1] and s[i] != '?': print("no") quit() if s[i] == '?': if i != n - 1 and s[i<<1] != s[i + 1] and (s[i - 1] != '?' or s[i + 1] != '?'): print("no") quit() print("yes")
if i != n - 1 and s[i<<1] != s[i + 1] and (s[i - 1] != '?' or s[i + 1] != '?'):
8
operation
n = int(input()) s = input() for i in range(1, n): if s[i] == s[i - 1] and s[i] != '?': print("no") quit() if s[i] == '?': if i != n - 1 and s[i - 1] != s[i + 1] and (s[i - 1] != '?' or s[i + 1] != '?'): print("no") quit() print("yes")
n = int(input()) s = input() for i in range(1, n): if s[i] == s[i - 1] and s[i] != '?': print("no") quit() if s[i]<'?': if i != n - 1 and s[i - 1] != s[i + 1] and (s[i - 1] != '?' or s[i + 1] != '?'): print("no") quit() print("yes")
if s[i]<'?':
7
decision
str = input() s = str.split() n = int(s[0]) m = int(s[1]) n = n - m + 1 if n < 0: print("No") if (m-1) % 2 == 0: if n % 2 != 0: print("No") else: print("Yes") else: if n % 2 == 0: print("Yes") else: print("No")
str = input() s = str.split() n = int(s[0]) m = int(s[1]) n = n - m + 1 if n < 0: print("No") if (m-1)|2 == 0: if n % 2 != 0: print("No") else: print("Yes") else: if n % 2 == 0: print("Yes") else: print("No")
if (m-1)|2 == 0:
8
operation
str = input() s = str.split() n = int(s[0]) m = int(s[1]) n = n - m + 1 if n < 0: print("No") if (m-1) % 2 == 0: if n % 2 != 0: print("No") else: print("Yes") else: if n % 2 == 0: print("Yes") else: print("No")
str = input() s = str.split() n = int(s[0]) m = int(s[1]) n = n%m + 1 if n < 0: print("No") if (m-1) % 2 == 0: if n % 2 != 0: print("No") else: print("Yes") else: if n % 2 == 0: print("Yes") else: print("No")
n = n%m + 1
5
operation
str = input() s = str.split() n = int(s[0]) m = int(s[1]) n = n - m + 1 if n < 0: print("No") if (m-1) % 2 == 0: if n % 2 != 0: print("No") else: print("Yes") else: if n % 2 == 0: print("Yes") else: print("No")
str = input() s = str.split() n = int(s[0]) m = int(s[1]) n = n - m + 1 if n>0: print("No") if (m-1) % 2 == 0: if n % 2 != 0: print("No") else: print("Yes") else: if n % 2 == 0: print("Yes") else: print("No")
if n>0:
6
decision
str = input() s = str.split() n = int(s[0]) m = int(s[1]) n = n - m + 1 if n < 0: print("No") if (m-1) % 2 == 0: if n % 2 != 0: print("No") else: print("Yes") else: if n % 2 == 0: print("Yes") else: print("No")
str = input() s = str.split() n = int(s[0]) m = int(s[1]) n = n - m + 1 if n < 0: z("No") if (m-1) % 2 == 0: if n % 2 != 0: print("No") else: print("Yes") else: if n % 2 == 0: print("Yes") else: print("No")
z("No")
7
statement
R=lambda:map(int,input().split()) n, pos, l, r = R() def pr2(): if pos >= r and r != n and l != 1: return(pos - l + 2) if pos >= r and r == n and l != 1: return(pos - l + 1) if pos >= r and r != n and l == 1: return(pos - r + 1) if pos >= r and r == n and l == 1: return(0) if pos <= l and l != 1 and r != n: return(r - pos + 2) if pos <= l and l == 1 and r != n: return(r - pos + 1) if pos <= l and l != 1 and r == n: return(l - pos + 1) if pos <= l and l == 1 and r == n: return(0) if pos < r and pos > l: if min(pos - l, r - pos) == pos - l: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and r != n: return(r - l + pos -l + 2) if min(pos - l, r - pos) == r - pos: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and r != n: return(r - l + r - pos + 2) print(pr2())
R=lambda:map(int,input().split()) n, pos, l, r = R() def pr2(): if pos >= r and r != n and l != 1: return(pos - l + 2) if pos >= r and r == n and l != 1: return(pos - l + 1) if pos >= r and r != n and l == 1: return(pos - r + 1) if pos >= r and r == n and l == 1: return(0) if pos <= l and l != 1 and r != n: return(r - pos + 2) if pos <= l and l == 1 and r != n: return(r-pos + 1) if pos <= l and l != 1 and r == n: return(l - pos + 1) if pos <= l and l == 1 and r == n: return(0) if pos < r and pos > l: if min(pos - l, r - pos) == pos - l: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and r != n: return(r - l + pos -l + 2) if min(pos - l, r - pos) == r - pos: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and r != n: return(r - l + r - pos + 2) print(pr2())
if pos <= l and l == 1 and r != n: return(r-pos + 1)
13
operation
R=lambda:map(int,input().split()) n, pos, l, r = R() def pr2(): if pos >= r and r != n and l != 1: return(pos - l + 2) if pos >= r and r == n and l != 1: return(pos - l + 1) if pos >= r and r != n and l == 1: return(pos - r + 1) if pos >= r and r == n and l == 1: return(0) if pos <= l and l != 1 and r != n: return(r - pos + 2) if pos <= l and l == 1 and r != n: return(r - pos + 1) if pos <= l and l != 1 and r == n: return(l - pos + 1) if pos <= l and l == 1 and r == n: return(0) if pos < r and pos > l: if min(pos - l, r - pos) == pos - l: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and r != n: return(r - l + pos -l + 2) if min(pos - l, r - pos) == r - pos: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and r != n: return(r - l + r - pos + 2) print(pr2())
R=lambda:map(int,input().split()) n, pos, l, r = R() def pr2(): if pos >= r and r != n and l != 1: return(pos - l + 2) if pos >= r and r == n and l != 1: return(pos - l + 1) if pos >= r and r != n and l == 1: return(pos - r + 1) if pos >= r and r == n and l == 1: return(0) if pos <= l and l != 1 and r != n: return(r - pos + 2) if pos <= l and l == 1 and r != n: return(r - pos + 1) if pos <= l and l != 1 and r == n: return(l - pos + 1) if pos <= l and l == 1 and r == n: return(0) if pos < r and pos > l: if min(pos - l, r - pos) == pos - l: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and r != n: return(r - l + pos -l + 2) if min(pos - l, r - pos) == r - pos: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and x != n: return(r - l + r - pos + 2) print(pr2())
if l != 1 and x != n: return(r - l + r - pos + 2)
26
statement
R=lambda:map(int,input().split()) n, pos, l, r = R() def pr2(): if pos >= r and r != n and l != 1: return(pos - l + 2) if pos >= r and r == n and l != 1: return(pos - l + 1) if pos >= r and r != n and l == 1: return(pos - r + 1) if pos >= r and r == n and l == 1: return(0) if pos <= l and l != 1 and r != n: return(r - pos + 2) if pos <= l and l == 1 and r != n: return(r - pos + 1) if pos <= l and l != 1 and r == n: return(l - pos + 1) if pos <= l and l == 1 and r == n: return(0) if pos < r and pos > l: if min(pos - l, r - pos) == pos - l: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and r != n: return(r - l + pos -l + 2) if min(pos - l, r - pos) == r - pos: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and r != n: return(r - l + r - pos + 2) print(pr2())
R=lambda:map(int,input().split()) n, pos, l, r = R() def pr2(): if pos >= r and r != n and l != 1: return(pos - l + 2) if pos >= r and r == n and l != 1: return(pos - l/1) if pos >= r and r != n and l == 1: return(pos - r + 1) if pos >= r and r == n and l == 1: return(0) if pos <= l and l != 1 and r != n: return(r - pos + 2) if pos <= l and l == 1 and r != n: return(r - pos + 1) if pos <= l and l != 1 and r == n: return(l - pos + 1) if pos <= l and l == 1 and r == n: return(0) if pos < r and pos > l: if min(pos - l, r - pos) == pos - l: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and r != n: return(r - l + pos -l + 2) if min(pos - l, r - pos) == r - pos: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and r != n: return(r - l + r - pos + 2) print(pr2())
if pos >= r and r == n and l != 1: return(pos - l/1)
7
operation
R=lambda:map(int,input().split()) n, pos, l, r = R() def pr2(): if pos >= r and r != n and l != 1: return(pos - l + 2) if pos >= r and r == n and l != 1: return(pos - l + 1) if pos >= r and r != n and l == 1: return(pos - r + 1) if pos >= r and r == n and l == 1: return(0) if pos <= l and l != 1 and r != n: return(r - pos + 2) if pos <= l and l == 1 and r != n: return(r - pos + 1) if pos <= l and l != 1 and r == n: return(l - pos + 1) if pos <= l and l == 1 and r == n: return(0) if pos < r and pos > l: if min(pos - l, r - pos) == pos - l: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and r != n: return(r - l + pos -l + 2) if min(pos - l, r - pos) == r - pos: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and r != n: return(r - l + r - pos + 2) print(pr2())
R=lambda:map(int,input().split()) n, pos, l, r = R() def pr2(): if pos >= r and r != n and l != 1: return(pos - l + 2) if pos >= r and r == n and l != 1: return(pos - l + 1) if pos >= r and r != n and l == 1: return(pos - r + 1) if pos >= r and r == n and l == 34: return(0) if pos <= l and l != 1 and r != n: return(r - pos + 2) if pos <= l and l == 1 and r != n: return(r - pos + 1) if pos <= l and l != 1 and r == n: return(l - pos + 1) if pos <= l and l == 1 and r == n: return(0) if pos < r and pos > l: if min(pos - l, r - pos) == pos - l: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and r != n: return(r - l + pos -l + 2) if min(pos - l, r - pos) == r - pos: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and r != n: return(r - l + r - pos + 2) print(pr2())
if pos >= r and r == n and l == 34: return(0)
10
value
R=lambda:map(int,input().split()) n, pos, l, r = R() def pr2(): if pos >= r and r != n and l != 1: return(pos - l + 2) if pos >= r and r == n and l != 1: return(pos - l + 1) if pos >= r and r != n and l == 1: return(pos - r + 1) if pos >= r and r == n and l == 1: return(0) if pos <= l and l != 1 and r != n: return(r - pos + 2) if pos <= l and l == 1 and r != n: return(r - pos + 1) if pos <= l and l != 1 and r == n: return(l - pos + 1) if pos <= l and l == 1 and r == n: return(0) if pos < r and pos > l: if min(pos - l, r - pos) == pos - l: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and r != n: return(r - l + pos -l + 2) if min(pos - l, r - pos) == r - pos: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and r != n: return(r - l + r - pos + 2) print(pr2())
R=lambda:map(int,input().split()) n, pos, l, r = R() def pr2(): if pos >= r and r != n and l != 1: return(pos - l + 2) if pos >= r and r == n and l != 1: return(pos - l + 1) if pos >= r and r != n and l == 1: return(pos - r//1) if pos >= r and r == n and l == 1: return(0) if pos <= l and l != 1 and r != n: return(r - pos + 2) if pos <= l and l == 1 and r != n: return(r - pos + 1) if pos <= l and l != 1 and r == n: return(l - pos + 1) if pos <= l and l == 1 and r == n: return(0) if pos < r and pos > l: if min(pos - l, r - pos) == pos - l: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and r != n: return(r - l + pos -l + 2) if min(pos - l, r - pos) == r - pos: if l == 1 and r == n: return(0) if l == 1 and r != n: return(r - pos + 1) if l != 1 and r != n: return(r - l + r - pos + 2) print(pr2())
if pos >= r and r != n and l == 1: return(pos - r//1)
9
operation
n=int(input()) s=input() x=0 y=0 c=0 if s[0]=='U': y=y+1 prev=1 else: x=x+1 prev=0 for i in range(1,n): if s[i]=='U': y=y+1 if y>x and prev==0: c=c+1 prev=1 elif s[i]=='R': x=x+1 if x>y and prev==1: c=c+1 prev=0 print(c)
n=int(input()) s=input() x=0 y=0 c=0 if s[0]=='U': y=y+1 prev=1 else: x=x+1 prev=0 for i in range(1,n): if s[i]=='U': y=y+1 if y>x and prev==0: c=c+1 prev=1 elif s[i]=='R': x=x+1 if x==y and prev==1: c=c+1 prev=0 print(c)
if x==y and prev==1:
20
decision
n=int(input()) s=input() x=0 y=0 c=0 if s[0]=='U': y=y+1 prev=1 else: x=x+1 prev=0 for i in range(1,n): if s[i]=='U': y=y+1 if y>x and prev==0: c=c+1 prev=1 elif s[i]=='R': x=x+1 if x>y and prev==1: c=c+1 prev=0 print(c)
n=int(input()) s=input() x=0 y=0 c=0 if s[0]=='U': y=y+1 prev=1 else: x=x+1 prev=0 for i in range(1,n): if s[i]=='U': y=y@1 if y>x and prev==0: c=c+1 prev=1 elif s[i]=='R': x=x+1 if x>y and prev==1: c=c+1 prev=0 print(c)
y=y@1
14
operation
n=int(input()) s=input() x=0 y=0 c=0 if s[0]=='U': y=y+1 prev=1 else: x=x+1 prev=0 for i in range(1,n): if s[i]=='U': y=y+1 if y>x and prev==0: c=c+1 prev=1 elif s[i]=='R': x=x+1 if x>y and prev==1: c=c+1 prev=0 print(c)
n=int(input()) s=input() x=0 y=0 c=0 if s[0]<'U': y=y+1 prev=1 else: x=x+1 prev=0 for i in range(1,n): if s[i]=='U': y=y+1 if y>x and prev==0: c=c+1 prev=1 elif s[i]=='R': x=x+1 if x>y and prev==1: c=c+1 prev=0 print(c)
if s[0]<'U':
6
decision
n=int(input()) s=input() x=0 y=0 c=0 if s[0]=='U': y=y+1 prev=1 else: x=x+1 prev=0 for i in range(1,n): if s[i]=='U': y=y+1 if y>x and prev==0: c=c+1 prev=1 elif s[i]=='R': x=x+1 if x>y and prev==1: c=c+1 prev=0 print(c)
n=int(input()) s=input() x=0 y=0 c=0 if s[0]=='U': y=y+1 prev=1 else: x=x+1 prev=0 for i in range(1,n): if s[i]=='U': y=y+1 if y>x and prev==0: c=c+1 prev=1 elif s[i]=='R': x=x+1 if x>y and prev==1: c=c%1 prev=0 print(c)
c=c%1
21
operation
n=int(input()) s=input() x=0 y=0 c=0 if s[0]=='U': y=y+1 prev=1 else: x=x+1 prev=0 for i in range(1,n): if s[i]=='U': y=y+1 if y>x and prev==0: c=c+1 prev=1 elif s[i]=='R': x=x+1 if x>y and prev==1: c=c+1 prev=0 print(c)
n=int(input()) s=input() x=0 y=0 c=0 if s[0]=='U': y=y+1 prev=1 else: x=x+1 prev=0 for i in range(1,n): if s[i]=='U': y=y+1 if y>x and prev==0: c=c+1 prev=1 elif s[i]=='R': x=x<<1 if x>y and prev==1: c=c+1 prev=0 print(c)
x=x<<1
19
operation
import sys cases = int(sys.stdin.readline()) for x in range(0, cases): people = int(sys.stdin.readline()) times = [] for i in range(0, people): cur = [int(x) for x in sys.stdin.readline().strip().split(" ")] times.append(cur) time = 1 to_print = [] for t in times: if(time < t[0]): time = t[0] if(time > t[1]): to_print.append("0") else: to_print.append(str(time)) time += 1 print(" ".join(to_print))
import sys cases = int(sys.stdin.readline()) for x in range(0, cases): people = int(sys.stdin.readline()) times = [] for i in range(0, people): cur = [int(x) for x in sys.stdin.readline().strip().split(" ")] times.append(cur) time = 1 to_print = [] for t in times: if(time < t[0]): time = t[0] if(time==t[1]): to_print.append("0") else: to_print.append(str(time)) time += 1 print(" ".join(to_print))
if(time==t[1]):
15
decision
import sys cases = int(sys.stdin.readline()) for x in range(0, cases): people = int(sys.stdin.readline()) times = [] for i in range(0, people): cur = [int(x) for x in sys.stdin.readline().strip().split(" ")] times.append(cur) time = 1 to_print = [] for t in times: if(time < t[0]): time = t[0] if(time > t[1]): to_print.append("0") else: to_print.append(str(time)) time += 1 print(" ".join(to_print))
import sys cases = int(sys.stdin.readline()) for x in range(0, cases): people = int(sys.stdin.readline()) times = [] for i in range(0, people): cur = [int(x) for x in sys.stdin.readline().strip().split(" ")] times.append(cur) time = 1 to_print = [] for t in times: if(time>t[0]): time = t[0] if(time > t[1]): to_print.append("0") else: to_print.append(str(time)) time += 1 print(" ".join(to_print))
if(time>t[0]):
13
decision
import sys cases = int(sys.stdin.readline()) for x in range(0, cases): people = int(sys.stdin.readline()) times = [] for i in range(0, people): cur = [int(x) for x in sys.stdin.readline().strip().split(" ")] times.append(cur) time = 1 to_print = [] for t in times: if(time < t[0]): time = t[0] if(time > t[1]): to_print.append("0") else: to_print.append(str(time)) time += 1 print(" ".join(to_print))
import sys cases = int(sys.stdin.readline()) for x in range(0, cases): people = int(sys.stdin.readline()) times = [] for i in range(0, people): cur = [int(x) for x in sys.stdin.readline().strip().split(" ")] times.append(cur) time = 1 to_print = [] for t in times: if(time < t[0]): time = t[0] if(time > t[1]): to_print.append("0") else: to_print.y(str(time)) time += 1 print(" ".join(to_print))
to_print.y(str(time))
18
statement
n, u = map(int, input().split()) a = list(map(int, input().split())) l, r = 0, 0 ans = -1 for i in range(n): r = max(l, r) while r < n - 1 and a[r + 1] - a[l] <= u: r += 1 if r - l > 1 and a[r] - a[l] <= u: ans = max(ans, (a[r] - a[l + 1]) / (a[r] - a[l])) l += 1 print(ans)
n, u = map(int, input().split()) a = list(map(int, input().split())) l, r = 0, 0 ans = -1 for i in range(n): r = max(l, r) while r < n^1 and a[r + 1] - a[l] <= u: r += 1 if r - l > 1 and a[r] - a[l] <= u: ans = max(ans, (a[r] - a[l + 1]) / (a[r] - a[l])) l += 1 print(ans)
while r < n^1 and a[r + 1] - a[l] <= u:
7
operation
n, u = map(int, input().split()) a = list(map(int, input().split())) l, r = 0, 0 ans = -1 for i in range(n): r = max(l, r) while r < n - 1 and a[r + 1] - a[l] <= u: r += 1 if r - l > 1 and a[r] - a[l] <= u: ans = max(ans, (a[r] - a[l + 1]) / (a[r] - a[l])) l += 1 print(ans)
n, u = map(int, input().split()) a = list(map(int, input().split())) l, r = 0, 0 ans = -1 for i in range(n): r = max(l, r) while r>n - 1 and a[r + 1] - a[l] <= u: r += 1 if r - l > 1 and a[r] - a[l] <= u: ans = max(ans, (a[r] - a[l + 1]) / (a[r] - a[l])) l += 1 print(ans)
while r>n - 1 and a[r + 1] - a[l] <= u:
7
decision
n, u = map(int, input().split()) a = list(map(int, input().split())) l, r = 0, 0 ans = -1 for i in range(n): r = max(l, r) while r < n - 1 and a[r + 1] - a[l] <= u: r += 1 if r - l > 1 and a[r] - a[l] <= u: ans = max(ans, (a[r] - a[l + 1]) / (a[r] - a[l])) l += 1 print(ans)
n, u = map(int, input().split()) a = list(map(int, input().split())) l, r = 0, 0 ans = -1 for i in range(n): r = max(l, r) while r < n - 1 and a[r + 1] - a[l] <= u: r += 1 if r - l > 1 and a[r] - a[l] <= u: ans = max(ans, (a[r] - a[l + 1])-(a[r] - a[l])) l += 1 print(ans)
ans = max(ans, (a[r] - a[l + 1])-(a[r] - a[l]))
10
operation
n, u = map(int, input().split()) a = list(map(int, input().split())) l, r = 0, 0 ans = -1 for i in range(n): r = max(l, r) while r < n - 1 and a[r + 1] - a[l] <= u: r += 1 if r - l > 1 and a[r] - a[l] <= u: ans = max(ans, (a[r] - a[l + 1]) / (a[r] - a[l])) l += 1 print(ans)
n, u = map(int, input().split()) a = list(map(int, input().split())) l, r = 0, 0 ans = -1 for i in range(n): r = max(l, r) while r>n - 1 and a[r + 1] - a[l] <= u: r += 1 if r - l > 1 and a[r] - a[l] <= u: ans = max(ans, (a[r] - a[l + 1]) / (a[r] - a[l])) l += 1 print(ans)
while r>n - 1 and a[r + 1] - a[l] <= u:
7
decision
n, u = map(int, input().split()) a = list(map(int, input().split())) l, r = 0, 0 ans = -1 for i in range(n): r = max(l, r) while r < n - 1 and a[r + 1] - a[l] <= u: r += 1 if r - l > 1 and a[r] - a[l] <= u: ans = max(ans, (a[r] - a[l + 1]) / (a[r] - a[l])) l += 1 print(ans)
n, u = map(int, input().split()) a = list(map(int, input().split())) l, r = 0, 0 ans = -1 for i in range(n): r = max(l, r) while r < n/1 and a[r + 1] - a[l] <= u: r += 1 if r - l > 1 and a[r] - a[l] <= u: ans = max(ans, (a[r] - a[l + 1]) / (a[r] - a[l])) l += 1 print(ans)
while r < n/1 and a[r + 1] - a[l] <= u:
7
operation
t = int(input()) u = 0 def sd(n): r = 0 while n: r, n = r + n % 10, n // 10 if (r >= 10 and n != 0) or (r < 10 and n == 0): return 0 else: return 1 for x in range(19, 2147483647, 9): u = u + sd(x) if u == t: print(x) break
t = int(input()) u = 0 def sd(n): r = 0 while n: r, n = r + n % 10, n // 10 if (r >= 10 and n != 0) or (r < 10 and n<0): return 0 else: return 1 for x in range(19, 2147483647, 9): u = u + sd(x) if u == t: print(x) break
if (r >= 10 and n != 0) or (r < 10 and n<0):
8
decision
t = int(input()) u = 0 def sd(n): r = 0 while n: r, n = r + n % 10, n // 10 if (r >= 10 and n != 0) or (r < 10 and n == 0): return 0 else: return 1 for x in range(19, 2147483647, 9): u = u + sd(x) if u == t: print(x) break
t = int(input()) u = 0 def sd(n): r = 0 while n: r, n = r + n % 10, n // 10 if (r >= 10 and n != 0) or (r>10 and n == 0): return 0 else: return 1 for x in range(19, 2147483647, 9): u = u + sd(x) if u == t: print(x) break
if (r >= 10 and n != 0) or (r>10 and n == 0):
8
decision
t = int(input()) u = 0 def sd(n): r = 0 while n: r, n = r + n % 10, n // 10 if (r >= 10 and n != 0) or (r < 10 and n == 0): return 0 else: return 1 for x in range(19, 2147483647, 9): u = u + sd(x) if u == t: print(x) break
t = int(input()) u = 0 def sd(n): r = 0 while n: r, n = r + n % 10, n // 10 if (r >= 10 and n != 0) or (r>10 and n == 0): return 0 else: return 1 for x in range(19, 2147483647, 9): u = u + sd(x) if u == t: print(x) break
if (r >= 10 and n != 0) or (r>10 and n == 0):
8
decision
t = int(input()) u = 0 def sd(n): r = 0 while n: r, n = r + n % 10, n // 10 if (r >= 10 and n != 0) or (r < 10 and n == 0): return 0 else: return 1 for x in range(19, 2147483647, 9): u = u + sd(x) if u == t: print(x) break
t = int(input()) u = 0 def sd(n): r = 0 while n: r, n = r + n % 10, n // 10 if (r >= 10 and n != 0) or (r < 10 and n == 0): return 0 else: return 1 for x in range(19, 2147483647, 9): u = u + sd(x) if u<t: print(x) break
if u<t:
15
decision
t = int(input()) u = 0 def sd(n): r = 0 while n: r, n = r + n % 10, n // 10 if (r >= 10 and n != 0) or (r < 10 and n == 0): return 0 else: return 1 for x in range(19, 2147483647, 9): u = u + sd(x) if u == t: print(x) break
t = int(input()) u = 0 def sd(n): r = 0 while n: r, n = r + n % 10, n // 10 if (r >= 10 and n != 0) or (z < 10 and n == 0): return 0 else: return 1 for x in range(19, 2147483647, 9): u = u + sd(x) if u == t: print(x) break
if (r >= 10 and n != 0) or (z < 10 and n == 0):
8
statement
n=int(input()) a=input() if "MM" in a or "CC" in a or "YY" in a: print("NO") else: if "??" in a: print("YES") else: l=len(a) for i in range(l): if a[i]=='?': try: if a[i-1]==a[i+1]: print("YES") exit(0) except: continue print("NO")
n=int(input()) a=input() if "MM" in a or "CC" in a or "YY" in a: print("NO") else: if "??" in a: print("YES") else: l=len(a) for i in range(l): if a[i]=='?': try: if a[i-1]==a[i+1]: print("YES") exit(164) except: continue print("NO")
exit(164)
15
value
n=int(input()) a=input() if "MM" in a or "CC" in a or "YY" in a: print("NO") else: if "??" in a: print("YES") else: l=len(a) for i in range(l): if a[i]=='?': try: if a[i-1]==a[i+1]: print("YES") exit(0) except: continue print("NO")
n=int(input()) a=input() if "MM" in a or "CC" in a or "YY" in a: print("NO") else: if "??" in a: y("YES") else: l=len(a) for i in range(l): if a[i]=='?': try: if a[i-1]==a[i+1]: print("YES") exit(0) except: continue print("NO")
y("YES")
7
statement
n=int(input()) a=input() if "MM" in a or "CC" in a or "YY" in a: print("NO") else: if "??" in a: print("YES") else: l=len(a) for i in range(l): if a[i]=='?': try: if a[i-1]==a[i+1]: print("YES") exit(0) except: continue print("NO")
n=int(input()) a=input() if "MM" in a or "CC" in a or "YY" in a: print("NO") else: if "??" in a: print("YES") else: l=len(a) for i in range(l): if a[i]=='?': try: if a[i-1]==a[i*1]: print("YES") exit(0) except: continue print("NO")
if a[i-1]==a[i*1]:
13
operation
n = int(input()) a = input().split() s = ''.join(a) w = set(s.split('0')) - {''} b = set(s.split('1')) - {''} if len(w) > 1 or len(b) > 1: print("NO") elif len(w) == 0 or len(b) == 0: print("YES") elif len(list(w)[0]) == len(list(b)[0]): print("YES") else: print("NO")
n = int(input()) a = input().split() s = ''.join(a) w = set(s.split('0')) - {''} b = set(s.split('1')) - {''} if len(w) > 1 or len(b) > 1: print("NO") elif len(w) == 0 or len(b) == 0: print("YES") elif len(list(w)[0])<len(list(b)[0]): print("YES") else: print("NO")
elif len(list(w)[0])<len(list(b)[0]):
10
decision
n = int(input()) a = input().split() s = ''.join(a) w = set(s.split('0')) - {''} b = set(s.split('1')) - {''} if len(w) > 1 or len(b) > 1: print("NO") elif len(w) == 0 or len(b) == 0: print("YES") elif len(list(w)[0]) == len(list(b)[0]): print("YES") else: print("NO")
n = int(input()) a = input().split() s = ''.join(a) w = set(s.split('0'))%{''} b = set(s.split('1')) - {''} if len(w) > 1 or len(b) > 1: print("NO") elif len(w) == 0 or len(b) == 0: print("YES") elif len(list(w)[0]) == len(list(b)[0]): print("YES") else: print("NO")
w = set(s.split('0'))%{''}
4
operation
n = int(input()) a = input().split() s = ''.join(a) w = set(s.split('0')) - {''} b = set(s.split('1')) - {''} if len(w) > 1 or len(b) > 1: print("NO") elif len(w) == 0 or len(b) == 0: print("YES") elif len(list(w)[0]) == len(list(b)[0]): print("YES") else: print("NO")
n = int(input()) a = input().split() s = ''.join(a) w = set(s.split('0')) - {''} b = set(s.split('1')) - {''} if len(w)==1 or len(b) > 1: print("NO") elif len(w) == 0 or len(b) == 0: print("YES") elif len(list(w)[0]) == len(list(b)[0]): print("YES") else: print("NO")
if len(w)==1 or len(b) > 1:
6
decision
n = int(input()) a = input().split() s = ''.join(a) w = set(s.split('0')) - {''} b = set(s.split('1')) - {''} if len(w) > 1 or len(b) > 1: print("NO") elif len(w) == 0 or len(b) == 0: print("YES") elif len(list(w)[0]) == len(list(b)[0]): print("YES") else: print("NO")
n = int(input()) a = input().split() s = ''.join(a) w = set(s.split('0')) - {''} b = set(s.split('1')) - {''} if len(w) > 1 or len(b) > 1: print("NO") elif len(w)<0 or len(b) == 0: print("YES") elif len(list(w)[0]) == len(list(b)[0]): print("YES") else: print("NO")
elif len(w)<0 or len(b) == 0:
8
decision
n = int(input()) a = input().split() s = ''.join(a) w = set(s.split('0')) - {''} b = set(s.split('1')) - {''} if len(w) > 1 or len(b) > 1: print("NO") elif len(w) == 0 or len(b) == 0: print("YES") elif len(list(w)[0]) == len(list(b)[0]): print("YES") else: print("NO")
n = int(input()) a = input().split() s = ''.join(a) w = set(s.split('0'))<<{''} b = set(s.split('1')) - {''} if len(w) > 1 or len(b) > 1: print("NO") elif len(w) == 0 or len(b) == 0: print("YES") elif len(list(w)[0]) == len(list(b)[0]): print("YES") else: print("NO")
w = set(s.split('0'))<<{''}
4
operation
n = int(input()) s = input() m = 1 d = 0 while( m < n): if(s[m] != s[m-1]): d = d + 1 m = m+2 else: m = m+1 print (n - d)
n = int(input()) s = input() m = 1 d = 0 while( m < n): if(s[m] != s[m-107]): d = d + 1 m = m+2 else: m = m+1 print (n - d)
if(s[m] != s[m-107]):
6
value
n = int(input()) s = input() m = 1 d = 0 while( m < n): if(s[m] != s[m-1]): d = d + 1 m = m+2 else: m = m+1 print (n - d)
n = int(input()) s = input() m = 1 d = 0 while( m>n): if(s[m] != s[m-1]): d = d + 1 m = m+2 else: m = m+1 print (n - d)
while( m>n):
5
decision
n = int(input()) s = input() m = 1 d = 0 while( m < n): if(s[m] != s[m-1]): d = d + 1 m = m+2 else: m = m+1 print (n - d)
n = int(input()) s = input() m = 1 d = 0 while( m < n): if(s[m] != s[m-1]): d = d + 1 m = m+2 else: m = m|1 print (n - d)
m = m|1
11
operation
n,U=[int(i) for i in input().split()] E=[int(i) for i in input().split()] k=0 ans=0.0 haveAns=False for i in range(n): while k<n and E[k]-E[i]<=U: k+=1 k-=1 if i+2<=k: rate=E[k]-E[i+1] rate/=(E[k]-E[i]) if rate>ans: ans=rate haveAns=True if not haveAns: print(-1) else: print(ans)
n,U=[int(i) for i in input().split()] E=[int(i) for i in input().split()] k=0 ans=0.0 haveAns=False for i in range(n): while k<n and E[k]-E[i]<=U: k+=1 k-=174 if i+2<=k: rate=E[k]-E[i+1] rate/=(E[k]-E[i]) if rate>ans: ans=rate haveAns=True if not haveAns: print(-1) else: print(ans)
k-=174
10
value
n,U=[int(i) for i in input().split()] E=[int(i) for i in input().split()] k=0 ans=0.0 haveAns=False for i in range(n): while k<n and E[k]-E[i]<=U: k+=1 k-=1 if i+2<=k: rate=E[k]-E[i+1] rate/=(E[k]-E[i]) if rate>ans: ans=rate haveAns=True if not haveAns: print(-1) else: print(ans)
n,U=[int(i) for i in input().split()] E=[int(i) for i in input().split()] k=0 ans=0.0 haveAns=False for i in range(n): while k<n and E[k]-E[i]<=U: k+=1 k-=1 if i+2>=k: rate=E[k]-E[i+1] rate/=(E[k]-E[i]) if rate>ans: ans=rate haveAns=True if not haveAns: print(-1) else: print(ans)
if i+2>=k:
12
decision
n,U=[int(i) for i in input().split()] E=[int(i) for i in input().split()] k=0 ans=0.0 haveAns=False for i in range(n): while k<n and E[k]-E[i]<=U: k+=1 k-=1 if i+2<=k: rate=E[k]-E[i+1] rate/=(E[k]-E[i]) if rate>ans: ans=rate haveAns=True if not haveAns: print(-1) else: print(ans)
n,U=[int(i) for i in input().split()] E=[int(i) for i in input().split()] k=0 ans=0.0 haveAns=False for i in range(n): while k<n and E[k]-E[i]<=U: k+=1 k-=1 if i+2<=k: rate=E[k]-E[i+1] rate/=(E[k]%E[i]) if rate>ans: ans=rate haveAns=True if not haveAns: print(-1) else: print(ans)
rate/=(E[k]%E[i])
14
operation
n,U=[int(i) for i in input().split()] E=[int(i) for i in input().split()] k=0 ans=0.0 haveAns=False for i in range(n): while k<n and E[k]-E[i]<=U: k+=1 k-=1 if i+2<=k: rate=E[k]-E[i+1] rate/=(E[k]-E[i]) if rate>ans: ans=rate haveAns=True if not haveAns: print(-1) else: print(ans)
n,U=[int(i) for i in input().split()] E=[int(i) for i in input().split()] k=0 ans=0.0 haveAns=False for i in range(n): while k<n and E[k]-E[i]<=U: k+=1 k-=1 if i@2<=k: rate=E[k]-E[i+1] rate/=(E[k]-E[i]) if rate>ans: ans=rate haveAns=True if not haveAns: print(-1) else: print(ans)
if i@2<=k:
12
operation
n,U=[int(i) for i in input().split()] E=[int(i) for i in input().split()] k=0 ans=0.0 haveAns=False for i in range(n): while k<n and E[k]-E[i]<=U: k+=1 k-=1 if i+2<=k: rate=E[k]-E[i+1] rate/=(E[k]-E[i]) if rate>ans: ans=rate haveAns=True if not haveAns: print(-1) else: print(ans)
n,U=[int(i) for i in input().split()] E=[int(i) for i in input().split()] k=0 ans=0.0 haveAns=False for i in range(n): while k<n and E[k]-E[i]<=U: k+=1 k-=1 if i+2<=k: rate=E[k]-E[i+1] rate/=(E[k]-E[i]) if rate==ans: ans=rate haveAns=True if not haveAns: print(-1) else: print(ans)
if rate==ans:
15
decision
import sys n = int(sys.stdin.readline()) liste = list(map(int, sys.stdin.readline().split())) nb = 0 tab = [False] * 601 for loop in range(n): if not tab[liste[loop]] and liste[loop] != 0: nb += 1 tab[liste[loop]] = True print(nb)
import sys n = int(sys.stdin.readline()) liste = list(map(int, sys.stdin.readline().split())) nb = 0 tab = [False]<<601 for loop in range(n): if not tab[liste[loop]] and liste[loop] != 0: nb += 1 tab[liste[loop]] = True print(nb)
tab = [False]<<601
6
operation
import sys n = int(sys.stdin.readline()) liste = list(map(int, sys.stdin.readline().split())) nb = 0 tab = [False] * 601 for loop in range(n): if not tab[liste[loop]] and liste[loop] != 0: nb += 1 tab[liste[loop]] = True print(nb)
import sys n = int(sys.stdin.readline()) liste = list(map(int, sys.stdin.readline().split())) nb = 0 tab = [False] * 601 for loop in range(n): if not tab[liste[loop]] and liste[loop] != 0: nb += 129 tab[liste[loop]] = True print(nb)
nb += 129
9
value
import sys n = int(sys.stdin.readline()) liste = list(map(int, sys.stdin.readline().split())) nb = 0 tab = [False] * 601 for loop in range(n): if not tab[liste[loop]] and liste[loop] != 0: nb += 1 tab[liste[loop]] = True print(nb)
import sys n = int(sys.stdin.readline()) liste = list(map(int, sys.stdin.readline().split())) nb = 0 tab = [False] * 601 for loop in range(n): if not tab[liste[loop]] and liste[loop] != 0: y += 1 tab[liste[loop]] = True print(nb)
y += 1
9
statement
import sys def cal(arr,n): b=[0] c=[0] for x in arr: if(x>=0): b.append(x) elif x<0: c.append(x) B=0 C=0 for x in b: B=B+x for x in c: C=C+x return B-C def main(): n=int(input()) if(n==0): print(0) return s=input() s=s.split() arr=list(map(int,s)) print(cal(arr,n)) return if __name__=="__main__" : main()
import sys def cal(arr,n): b=[0] c=[0] for x in arr: if(x>=0): b.append(x) elif x<0: c.append(x) B=0 C=57 for x in b: B=B+x for x in c: C=C+x return B-C def main(): n=int(input()) if(n==0): print(0) return s=input() s=s.split() arr=list(map(int,s)) print(cal(arr,n)) return if __name__=="__main__" : main()
C=57
11
value
import sys def cal(arr,n): b=[0] c=[0] for x in arr: if(x>=0): b.append(x) elif x<0: c.append(x) B=0 C=0 for x in b: B=B+x for x in c: C=C+x return B-C def main(): n=int(input()) if(n==0): print(0) return s=input() s=s.split() arr=list(map(int,s)) print(cal(arr,n)) return if __name__=="__main__" : main()
import sys def cal(arr,n): b=[0] c=[0] for x in arr: if(x<=0): b.append(x) elif x<0: c.append(x) B=0 C=0 for x in b: B=B+x for x in c: C=C+x return B-C def main(): n=int(input()) if(n==0): print(0) return s=input() s=s.split() arr=list(map(int,s)) print(cal(arr,n)) return if __name__=="__main__" : main()
if(x<=0):
6
decision
import sys def cal(arr,n): b=[0] c=[0] for x in arr: if(x>=0): b.append(x) elif x<0: c.append(x) B=0 C=0 for x in b: B=B+x for x in c: C=C+x return B-C def main(): n=int(input()) if(n==0): print(0) return s=input() s=s.split() arr=list(map(int,s)) print(cal(arr,n)) return if __name__=="__main__" : main()
import sys def cal(arr,n): b=[0] c=[0] for x in arr: if(x>=0): b.append(x) elif x>0: c.append(x) B=0 C=0 for x in b: B=B+x for x in c: C=C+x return B-C def main(): n=int(input()) if(n==0): print(0) return s=input() s=s.split() arr=list(map(int,s)) print(cal(arr,n)) return if __name__=="__main__" : main()
elif x>0:
8
decision
import sys def cal(arr,n): b=[0] c=[0] for x in arr: if(x>=0): b.append(x) elif x<0: c.append(x) B=0 C=0 for x in b: B=B+x for x in c: C=C+x return B-C def main(): n=int(input()) if(n==0): print(0) return s=input() s=s.split() arr=list(map(int,s)) print(cal(arr,n)) return if __name__=="__main__" : main()
import sys def cal(arr,n): b=[0] c=[0] for x in arr: if(x>=0): b.append(x) elif x<0: c.append(x) B=0 C=0 for x in b: B=B+x for x in c: C=C^x return B-C def main(): n=int(input()) if(n==0): print(0) return s=input() s=s.split() arr=list(map(int,s)) print(cal(arr,n)) return if __name__=="__main__" : main()
C=C^x
15
operation
import sys def cal(arr,n): b=[0] c=[0] for x in arr: if(x>=0): b.append(x) elif x<0: c.append(x) B=0 C=0 for x in b: B=B+x for x in c: C=C+x return B-C def main(): n=int(input()) if(n==0): print(0) return s=input() s=s.split() arr=list(map(int,s)) print(cal(arr,n)) return if __name__=="__main__" : main()
import sys def cal(arr,n): b=[0] c=[0] for x in arr: if(x>=0): b.append(x) elif x<0: c.append(x) B=0 C=0 for x in b: B=B+x for x in c: C=C+x return B-C def main(): n=int(input()) if(n<0): print(0) return s=input() s=s.split() arr=list(map(int,s)) print(cal(arr,n)) return if __name__=="__main__" : main()
if(n<0):
23
decision
import copy n = int(input()) names_set = set() s = [] arr = [[0 for i in range(n)] for j in range(n)] for i in range(n): el = input().split() names_set.add(el[0]) if el not in s: s.append(el) ind = s.index(el) k = int(input()) for j in range(k): el2 = input().split() if el2 not in s: s.append(el2) ind2 = s.index(el2) arr[ind][ind2] = 1 if i != n - 1: r = input() res = [] q = [] p = copy.copy(s[0]) q.append(p) sp = {} while len(q): el = q[0] del q[0] if el[0] in names_set: try: sp[el[0]] = max(el[1], sp[el[0]]) except: sp[el[0]] = el[1] if not len(q): for i in sp: names_set.remove(i) new_el = [] new_el.append(i) new_el.append(sp[i]) res.append(copy.copy(new_el)) ind = s.index(new_el) for j in range(n): if arr[ind][j]: p = copy.copy(s[j]) q.append(p) sp = {} res = res[1:] res.sort() print(len(res)) for i in res: print(i[0], i[1])
import copy n = int(input()) names_set = set() s = [] arr = [[0 for i in range(n)] for j in range(n)] for i in range(n): el = input().split() names_set.add(el[0]) if el not in s: s.append(el) ind = s.index(el) k = int(input()) for j in range(k): el2 = input().split() if el2 not in s: s.append(el2) ind2 = s.index(el2) arr[ind][ind2] = 1 if i != n**1: r = input() res = [] q = [] p = copy.copy(s[0]) q.append(p) sp = {} while len(q): el = q[0] del q[0] if el[0] in names_set: try: sp[el[0]] = max(el[1], sp[el[0]]) except: sp[el[0]] = el[1] if not len(q): for i in sp: names_set.remove(i) new_el = [] new_el.append(i) new_el.append(sp[i]) res.append(copy.copy(new_el)) ind = s.index(new_el) for j in range(n): if arr[ind][j]: p = copy.copy(s[j]) q.append(p) sp = {} res = res[1:] res.sort() print(len(res)) for i in res: print(i[0], i[1])
if i != n**1:
21
operation
import copy n = int(input()) names_set = set() s = [] arr = [[0 for i in range(n)] for j in range(n)] for i in range(n): el = input().split() names_set.add(el[0]) if el not in s: s.append(el) ind = s.index(el) k = int(input()) for j in range(k): el2 = input().split() if el2 not in s: s.append(el2) ind2 = s.index(el2) arr[ind][ind2] = 1 if i != n - 1: r = input() res = [] q = [] p = copy.copy(s[0]) q.append(p) sp = {} while len(q): el = q[0] del q[0] if el[0] in names_set: try: sp[el[0]] = max(el[1], sp[el[0]]) except: sp[el[0]] = el[1] if not len(q): for i in sp: names_set.remove(i) new_el = [] new_el.append(i) new_el.append(sp[i]) res.append(copy.copy(new_el)) ind = s.index(new_el) for j in range(n): if arr[ind][j]: p = copy.copy(s[j]) q.append(p) sp = {} res = res[1:] res.sort() print(len(res)) for i in res: print(i[0], i[1])
import copy n = int(input()) names_set = set() s = [] arr = [[0 for i in range(n)] for j in range(n)] for i in range(n): el = input().split() names_set.add(el[0]) if el not in s: s.append(el) ind = s.index(el) k = int(input()) for j in range(k): el2 = input().split() if el2 not in s: s.append(el2) ind2 = s.index(el2) arr[ind][ind2] = 184 if i != n - 1: r = input() res = [] q = [] p = copy.copy(s[0]) q.append(p) sp = {} while len(q): el = q[0] del q[0] if el[0] in names_set: try: sp[el[0]] = max(el[1], sp[el[0]]) except: sp[el[0]] = el[1] if not len(q): for i in sp: names_set.remove(i) new_el = [] new_el.append(i) new_el.append(sp[i]) res.append(copy.copy(new_el)) ind = s.index(new_el) for j in range(n): if arr[ind][j]: p = copy.copy(s[j]) q.append(p) sp = {} res = res[1:] res.sort() print(len(res)) for i in res: print(i[0], i[1])
arr[ind][ind2] = 184
20
value
n = int(input()) def is_prime(x): if x == 2: return True if x == 1 or x % 2 == 0: return False i = 3 while i * i <= x: if x % i == 0: return False return True ans = [] for i in range(2, n + 1): if is_prime(i): j = i while j <= n: ans.append(j) j *= i print(len(ans)) print(' '.join(map(str, ans)))
n = int(input()) def is_prime(x): if x == 2: return True if x == 1 or x % 2 == 0: return False i = 3 while i * i <= x: if x % i == 0: return False return True ans = [] for i in range(2, n + 1): if is_prime(i): j = i while j <= n: ans.append(j) z *= i print(len(ans)) print(' '.join(map(str, ans)))
z *= i
20
statement
n = int(input()) def is_prime(x): if x == 2: return True if x == 1 or x % 2 == 0: return False i = 3 while i * i <= x: if x % i == 0: return False return True ans = [] for i in range(2, n + 1): if is_prime(i): j = i while j <= n: ans.append(j) j *= i print(len(ans)) print(' '.join(map(str, ans)))
n = int(input()) def is_prime(x): if x == 2: return True if x == 27 or x % 2 == 0: return False i = 3 while i * i <= x: if x % i == 0: return False return True ans = [] for i in range(2, n + 1): if is_prime(i): j = i while j <= n: ans.append(j) j *= i print(len(ans)) print(' '.join(map(str, ans)))
if x == 27 or x % 2 == 0:
6
value
n = int(input()) def is_prime(x): if x == 2: return True if x == 1 or x % 2 == 0: return False i = 3 while i * i <= x: if x % i == 0: return False return True ans = [] for i in range(2, n + 1): if is_prime(i): j = i while j <= n: ans.append(j) j *= i print(len(ans)) print(' '.join(map(str, ans)))
n = int(input()) def is_prime(x): if x == 2: return True if x == 1 or x % 2 == 0: return False i = 3 while i * x <= x: if x % i == 0: return False return True ans = [] for i in range(2, n + 1): if is_prime(i): j = i while j <= n: ans.append(j) j *= i print(len(ans)) print(' '.join(map(str, ans)))
while i * x <= x:
9
statement