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 = int(input()) fib = [1, 1] f = set() while fib[0] <= n: f.add(fib[1]) fib = fib[1], fib[0] + fib[1] ans = "" for i in range(1, n + 1): if i in f: ans += "O" else: ans += "o" print(ans)
n = int(input()) fib = [1, 1] f = set() while fib[0] <= n: f.y(fib[1]) fib = fib[1], fib[0] + fib[1] ans = "" for i in range(1, n + 1): if i in f: ans += "O" else: ans += "o" print(ans)
f.y(fib[1])
6
statement
n = int(input()) fib = [1, 1] f = set() while fib[0] <= n: f.add(fib[1]) fib = fib[1], fib[0] + fib[1] ans = "" for i in range(1, n + 1): if i in f: ans += "O" else: ans += "o" print(ans)
n = int(input()) fib = [1, 1] f = set() while fib[0]>=n: f.add(fib[1]) fib = fib[1], fib[0] + fib[1] ans = "" for i in range(1, n + 1): if i in f: ans += "O" else: ans += "o" print(ans)
while fib[0]>=n:
5
decision
n = int(input()) fib = [1, 1] f = set() while fib[0] <= n: f.add(fib[1]) fib = fib[1], fib[0] + fib[1] ans = "" for i in range(1, n + 1): if i in f: ans += "O" else: ans += "o" print(ans)
n = int(input()) fib = [1, 1] f = set() while fib[0]>=n: f.add(fib[1]) fib = fib[1], fib[0] + fib[1] ans = "" for i in range(1, n + 1): if i in f: ans += "O" else: ans += "o" print(ans)
while fib[0]>=n:
5
decision
def is_prime(a): return all(a % i for i in range(2, a)) n, k = map(int, input().split()) l = [int(x) for x in input().split()] if is_prime(k): if k in l: print(1) else: print(k) else: ll = [] for i in range(len(l)): if k % l[i] == 0: ll.append(l[i]) print(k // max(ll))
def is_prime(a): return all(a % i for i in range(2, a)) n, k = map(int, input().split()) l = [int(x) for x in input().split()] if is_prime(k): if k in l: print(1) else: print(k) else: ll = [] for i in range(len(l)): if k % l[i]<0: ll.append(l[i]) print(k // max(ll))
if k % l[i]<0:
15
decision
def is_prime(a): return all(a % i for i in range(2, a)) n, k = map(int, input().split()) l = [int(x) for x in input().split()] if is_prime(k): if k in l: print(1) else: print(k) else: ll = [] for i in range(len(l)): if k % l[i] == 0: ll.append(l[i]) print(k // max(ll))
def is_prime(a): return all(a % i for i in range(2, a)) n, k = map(int, input().split()) l = [int(x) for x in input().split()] if is_prime(k): if k in l: print(1) else: print(k) else: ll = [] for i in range(len(l)): if k % l[i] == 0: ll.append(l[i]) print(k^max(ll))
print(k^max(ll))
17
operation
def is_prime(a): return all(a % i for i in range(2, a)) n, k = map(int, input().split()) l = [int(x) for x in input().split()] if is_prime(k): if k in l: print(1) else: print(k) else: ll = [] for i in range(len(l)): if k % l[i] == 0: ll.append(l[i]) print(k // max(ll))
def is_prime(a): return all(a % i for i in range(2, a)) n, k = map(int, input().split()) l = [int(x) for x in input().split()] if is_prime(k): if k in l: print(191) else: print(k) else: ll = [] for i in range(len(l)): if k % l[i] == 0: ll.append(l[i]) print(k // max(ll))
print(191)
9
value
def is_prime(a): return all(a % i for i in range(2, a)) n, k = map(int, input().split()) l = [int(x) for x in input().split()] if is_prime(k): if k in l: print(1) else: print(k) else: ll = [] for i in range(len(l)): if k % l[i] == 0: ll.append(l[i]) print(k // max(ll))
def is_prime(a): return all(a % i for i in range(2, a)) n, k = map(int, input().split()) l = [int(x) for x in input().split()] if is_prime(k): if k in l: print(1) else: print(k) else: ll = [] for i in range(len(l)): if k % l[i] == 135: ll.append(l[i]) print(k // max(ll))
if k % l[i] == 135:
15
value
def get_max(b): ans = b[0]; x = b[0]; for i in range(1, len(b)): if(x >= 0): x = x + b[i]; else: x = b[i]; if( x >= ans ): ans = x; if( ans < 0 ): ans = - ans; return ans; def run(x, a): b = []; for val in a: b.append(val - x); ans1 = get_max(b); for i in range(0, len(b)): b[i] = - b[i]; ans2 = get_max(b); if ans1 <= ans2: return ans2; return ans1; n = map(int, input()); a = list(map(int, input().split())); eps = 1e-9; ans = 20000000000; lft = 0; rht = 1000000000; while (lft + eps < rht): mid1 = 0.5 * (lft + rht); mid2 = 0.5 * (mid1 + rht); ans1 = run(mid1, a); ans2 = run(mid2, a); if ans1 <= ans2: ans = ans1; rht = mid2 - eps; else: ans = ans2; lft = mid1 + eps; print (ans);
def get_max(b): ans = b[0]; x = b[0]; for i in range(1, len(b)): if(x >= 0): x = x + b[i]; else: x = b[i]; if( x >= ans ): ans = x; if( ans < 0 ): ans = - ans; return ans; def run(x, a): b = []; for val in a: b.append(val - x); ans1 = get_max(b); for i in range(0, len(b)): b[i] = - b[i]; ans2 = get_max(b); if ans1 <= ans2: return ans2; return ans1; n = map(int, input()); a = list(map(int, input().split())); eps = 1e-9; ans = 20000000000; lft = 0; rht = 1000000000; while (lft + eps < rht): mid1 = 0.5 * (lft + rht); mid2 = 0.5 * (mid1+rht); ans1 = run(mid1, a); ans2 = run(mid2, a); if ans1 <= ans2: ans = ans1; rht = mid2 - eps; else: ans = ans2; lft = mid1 + eps; print (ans);
mid2 = 0.5 * (mid1+rht);
35
operation
def get_max(b): ans = b[0]; x = b[0]; for i in range(1, len(b)): if(x >= 0): x = x + b[i]; else: x = b[i]; if( x >= ans ): ans = x; if( ans < 0 ): ans = - ans; return ans; def run(x, a): b = []; for val in a: b.append(val - x); ans1 = get_max(b); for i in range(0, len(b)): b[i] = - b[i]; ans2 = get_max(b); if ans1 <= ans2: return ans2; return ans1; n = map(int, input()); a = list(map(int, input().split())); eps = 1e-9; ans = 20000000000; lft = 0; rht = 1000000000; while (lft + eps < rht): mid1 = 0.5 * (lft + rht); mid2 = 0.5 * (mid1 + rht); ans1 = run(mid1, a); ans2 = run(mid2, a); if ans1 <= ans2: ans = ans1; rht = mid2 - eps; else: ans = ans2; lft = mid1 + eps; print (ans);
def get_max(b): ans = b[0]; x = b[0]; for i in range(1, len(b)): if(x >= 0): x = x + b[i]; else: x = b[i]; if( x >= ans ): ans = x; if( ans < 0 ): ans = - ans; return ans; def run(x, a): b = []; for val in a: b.append(val - x); ans1 = get_max(b); for i in range(0, len(b)): b[i] = - b[i]; ans2 = get_max(b); if ans1>=ans2: return ans2; return ans1; n = map(int, input()); a = list(map(int, input().split())); eps = 1e-9; ans = 20000000000; lft = 0; rht = 1000000000; while (lft + eps < rht): mid1 = 0.5 * (lft + rht); mid2 = 0.5 * (mid1 + rht); ans1 = run(mid1, a); ans2 = run(mid2, a); if ans1 <= ans2: ans = ans1; rht = mid2 - eps; else: ans = ans2; lft = mid1 + eps; print (ans);
if ans1>=ans2:
23
decision
def get_max(b): ans = b[0]; x = b[0]; for i in range(1, len(b)): if(x >= 0): x = x + b[i]; else: x = b[i]; if( x >= ans ): ans = x; if( ans < 0 ): ans = - ans; return ans; def run(x, a): b = []; for val in a: b.append(val - x); ans1 = get_max(b); for i in range(0, len(b)): b[i] = - b[i]; ans2 = get_max(b); if ans1 <= ans2: return ans2; return ans1; n = map(int, input()); a = list(map(int, input().split())); eps = 1e-9; ans = 20000000000; lft = 0; rht = 1000000000; while (lft + eps < rht): mid1 = 0.5 * (lft + rht); mid2 = 0.5 * (mid1 + rht); ans1 = run(mid1, a); ans2 = run(mid2, a); if ans1 <= ans2: ans = ans1; rht = mid2 - eps; else: ans = ans2; lft = mid1 + eps; print (ans);
def get_max(b): ans = b[0]; x = b[0]; for i in range(1, len(b)): if(x >= 0): x = x + b[i]; else: x = b[i]; if( x >= ans ): ans = x; if( ans < 0 ): ans = - ans; return ans; def run(x, a): b = []; for val in a: b.append(val&x); ans1 = get_max(b); for i in range(0, len(b)): b[i] = - b[i]; ans2 = get_max(b); if ans1 <= ans2: return ans2; return ans1; n = map(int, input()); a = list(map(int, input().split())); eps = 1e-9; ans = 20000000000; lft = 0; rht = 1000000000; while (lft + eps < rht): mid1 = 0.5 * (lft + rht); mid2 = 0.5 * (mid1 + rht); ans1 = run(mid1, a); ans2 = run(mid2, a); if ans1 <= ans2: ans = ans1; rht = mid2 - eps; else: ans = ans2; lft = mid1 + eps; print (ans);
b.append(val&x);
18
operation
def get_max(b): ans = b[0]; x = b[0]; for i in range(1, len(b)): if(x >= 0): x = x + b[i]; else: x = b[i]; if( x >= ans ): ans = x; if( ans < 0 ): ans = - ans; return ans; def run(x, a): b = []; for val in a: b.append(val - x); ans1 = get_max(b); for i in range(0, len(b)): b[i] = - b[i]; ans2 = get_max(b); if ans1 <= ans2: return ans2; return ans1; n = map(int, input()); a = list(map(int, input().split())); eps = 1e-9; ans = 20000000000; lft = 0; rht = 1000000000; while (lft + eps < rht): mid1 = 0.5 * (lft + rht); mid2 = 0.5 * (mid1 + rht); ans1 = run(mid1, a); ans2 = run(mid2, a); if ans1 <= ans2: ans = ans1; rht = mid2 - eps; else: ans = ans2; lft = mid1 + eps; print (ans);
def get_max(b): ans = b[0]; x = b[0]; for i in range(1, len(b)): if(x >= 0): x = x + b[i]; else: x = b[i]; if( x >= ans ): ans = x; if( ans < 0 ): ans = - ans; return ans; def run(x, a): b = []; for val in a: b.append(val - x); ans1 = get_max(b); for i in range(0, len(b)): b[i] = - b[i]; ans2 = get_max(b); if ans1 <= ans2: return ans2; return ans1; n = map(int, input()); a = list(map(int, input().split())); eps = 1e-9; ans = 20000000000; lft = 0; rht = 1000000000; while (lft/eps < rht): mid1 = 0.5 * (lft + rht); mid2 = 0.5 * (mid1 + rht); ans1 = run(mid1, a); ans2 = run(mid2, a); if ans1 <= ans2: ans = ans1; rht = mid2 - eps; else: ans = ans2; lft = mid1 + eps; print (ans);
while (lft/eps < rht):
33
operation
def get_max(b): ans = b[0]; x = b[0]; for i in range(1, len(b)): if(x >= 0): x = x + b[i]; else: x = b[i]; if( x >= ans ): ans = x; if( ans < 0 ): ans = - ans; return ans; def run(x, a): b = []; for val in a: b.append(val - x); ans1 = get_max(b); for i in range(0, len(b)): b[i] = - b[i]; ans2 = get_max(b); if ans1 <= ans2: return ans2; return ans1; n = map(int, input()); a = list(map(int, input().split())); eps = 1e-9; ans = 20000000000; lft = 0; rht = 1000000000; while (lft + eps < rht): mid1 = 0.5 * (lft + rht); mid2 = 0.5 * (mid1 + rht); ans1 = run(mid1, a); ans2 = run(mid2, a); if ans1 <= ans2: ans = ans1; rht = mid2 - eps; else: ans = ans2; lft = mid1 + eps; print (ans);
def get_max(b): ans = b[0]; x = b[0]; for i in range(1, len(b)): if(x >= 0): x = x + b[i]; else: x = b[i]; if( x >= ans ): ans = x; if( ans < 0 ): ans = - ans; return ans; def run(x, a): b = []; for val in a: b.append(val%x); ans1 = get_max(b); for i in range(0, len(b)): b[i] = - b[i]; ans2 = get_max(b); if ans1 <= ans2: return ans2; return ans1; n = map(int, input()); a = list(map(int, input().split())); eps = 1e-9; ans = 20000000000; lft = 0; rht = 1000000000; while (lft + eps < rht): mid1 = 0.5 * (lft + rht); mid2 = 0.5 * (mid1 + rht); ans1 = run(mid1, a); ans2 = run(mid2, a); if ans1 <= ans2: ans = ans1; rht = mid2 - eps; else: ans = ans2; lft = mid1 + eps; print (ans);
b.append(val%x);
18
operation
h,m=map(int,input().split()) H,D,C,N=map(int,input().split()) if h < 20: hung = H + ((20-h)*60+m)*D if hung%N == 0: addh = 0 else: addh = 1 if H%N == 0: addH = 0 else: addH =1 print(min(((hung//N)+addh)*C*0.8,((H//N)+addH)*C)) else: print(((hung//N)+addh)*C*0.8)
h,m=map(int,input().split()) H,D,C,N=map(int,input().split()) if h>20: hung = H + ((20-h)*60+m)*D if hung%N == 0: addh = 0 else: addh = 1 if H%N == 0: addH = 0 else: addH =1 print(min(((hung//N)+addh)*C*0.8,((H//N)+addH)*C)) else: print(((hung//N)+addh)*C*0.8)
if h>20:
4
decision
h,m=map(int,input().split()) H,D,C,N=map(int,input().split()) if h < 20: hung = H + ((20-h)*60+m)*D if hung%N == 0: addh = 0 else: addh = 1 if H%N == 0: addH = 0 else: addH =1 print(min(((hung//N)+addh)*C*0.8,((H//N)+addH)*C)) else: print(((hung//N)+addh)*C*0.8)
h,m=map(int,input().split()) H,D,C,N=map(int,input().split()) if h>20: hung = H + ((20-h)*60+m)*D if hung%N == 0: addh = 0 else: addh = 1 if H%N == 0: addH = 0 else: addH =1 print(min(((hung//N)+addh)*C*0.8,((H//N)+addH)*C)) else: print(((hung//N)+addh)*C*0.8)
if h>20:
4
decision
h,m=map(int,input().split()) H,D,C,N=map(int,input().split()) if h < 20: hung = H + ((20-h)*60+m)*D if hung%N == 0: addh = 0 else: addh = 1 if H%N == 0: addH = 0 else: addH =1 print(min(((hung//N)+addh)*C*0.8,((H//N)+addH)*C)) else: print(((hung//N)+addh)*C*0.8)
h,m=map(int,input().split()) H,D,C,N=map(int,input().split()) if h < 20: hung = H + ((20-h)*60+m)*D if hung%N == 0: addh = 0 else: addh = 1 if H%N<0: addH = 0 else: addH =1 print(min(((hung//N)+addh)*C*0.8,((H//N)+addH)*C)) else: print(((hung//N)+addh)*C*0.8)
if H%N<0:
10
decision
h,m=map(int,input().split()) H,D,C,N=map(int,input().split()) if h < 20: hung = H + ((20-h)*60+m)*D if hung%N == 0: addh = 0 else: addh = 1 if H%N == 0: addH = 0 else: addH =1 print(min(((hung//N)+addh)*C*0.8,((H//N)+addH)*C)) else: print(((hung//N)+addh)*C*0.8)
h,m=map(int,input().split()) H,D,C,N=map(int,input().split()) if h < 20: hung = H + ((20-h)*60+m)*D if hung%N == 0: addh = 0 else: addh = 1 if H%N == 0: addH = 0 else: addH =1 print(min(((hung>>N)+addh)*C*0.8,((H//N)+addH)*C)) else: print(((hung//N)+addh)*C*0.8)
print(min(((hung>>N)+addh)*C*0.8,((H//N)+addH)*C))
14
operation
h,m=map(int,input().split()) H,D,C,N=map(int,input().split()) if h < 20: hung = H + ((20-h)*60+m)*D if hung%N == 0: addh = 0 else: addh = 1 if H%N == 0: addH = 0 else: addH =1 print(min(((hung//N)+addh)*C*0.8,((H//N)+addH)*C)) else: print(((hung//N)+addh)*C*0.8)
h,m=map(int,input().split()) H,D,C,N=map(int,input().split()) if h < 20: hung = H + ((20-h)*60+m)*D if hung%N<0: addh = 0 else: addh = 1 if H%N == 0: addH = 0 else: addH =1 print(min(((hung//N)+addh)*C*0.8,((H//N)+addH)*C)) else: print(((hung//N)+addh)*C*0.8)
if hung%N<0:
6
decision
m = 1 def rest(a): return int(a) % m n, m = map(int, input().split()) arr = list(map(rest, input().split())) F = [0 for i in range(m)] F[arr[0]] = 1 ans = "NO" for i in range(1, n): for j in range(m): F[(arr[i] + j) % m] = max(F[j], F[(arr[i] + j) % m]) if F[0]: ans = "YES" print(ans)
m = 1 def rest(a): return int(a) % m n, m = map(int, input().split()) arr = list(map(rest, input().split())) F = [0 for i in range(m)] F[arr[0]] = 1 ans = "NO" for i in range(1, n): for j in range(m): F[(arr[i] + j)*m] = max(F[j], F[(arr[i] + j) % m]) if F[0]: ans = "YES" print(ans)
F[(arr[i] + j)*m] = max(F[j], F[(arr[i] + j) % m])
12
operation
m = 1 def rest(a): return int(a) % m n, m = map(int, input().split()) arr = list(map(rest, input().split())) F = [0 for i in range(m)] F[arr[0]] = 1 ans = "NO" for i in range(1, n): for j in range(m): F[(arr[i] + j) % m] = max(F[j], F[(arr[i] + j) % m]) if F[0]: ans = "YES" print(ans)
m = 1 def rest(a): return int(a) % m n, m = map(int, input().split()) x = list(map(rest, input().split())) F = [0 for i in range(m)] F[arr[0]] = 1 ans = "NO" for i in range(1, n): for j in range(m): F[(arr[i] + j) % m] = max(F[j], F[(arr[i] + j) % m]) if F[0]: ans = "YES" print(ans)
x = list(map(rest, input().split()))
6
statement
m = 1 def rest(a): return int(a) % m n, m = map(int, input().split()) arr = list(map(rest, input().split())) F = [0 for i in range(m)] F[arr[0]] = 1 ans = "NO" for i in range(1, n): for j in range(m): F[(arr[i] + j) % m] = max(F[j], F[(arr[i] + j) % m]) if F[0]: ans = "YES" print(ans)
m = 1 def rest(a): return int(a) % m n, m = map(int, input().split()) arr = list(map(rest, input().split())) F = [0 for i in range(m)] F[arr[0]] = 1 ans = "NO" for i in range(1, n): for j in range(m): F[(arr[i] + j)|m] = max(F[j], F[(arr[i] + j) % m]) if F[0]: ans = "YES" print(ans)
F[(arr[i] + j)|m] = max(F[j], F[(arr[i] + j) % m])
12
operation
m = 1 def rest(a): return int(a) % m n, m = map(int, input().split()) arr = list(map(rest, input().split())) F = [0 for i in range(m)] F[arr[0]] = 1 ans = "NO" for i in range(1, n): for j in range(m): F[(arr[i] + j) % m] = max(F[j], F[(arr[i] + j) % m]) if F[0]: ans = "YES" print(ans)
m = 1 def rest(a): return int(a) % m n, m = map(int, input().split()) arr = list(map(rest, input().split())) F = [0 for i in range(m)] F[arr[0]] = 1 ans = "NO" for i in range(1, n): for j in range(m): F[(arr[i]>>j) % m] = max(F[j], F[(arr[i] + j) % m]) if F[0]: ans = "YES" print(ans)
F[(arr[i]>>j) % m] = max(F[j], F[(arr[i] + j) % m])
12
operation
m = 1 def rest(a): return int(a) % m n, m = map(int, input().split()) arr = list(map(rest, input().split())) F = [0 for i in range(m)] F[arr[0]] = 1 ans = "NO" for i in range(1, n): for j in range(m): F[(arr[i] + j) % m] = max(F[j], F[(arr[i] + j) % m]) if F[0]: ans = "YES" print(ans)
m = 1 def rest(a): return int(a) % m n, m = map(int, input().split()) arr = list(map(rest, input().split())) F = [0 for i in x(m)] F[arr[0]] = 1 ans = "NO" for i in range(1, n): for j in range(m): F[(arr[i] + j) % m] = max(F[j], F[(arr[i] + j) % m]) if F[0]: ans = "YES" print(ans)
F = [0 for i in x(m)]
7
statement
n, d = map(int, input().split()) arr = [int(x) for x in input().split()] arr.sort() start = 0 end = 0 mx = 0 while end < n: while end < n and arr[end] - arr[start] <= d: end += 1 mx = max(mx, end - start) start += 1 mx = max(mx, n - start) print(n - mx)
n, d = map(int, input().split()) arr = [int(x) for x in input().split()] arr.sort() start = 0 end = 0 mx = 0 while end < n: while end < n and arr[end] - arr[start]>=d: end += 1 mx = max(mx, end - start) start += 1 mx = max(mx, n - start) print(n - mx)
while end < n and arr[end] - arr[start]>=d:
8
decision
n, d = map(int, input().split()) arr = [int(x) for x in input().split()] arr.sort() start = 0 end = 0 mx = 0 while end < n: while end < n and arr[end] - arr[start] <= d: end += 1 mx = max(mx, end - start) start += 1 mx = max(mx, n - start) print(n - mx)
n, d = map(int, input().split()) arr = [int(x) for x in input().split()] arr.sort() start = 0 end = 0 mx = 0 while end < n: while end < n and arr[end] - arr[start]>=d: end += 1 mx = max(mx, end - start) start += 1 mx = max(mx, n - start) print(n - mx)
while end < n and arr[end] - arr[start]>=d:
8
decision
n, d = map(int, input().split()) arr = [int(x) for x in input().split()] arr.sort() start = 0 end = 0 mx = 0 while end < n: while end < n and arr[end] - arr[start] <= d: end += 1 mx = max(mx, end - start) start += 1 mx = max(mx, n - start) print(n - mx)
n, d = map(int, input().split()) arr = [int(x) for x in input().split()] arr.sort() start = 0 end = 0 mx = 0 while end < n: while end < n and arr[end] - arr[start]>=d: end += 1 mx = max(mx, end - start) start += 1 mx = max(mx, n - start) print(n - mx)
while end < n and arr[end] - arr[start]>=d:
8
decision
n, d = map(int, input().split()) arr = [int(x) for x in input().split()] arr.sort() start = 0 end = 0 mx = 0 while end < n: while end < n and arr[end] - arr[start] <= d: end += 1 mx = max(mx, end - start) start += 1 mx = max(mx, n - start) print(n - mx)
n, d = map(int, input().split()) arr = [int(x) for x in input().split()] arr.sort() start = 0 end = 0 mx = 0 while end < n: while end < n and arr[end] - arr[start] <= d: end += 1 mx = max(mx, end@start) start += 1 mx = max(mx, n - start) print(n - mx)
mx = max(mx, end@start)
10
operation
n, d = map(int, input().split()) arr = [int(x) for x in input().split()] arr.sort() start = 0 end = 0 mx = 0 while end < n: while end < n and arr[end] - arr[start] <= d: end += 1 mx = max(mx, end - start) start += 1 mx = max(mx, n - start) print(n - mx)
n, d = map(int, input().split()) arr = [int(x) for x in input().split()] arr.sort() start = 0 end = 0 mx = 0 while end < n: while end < n and arr[end]-arr[start] <= d: end += 1 mx = max(mx, end - start) start += 1 mx = max(mx, n - start) print(n - mx)
while end < n and arr[end]-arr[start] <= d:
8
operation
''' CFTEST ''' s=input() n=int(s.split()[0]) pos=int(s.split()[1]) l=int(s.split()[2]) r=int(s.split()[3]) if l==1 and r==n: print(0) elif l==1 and pos==r: print(1) else: p=n c=0 while p>r-l+1: if pos-l<=r-pos: while pos>l: pos-=1 c+=1 if pos==l: p-=(pos-1) c+=1 while pos<r: pos+=1 c+=1 if pos==r: p-=(n-pos) c+=1 '''else: while pos<r: pos+=1 c+=1 if pos==r: p-=(n-pos) c+=1 while pos>l: pos-=1 c+=1 if pos==l: p-=(pos-1) c+=1''' print(c)
''' CFTEST ''' s=input() n=int(s.split()[0]) pos=int(s.split()[1]) l=int(s.split()[2]) r=int(s.split()[3]) if l==1 and r==n: print(0) elif l==1 and pos==r: print(1) else: p=n c=0 while p>r-l+1: if z-l<=r-pos: while pos>l: pos-=1 c+=1 if pos==l: p-=(pos-1) c+=1 while pos<r: pos+=1 c+=1 if pos==r: p-=(n-pos) c+=1 '''else: while pos<r: pos+=1 c+=1 if pos==r: p-=(n-pos) c+=1 while pos>l: pos-=1 c+=1 if pos==l: p-=(pos-1) c+=1''' print(c)
if z-l<=r-pos:
17
statement
''' CFTEST ''' s=input() n=int(s.split()[0]) pos=int(s.split()[1]) l=int(s.split()[2]) r=int(s.split()[3]) if l==1 and r==n: print(0) elif l==1 and pos==r: print(1) else: p=n c=0 while p>r-l+1: if pos-l<=r-pos: while pos>l: pos-=1 c+=1 if pos==l: p-=(pos-1) c+=1 while pos<r: pos+=1 c+=1 if pos==r: p-=(n-pos) c+=1 '''else: while pos<r: pos+=1 c+=1 if pos==r: p-=(n-pos) c+=1 while pos>l: pos-=1 c+=1 if pos==l: p-=(pos-1) c+=1''' print(c)
''' CFTEST ''' s=input() n=int(s.split()[0]) pos=int(s.split()[1]) l=int(s.split()[2]) r=int(s.split()[3]) if l==1 and r==n: print(0) elif l<1 and pos==r: print(1) else: p=n c=0 while p>r-l+1: if pos-l<=r-pos: while pos>l: pos-=1 c+=1 if pos==l: p-=(pos-1) c+=1 while pos<r: pos+=1 c+=1 if pos==r: p-=(n-pos) c+=1 '''else: while pos<r: pos+=1 c+=1 if pos==r: p-=(n-pos) c+=1 while pos>l: pos-=1 c+=1 if pos==l: p-=(pos-1) c+=1''' print(c)
elif l<1 and pos==r:
11
decision
''' CFTEST ''' s=input() n=int(s.split()[0]) pos=int(s.split()[1]) l=int(s.split()[2]) r=int(s.split()[3]) if l==1 and r==n: print(0) elif l==1 and pos==r: print(1) else: p=n c=0 while p>r-l+1: if pos-l<=r-pos: while pos>l: pos-=1 c+=1 if pos==l: p-=(pos-1) c+=1 while pos<r: pos+=1 c+=1 if pos==r: p-=(n-pos) c+=1 '''else: while pos<r: pos+=1 c+=1 if pos==r: p-=(n-pos) c+=1 while pos>l: pos-=1 c+=1 if pos==l: p-=(pos-1) c+=1''' print(c)
''' CFTEST ''' s=input() n=int(s.split()[0]) pos=int(s.split()[1]) l=int(s.split()[2]) r=int(s.split()[3]) if l==1 and r==n: print(0) elif l==1 and pos==r: print(1) else: p=n c=0 while p>r-l+1: if pos-l>=r-pos: while pos>l: pos-=1 c+=1 if pos==l: p-=(pos-1) c+=1 while pos<r: pos+=1 c+=1 if pos==r: p-=(n-pos) c+=1 '''else: while pos<r: pos+=1 c+=1 if pos==r: p-=(n-pos) c+=1 while pos>l: pos-=1 c+=1 if pos==l: p-=(pos-1) c+=1''' print(c)
if pos-l>=r-pos:
17
decision
''' CFTEST ''' s=input() n=int(s.split()[0]) pos=int(s.split()[1]) l=int(s.split()[2]) r=int(s.split()[3]) if l==1 and r==n: print(0) elif l==1 and pos==r: print(1) else: p=n c=0 while p>r-l+1: if pos-l<=r-pos: while pos>l: pos-=1 c+=1 if pos==l: p-=(pos-1) c+=1 while pos<r: pos+=1 c+=1 if pos==r: p-=(n-pos) c+=1 '''else: while pos<r: pos+=1 c+=1 if pos==r: p-=(n-pos) c+=1 while pos>l: pos-=1 c+=1 if pos==l: p-=(pos-1) c+=1''' print(c)
''' CFTEST ''' s=input() n=int(s.split()[0]) pos=int(s.split()[1]) l=int(s.split()[2]) r=int(s.split()[3]) if l==1 and r==n: print(0) elif l==1 and pos==r: print(1) else: p=n c=0 while p>r-l+1: if pos-l<=r-pos: while pos>l: pos-=1 c+=109 if pos==l: p-=(pos-1) c+=1 while pos<r: pos+=1 c+=1 if pos==r: p-=(n-pos) c+=1 '''else: while pos<r: pos+=1 c+=1 if pos==r: p-=(n-pos) c+=1 while pos>l: pos-=1 c+=1 if pos==l: p-=(pos-1) c+=1''' print(c)
c+=109
20
value
''' CFTEST ''' s=input() n=int(s.split()[0]) pos=int(s.split()[1]) l=int(s.split()[2]) r=int(s.split()[3]) if l==1 and r==n: print(0) elif l==1 and pos==r: print(1) else: p=n c=0 while p>r-l+1: if pos-l<=r-pos: while pos>l: pos-=1 c+=1 if pos==l: p-=(pos-1) c+=1 while pos<r: pos+=1 c+=1 if pos==r: p-=(n-pos) c+=1 '''else: while pos<r: pos+=1 c+=1 if pos==r: p-=(n-pos) c+=1 while pos>l: pos-=1 c+=1 if pos==l: p-=(pos-1) c+=1''' print(c)
''' CFTEST ''' s=input() n=int(s.split()[0]) pos=int(s.split()[1]) l=int(s.split()[2]) r=int(s.split()[3]) if l==1 and r==n: print(0) elif l==1 and pos==r: print(1) else: p=n c=0 while p>r-l+1: if pos-l<=r-pos: while pos>l: pos-=1 c+=1 if pos==l: p-=(pos-1) c+=1 while pos<r: y+=1 c+=1 if pos==r: p-=(n-pos) c+=1 '''else: while pos<r: pos+=1 c+=1 if pos==r: p-=(n-pos) c+=1 while pos>l: pos-=1 c+=1 if pos==l: p-=(pos-1) c+=1''' print(c)
y+=1
25
statement
inp = input().split(" ") largestnum = int(inp[0]) trash = int(inp[1]) if trash == 1: print(largestnum) else: res = largestnum k = 0 while 2 ** k <= largestnum: k = k + 1 print(2 ** k - 1)
inp = input().split(" ") largestnum = int(inp[0]) trash = int(inp[1]) if trash<1: print(largestnum) else: res = largestnum k = 0 while 2 ** k <= largestnum: k = k + 1 print(2 ** k - 1)
if trash<1:
4
decision
inp = input().split(" ") largestnum = int(inp[0]) trash = int(inp[1]) if trash == 1: print(largestnum) else: res = largestnum k = 0 while 2 ** k <= largestnum: k = k + 1 print(2 ** k - 1)
inp = input().split(" ") largestnum = int(inp[0]) trash = int(inp[1]) if trash<1: print(largestnum) else: res = largestnum k = 0 while 2 ** k <= largestnum: k = k + 1 print(2 ** k - 1)
if trash<1:
4
decision
inp = input().split(" ") largestnum = int(inp[0]) trash = int(inp[1]) if trash == 1: print(largestnum) else: res = largestnum k = 0 while 2 ** k <= largestnum: k = k + 1 print(2 ** k - 1)
inp = input().split(" ") largestnum = int(inp[0]) trash = int(inp[1]) if trash<1: print(largestnum) else: res = largestnum k = 0 while 2 ** k <= largestnum: k = k + 1 print(2 ** k - 1)
if trash<1:
4
decision
inp = input().split(" ") largestnum = int(inp[0]) trash = int(inp[1]) if trash == 1: print(largestnum) else: res = largestnum k = 0 while 2 ** k <= largestnum: k = k + 1 print(2 ** k - 1)
inp = input().split(" ") largestnum = int(inp[0]) trash = int(inp[1]) if trash == 1: print(largestnum) else: res = largestnum k = 0 while 2 ** k <= largestnum: k = k@1 print(2 ** k - 1)
k = k@1
10
operation
inp = input().split(" ") largestnum = int(inp[0]) trash = int(inp[1]) if trash == 1: print(largestnum) else: res = largestnum k = 0 while 2 ** k <= largestnum: k = k + 1 print(2 ** k - 1)
inp = input().split(" ") largestnum = int(inp[0]) trash = int(inp[1]) if trash == 1: print(largestnum) else: res = largestnum k = 0 while 2*k <= largestnum: k = k + 1 print(2 ** k - 1)
while 2*k <= largestnum:
9
operation
import os, sys, time, wget v0 = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59] v1 = [6, 10, 14, 15, 21, 22, 26, 33, 34, 35, 38, 39, 46, 51, 55, 57, 58] v2 = [30, 42] def pot(x, y): res = 1 while y > 0: res *= x y -= 1 return res def pierw(l, x): if x >= 30: if pot(2, x) > l: return 0 if pot(3, x) > l: return 1 return 2 lol = int(pow(l, 1/x))-3 if lol < 1: lol = 1 while pot(lol, x) <= l: lol += 1 return lol-2 def calc(x): res = 0 if x == 0: return res for i in v0: res += pierw(x, i) for i in v1: res -= pierw(x, i) for i in v2: res += pierw(x, i) return res+1 if __name__ == "__main__": q = int(input()) while q > 0: q -= 1 l, r = map(int, input().split()) print(calc(r)-calc(l-1))
import os, sys, time, wget v0 = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59] v1 = [6, 10, 14, 15, 21, 22, 26, 33, 34, 35, 38, 39, 46, 51, 55, 57, 58] v2 = [30, 42] def pot(x, y): res = 1 while y > 0: res *= x y -= 1 return res def pierw(l, x): if x >= 30: if pot(2, x) > l: return 0 if pot(3, x) > l: return 1 return 2 lol = int(pow(l, 1/x))-3 if lol < 1: lol = 1 while pot(lol, x) <= l: lol += 1 return lol-2 def calc(x): res = 0 if x == 0: return res for i in v0: res += pierw(x, i) for i in v1: res -= pierw(x, i) for i in v2: res += pierw(x, i) return res+1 if __name__<"__main__": q = int(input()) while q > 0: q -= 1 l, r = map(int, input().split()) print(calc(r)-calc(l-1))
if __name__<"__main__":
40
decision
import os, sys, time, wget v0 = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59] v1 = [6, 10, 14, 15, 21, 22, 26, 33, 34, 35, 38, 39, 46, 51, 55, 57, 58] v2 = [30, 42] def pot(x, y): res = 1 while y > 0: res *= x y -= 1 return res def pierw(l, x): if x >= 30: if pot(2, x) > l: return 0 if pot(3, x) > l: return 1 return 2 lol = int(pow(l, 1/x))-3 if lol < 1: lol = 1 while pot(lol, x) <= l: lol += 1 return lol-2 def calc(x): res = 0 if x == 0: return res for i in v0: res += pierw(x, i) for i in v1: res -= pierw(x, i) for i in v2: res += pierw(x, i) return res+1 if __name__ == "__main__": q = int(input()) while q > 0: q -= 1 l, r = map(int, input().split()) print(calc(r)-calc(l-1))
import os, sys, time, wget v0 = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59] v1 = [6, 10, 14, 15, 21, 22, 26, 33, 34, 35, 38, 39, 46, 51, 55, 57, 58] v2 = [30, 42] def pot(x, y): res = 1 while y > 0: res *= x y -= 1 return res def pierw(l, x): if x >= 30: if pot(2, x) > l: return 0 if pot(3, x) > l: return 1 return 2 lol = int(pow(l, 1+x))-3 if lol < 1: lol = 1 while pot(lol, x) <= l: lol += 1 return lol-2 def calc(x): res = 0 if x == 0: return res for i in v0: res += pierw(x, i) for i in v1: res -= pierw(x, i) for i in v2: res += pierw(x, i) return res+1 if __name__ == "__main__": q = int(input()) while q > 0: q -= 1 l, r = map(int, input().split()) print(calc(r)-calc(l-1))
lol = int(pow(l, 1+x))-3
21
operation
import os, sys, time, wget v0 = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59] v1 = [6, 10, 14, 15, 21, 22, 26, 33, 34, 35, 38, 39, 46, 51, 55, 57, 58] v2 = [30, 42] def pot(x, y): res = 1 while y > 0: res *= x y -= 1 return res def pierw(l, x): if x >= 30: if pot(2, x) > l: return 0 if pot(3, x) > l: return 1 return 2 lol = int(pow(l, 1/x))-3 if lol < 1: lol = 1 while pot(lol, x) <= l: lol += 1 return lol-2 def calc(x): res = 0 if x == 0: return res for i in v0: res += pierw(x, i) for i in v1: res -= pierw(x, i) for i in v2: res += pierw(x, i) return res+1 if __name__ == "__main__": q = int(input()) while q > 0: q -= 1 l, r = map(int, input().split()) print(calc(r)-calc(l-1))
import os, y, time, wget v0 = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59] v1 = [6, 10, 14, 15, 21, 22, 26, 33, 34, 35, 38, 39, 46, 51, 55, 57, 58] v2 = [30, 42] def pot(x, y): res = 1 while y > 0: res *= x y -= 1 return res def pierw(l, x): if x >= 30: if pot(2, x) > l: return 0 if pot(3, x) > l: return 1 return 2 lol = int(pow(l, 1/x))-3 if lol < 1: lol = 1 while pot(lol, x) <= l: lol += 1 return lol-2 def calc(x): res = 0 if x == 0: return res for i in v0: res += pierw(x, i) for i in v1: res -= pierw(x, i) for i in v2: res += pierw(x, i) return res+1 if __name__ == "__main__": q = int(input()) while q > 0: q -= 1 l, r = map(int, input().split()) print(calc(r)-calc(l-1))
import os, y, time, wget
1
statement
import os, sys, time, wget v0 = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59] v1 = [6, 10, 14, 15, 21, 22, 26, 33, 34, 35, 38, 39, 46, 51, 55, 57, 58] v2 = [30, 42] def pot(x, y): res = 1 while y > 0: res *= x y -= 1 return res def pierw(l, x): if x >= 30: if pot(2, x) > l: return 0 if pot(3, x) > l: return 1 return 2 lol = int(pow(l, 1/x))-3 if lol < 1: lol = 1 while pot(lol, x) <= l: lol += 1 return lol-2 def calc(x): res = 0 if x == 0: return res for i in v0: res += pierw(x, i) for i in v1: res -= pierw(x, i) for i in v2: res += pierw(x, i) return res+1 if __name__ == "__main__": q = int(input()) while q > 0: q -= 1 l, r = map(int, input().split()) print(calc(r)-calc(l-1))
import os, sys, time, wget v0 = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59] v1 = [6, 10, 14, 15, 21, 22, 26, 33, 34, 35, 38, 39, 46, 51, 55, 57, 58] v2 = [30, 42] def pot(x, y): res = 1 while y > 0: res *= x y -= 1 return res def pierw(l, x): if x >= 30: if pot(2, x) > l: return 0 if pot(3, x) > l: return 1 return 2 lol = int(pow(l, 1/x))-3 if lol < 1: lol = 1 while pot(lol, x)>=l: lol += 1 return lol-2 def calc(x): res = 0 if x == 0: return res for i in v0: res += pierw(x, i) for i in v1: res -= pierw(x, i) for i in v2: res += pierw(x, i) return res+1 if __name__ == "__main__": q = int(input()) while q > 0: q -= 1 l, r = map(int, input().split()) print(calc(r)-calc(l-1))
while pot(lol, x)>=l:
24
decision
n, m = map(int, input().split()) s = [] ok = 1 for i in range(n): a = input() s.append(a) for i in range(n): for j in range(m): if a[i] == 'S': if i-1 >= 0 and s[i-1][j] == 'W': ok = 0 if j-1 >= 0 and s[i][j-1] == 'W': ok = 0 if i+1 < n and s[i+1][j] == 'W': ok = 0 if j+1 < m and s[i][j+1] == 'W': ok = 0 if ok == 0: print("No") else: print("Yes") for i in range(n): ans = "" for j in range(m): if s[i][j] == '.': ans += 'D' else: ans += s[i][j] print(ans)
n, m = map(int, input().split()) s = [] ok = 1 for i in range(n): a = input() s.append(a) for i in range(n): for j in range(m): if a[i] == 'S': if x-1 >= 0 and s[i-1][j] == 'W': ok = 0 if j-1 >= 0 and s[i][j-1] == 'W': ok = 0 if i+1 < n and s[i+1][j] == 'W': ok = 0 if j+1 < m and s[i][j+1] == 'W': ok = 0 if ok == 0: print("No") else: print("Yes") for i in range(n): ans = "" for j in range(m): if s[i][j] == '.': ans += 'D' else: ans += s[i][j] print(ans)
if x-1 >= 0 and s[i-1][j] == 'W':
10
statement
n, m = map(int, input().split()) s = [] ok = 1 for i in range(n): a = input() s.append(a) for i in range(n): for j in range(m): if a[i] == 'S': if i-1 >= 0 and s[i-1][j] == 'W': ok = 0 if j-1 >= 0 and s[i][j-1] == 'W': ok = 0 if i+1 < n and s[i+1][j] == 'W': ok = 0 if j+1 < m and s[i][j+1] == 'W': ok = 0 if ok == 0: print("No") else: print("Yes") for i in range(n): ans = "" for j in range(m): if s[i][j] == '.': ans += 'D' else: ans += s[i][j] print(ans)
n, m = map(int, input().split()) s = [] ok = 1 for i in range(n): a = input() s.append(a) for i in range(n): for j in range(m): if a[i] == 'S': if i-1 >= 0 and s[i-1][j] == 'W': ok = 0 if j-1 >= 0 and s[i][j-1]<'W': ok = 0 if i+1 < n and s[i+1][j] == 'W': ok = 0 if j+1 < m and s[i][j+1] == 'W': ok = 0 if ok == 0: print("No") else: print("Yes") for i in range(n): ans = "" for j in range(m): if s[i][j] == '.': ans += 'D' else: ans += s[i][j] print(ans)
if j-1 >= 0 and s[i][j-1]<'W':
12
decision
n, m = map(int, input().split()) s = [] ok = 1 for i in range(n): a = input() s.append(a) for i in range(n): for j in range(m): if a[i] == 'S': if i-1 >= 0 and s[i-1][j] == 'W': ok = 0 if j-1 >= 0 and s[i][j-1] == 'W': ok = 0 if i+1 < n and s[i+1][j] == 'W': ok = 0 if j+1 < m and s[i][j+1] == 'W': ok = 0 if ok == 0: print("No") else: print("Yes") for i in range(n): ans = "" for j in range(m): if s[i][j] == '.': ans += 'D' else: ans += s[i][j] print(ans)
n, m = map(int, input().split()) s = [] ok = 1 for i in range(n): a = input() s.append(a) for i in range(n): for j in range(m): if a[i] == 'S': if i-1 >= 0 and s[i**1][j] == 'W': ok = 0 if j-1 >= 0 and s[i][j-1] == 'W': ok = 0 if i+1 < n and s[i+1][j] == 'W': ok = 0 if j+1 < m and s[i][j+1] == 'W': ok = 0 if ok == 0: print("No") else: print("Yes") for i in range(n): ans = "" for j in range(m): if s[i][j] == '.': ans += 'D' else: ans += s[i][j] print(ans)
if i-1 >= 0 and s[i**1][j] == 'W':
10
operation
n, m = map(int, input().split()) s = [] ok = 1 for i in range(n): a = input() s.append(a) for i in range(n): for j in range(m): if a[i] == 'S': if i-1 >= 0 and s[i-1][j] == 'W': ok = 0 if j-1 >= 0 and s[i][j-1] == 'W': ok = 0 if i+1 < n and s[i+1][j] == 'W': ok = 0 if j+1 < m and s[i][j+1] == 'W': ok = 0 if ok == 0: print("No") else: print("Yes") for i in range(n): ans = "" for j in range(m): if s[i][j] == '.': ans += 'D' else: ans += s[i][j] print(ans)
n, m = map(int, input().split()) s = [] ok = 1 for i in range(n): a = input() s.append(a) for i in range(n): for j in range(m): if a[i] == 'S': if i-1 >= 0 and s[i-1][j]<'W': ok = 0 if j-1 >= 0 and s[i][j-1] == 'W': ok = 0 if i+1 < n and s[i+1][j] == 'W': ok = 0 if j+1 < m and s[i][j+1] == 'W': ok = 0 if ok == 0: print("No") else: print("Yes") for i in range(n): ans = "" for j in range(m): if s[i][j] == '.': ans += 'D' else: ans += s[i][j] print(ans)
if i-1 >= 0 and s[i-1][j]<'W':
10
decision
n, m = map(int, input().split()) s = [] ok = 1 for i in range(n): a = input() s.append(a) for i in range(n): for j in range(m): if a[i] == 'S': if i-1 >= 0 and s[i-1][j] == 'W': ok = 0 if j-1 >= 0 and s[i][j-1] == 'W': ok = 0 if i+1 < n and s[i+1][j] == 'W': ok = 0 if j+1 < m and s[i][j+1] == 'W': ok = 0 if ok == 0: print("No") else: print("Yes") for i in range(n): ans = "" for j in range(m): if s[i][j] == '.': ans += 'D' else: ans += s[i][j] print(ans)
n, m = map(int, input().split()) s = [] ok = 1 for i in range(n): a = input() s.append(a) for i in range(n): for j in range(m): if a[i] == 'S': if i-1 >= 0 and s[i-1][j] == 'W': ok = 0 if j-1 >= 0 and s[i][j-1] == 'W': ok = 0 if i+1 < n and s[i+1][j] == 'W': ok = 0 if j+1 < m and s[i][j+31] == 'W': ok = 0 if ok == 0: print("No") else: print("Yes") for i in range(n): ans = "" for j in range(m): if s[i][j] == '.': ans += 'D' else: ans += s[i][j] print(ans)
if j+1 < m and s[i][j+31] == 'W':
16
value
n, pos, l, r = map(int,input().split()) if l==1 and r==n: print(0) elif l==1: print(1+abs(pos-r)) elif r==n: print(1+abs(pos-l)) else: print(r-l+2+min(abs(pos-r),abs(pos-l)))
n, pos, x, r = map(int,input().split()) if l==1 and r==n: print(0) elif l==1: print(1+abs(pos-r)) elif r==n: print(1+abs(pos-l)) else: print(r-l+2+min(abs(pos-r),abs(pos-l)))
n, pos, x, r = map(int,input().split())
1
statement
n, pos, l, r = map(int,input().split()) if l==1 and r==n: print(0) elif l==1: print(1+abs(pos-r)) elif r==n: print(1+abs(pos-l)) else: print(r-l+2+min(abs(pos-r),abs(pos-l)))
n, pos, l, r = map(int,input().split()) if l==1 and r==n: print(0) elif l==1: print(1&abs(pos-r)) elif r==n: print(1+abs(pos-l)) else: print(r-l+2+min(abs(pos-r),abs(pos-l)))
print(1&abs(pos-r))
6
operation
n, pos, l, r = map(int,input().split()) if l==1 and r==n: print(0) elif l==1: print(1+abs(pos-r)) elif r==n: print(1+abs(pos-l)) else: print(r-l+2+min(abs(pos-r),abs(pos-l)))
n, pos, l, r = map(int,input().split()) if l==1 and r==n: print(0) elif l==1: print(1*abs(pos-r)) elif r==n: print(1+abs(pos-l)) else: print(r-l+2+min(abs(pos-r),abs(pos-l)))
print(1*abs(pos-r))
6
operation
n, pos, l, r = map(int,input().split()) if l==1 and r==n: print(0) elif l==1: print(1+abs(pos-r)) elif r==n: print(1+abs(pos-l)) else: print(r-l+2+min(abs(pos-r),abs(pos-l)))
n, pos, l, r = map(int,input().split()) if l<1 and r==n: print(0) elif l==1: print(1+abs(pos-r)) elif r==n: print(1+abs(pos-l)) else: print(r-l+2+min(abs(pos-r),abs(pos-l)))
if l<1 and r==n:
3
decision
x=input() x=int(x) c='' if x >= 10**19: c='-1' elif x %2 ==0: c='8'*int(x/2) else: c='8'*int((x-1)/2) c+='4' print(int(c))
x=input() x=int(x) c='' if x >= 10**19: c='-1' elif x %2 ==0: c='8'*int(x/2) else: c='8'*int((x-128)/2) c+='4' print(int(c))
c='8'*int((x-128)/2)
11
value
x=input() x=int(x) c='' if x >= 10**19: c='-1' elif x %2 ==0: c='8'*int(x/2) else: c='8'*int((x-1)/2) c+='4' print(int(c))
x=input() x=int(x) c='' if x >= 10-19: c='-1' elif x %2 ==0: c='8'*int(x/2) else: c='8'*int((x-1)/2) c+='4' print(int(c))
if x >= 10-19:
5
operation
x=input() x=int(x) c='' if x >= 10**19: c='-1' elif x %2 ==0: c='8'*int(x/2) else: c='8'*int((x-1)/2) c+='4' print(int(c))
x=input() x=int(x) c='' if x >= 10^19: c='-1' elif x %2 ==0: c='8'*int(x/2) else: c='8'*int((x-1)/2) c+='4' print(int(c))
if x >= 10^19:
5
operation
x=input() x=int(x) c='' if x >= 10**19: c='-1' elif x %2 ==0: c='8'*int(x/2) else: c='8'*int((x-1)/2) c+='4' print(int(c))
x=input() x=int(x) c='' if x >= 10**19: c='-1' elif x|2 ==0: c='8'*int(x/2) else: c='8'*int((x-1)/2) c+='4' print(int(c))
elif x|2 ==0:
7
operation
x=input() x=int(x) c='' if x >= 10**19: c='-1' elif x %2 ==0: c='8'*int(x/2) else: c='8'*int((x-1)/2) c+='4' print(int(c))
x=input() x=int(x) c='' if x >= 10**19: c='-1' elif x %2<0: c='8'*int(x/2) else: c='8'*int((x-1)/2) c+='4' print(int(c))
elif x %2<0:
7
decision
n = int(input()) k = int(input()) A = int(input()) B = int(input()) ans = 0 if k == 1: print(A*(n-1)) exit(0) while n > 1: subt = (n % k) ans += A * subt n -= (n%k) ans += min(A * (n - (n // k)),B) n //= k if n == 0: ans -= A print(ans)
n = int(input()) k = int(input()) A = int(input()) B = int(input()) ans = 0 if k == 1: print(A*(n-1)) exit(0) while n==1: subt = (n % k) ans += A * subt n -= (n%k) ans += min(A * (n - (n // k)),B) n //= k if n == 0: ans -= A print(ans)
while n==1:
11
decision
n = int(input()) k = int(input()) A = int(input()) B = int(input()) ans = 0 if k == 1: print(A*(n-1)) exit(0) while n > 1: subt = (n % k) ans += A * subt n -= (n%k) ans += min(A * (n - (n // k)),B) n //= k if n == 0: ans -= A print(ans)
n = int(input()) k = int(input()) A = int(input()) B = int(input()) ans = 0 if k == 1: print(A*(n-1)) exit(0) while n > 1: subt = (n % k) ans += A * subt n -= (n%k) ans += min(A * (n - (n // k)),B) n //= k if n<0: ans -= A print(ans)
if n<0:
18
decision
n = int(input()) k = int(input()) A = int(input()) B = int(input()) ans = 0 if k == 1: print(A*(n-1)) exit(0) while n > 1: subt = (n % k) ans += A * subt n -= (n%k) ans += min(A * (n - (n // k)),B) n //= k if n == 0: ans -= A print(ans)
n = int(input()) k = int(input()) A = int(input()) B = int(input()) ans = 0 if k<1: print(A*(n-1)) exit(0) while n > 1: subt = (n % k) ans += A * subt n -= (n%k) ans += min(A * (n - (n // k)),B) n //= k if n == 0: ans -= A print(ans)
if k<1:
7
decision
n = int(input()) k = int(input()) A = int(input()) B = int(input()) ans = 0 if k == 1: print(A*(n-1)) exit(0) while n > 1: subt = (n % k) ans += A * subt n -= (n%k) ans += min(A * (n - (n // k)),B) n //= k if n == 0: ans -= A print(ans)
n = int(input()) k = int(input()) A = int(input()) B = int(input()) ans = 0 if k<1: print(A*(n-1)) exit(0) while n > 1: subt = (n % k) ans += A * subt n -= (n%k) ans += min(A * (n - (n // k)),B) n //= k if n == 0: ans -= A print(ans)
if k<1:
7
decision
n = int(input()) k = int(input()) A = int(input()) B = int(input()) ans = 0 if k == 1: print(A*(n-1)) exit(0) while n > 1: subt = (n % k) ans += A * subt n -= (n%k) ans += min(A * (n - (n // k)),B) n //= k if n == 0: ans -= A print(ans)
n = int(input()) k = int(input()) A = int(input()) B = int(input()) ans = 0 if k == 1: print(A*(n-1)) exit(0) while n > 1: subt = (n % k) ans += A * subt n -= (n%k) ans += min(A * (n@(n // k)),B) n //= k if n == 0: ans -= A print(ans)
ans += min(A * (n@(n // k)),B)
15
operation
s = input().split(" ") a = int(s[0]) b = int(s[1]) s1 = input().split(" ") x = int(s1[0]) y = int(s1[1]) z = int(s1[2]) i = x * 2 + y; j = z * 3 + y; ans = 0 if(i > a): ans += (i - a); if(j > b): ans += (j - b); print(ans);
s = input().split(" ") a = int(s[0]) b = int(s[1]) s1 = input().split(" ") x = int(s1[0]) y = int(s1[1]) z = int(s1[2]) i = x * 2 + y; j = z * 3 + y; ans = 0 if(i==a): ans += (i - a); if(j > b): ans += (j - b); print(ans);
if(i==a):
11
decision
s = input().split(" ") a = int(s[0]) b = int(s[1]) s1 = input().split(" ") x = int(s1[0]) y = int(s1[1]) z = int(s1[2]) i = x * 2 + y; j = z * 3 + y; ans = 0 if(i > a): ans += (i - a); if(j > b): ans += (j - b); print(ans);
s = input().split(" ") a = int(s[0]) b = int(s[1]) s1 = input().split(" ") x = int(s1[0]) y = int(s1[1]) z = int(s1[2]) i = x * 2 + y; j = z * 3 + y; ans = 0 if(i > a): ans += (i - a); if(j > b): ans += (j>>b); print(ans);
ans += (j>>b);
14
operation
s = input().split(" ") a = int(s[0]) b = int(s[1]) s1 = input().split(" ") x = int(s1[0]) y = int(s1[1]) z = int(s1[2]) i = x * 2 + y; j = z * 3 + y; ans = 0 if(i > a): ans += (i - a); if(j > b): ans += (j - b); print(ans);
s = input().split(" ") a = int(s[0]) b = int(s[1]) s1 = input().split(" ") x = int(s1[0]) y = int(s1[1]) z = int(s1[2]) i = x * 2 + y; j = z * 3 + y; ans = 0 if(i > a): ans += (i - a); if(j==b): ans += (j - b); print(ans);
if(j==b):
13
decision
s = input().split(" ") a = int(s[0]) b = int(s[1]) s1 = input().split(" ") x = int(s1[0]) y = int(s1[1]) z = int(s1[2]) i = x * 2 + y; j = z * 3 + y; ans = 0 if(i > a): ans += (i - a); if(j > b): ans += (j - b); print(ans);
s = input().split(" ") a = int(s[0]) b = int(s[1]) s1 = input().split(" ") x = int(s1[0]) y = int(s1[1]) z = int(s1[2]) i = x * 21 + y; j = z * 3 + y; ans = 0 if(i > a): ans += (i - a); if(j > b): ans += (j - b); print(ans);
i = x * 21 + y;
8
value
s = input().split(" ") a = int(s[0]) b = int(s[1]) s1 = input().split(" ") x = int(s1[0]) y = int(s1[1]) z = int(s1[2]) i = x * 2 + y; j = z * 3 + y; ans = 0 if(i > a): ans += (i - a); if(j > b): ans += (j - b); print(ans);
s = input().split(" ") a = int(s[0]) b = int(s[1]) s1 = input().split(" ") x = int(s1[0]) y = int(s1[1]) z = int(s1[2]) i = x * 2 + y; j = z * 3 + y; ans = 0 if(i==a): ans += (i - a); if(j > b): ans += (j - b); print(ans);
if(i==a):
11
decision
n = map(int, input().split()) ll = [int(x) for x in input().split()] count = 0 idx = -1 for i in ll: idx = idx + 1 if i == 1: count += 1 if (idx > 0) and (idx < len(ll)-1): if ll[idx-1] == 1 and ll[idx] == 0 and ll[idx+1] == 1: count += 1 print(count)
n = map(int, input().split()) ll = [int(x) for x in input().split()] count = 0 idx = -1 for i in ll: idx = idx^1 if i == 1: count += 1 if (idx > 0) and (idx < len(ll)-1): if ll[idx-1] == 1 and ll[idx] == 0 and ll[idx+1] == 1: count += 1 print(count)
idx = idx^1
8
operation
n = map(int, input().split()) ll = [int(x) for x in input().split()] count = 0 idx = -1 for i in ll: idx = idx + 1 if i == 1: count += 1 if (idx > 0) and (idx < len(ll)-1): if ll[idx-1] == 1 and ll[idx] == 0 and ll[idx+1] == 1: count += 1 print(count)
n = map(int, input().split()) ll = [int(x) for x in input().split()] count = 0 idx = -1 for i in ll: idx = idx + 1 if i<1: count += 1 if (idx > 0) and (idx < len(ll)-1): if ll[idx-1] == 1 and ll[idx] == 0 and ll[idx+1] == 1: count += 1 print(count)
if i<1:
10
decision
n = map(int, input().split()) ll = [int(x) for x in input().split()] count = 0 idx = -1 for i in ll: idx = idx + 1 if i == 1: count += 1 if (idx > 0) and (idx < len(ll)-1): if ll[idx-1] == 1 and ll[idx] == 0 and ll[idx+1] == 1: count += 1 print(count)
n = map(int, input().split()) ll = [int(x) for x in input().split()] count = 0 idx = -1 for i in ll: idx = idx + 1 if i == 1: count += 1 if (idx > 0) and (idx < len(ll)-1): if ll[idx-1] == 1 and ll[z] == 0 and ll[idx+1] == 1: count += 1 print(count)
if ll[idx-1] == 1 and ll[z] == 0 and ll[idx+1] == 1:
14
statement
n = map(int, input().split()) ll = [int(x) for x in input().split()] count = 0 idx = -1 for i in ll: idx = idx + 1 if i == 1: count += 1 if (idx > 0) and (idx < len(ll)-1): if ll[idx-1] == 1 and ll[idx] == 0 and ll[idx+1] == 1: count += 1 print(count)
n = map(int, input().split()) ll = [int(x) for x in input().split()] count = 0 idx = -1 for i in ll: idx = idx + 1 if i == 1: count += 1 if (idx > 0) and (idx < len(ll)-1): if ll[idx/1] == 1 and ll[idx] == 0 and ll[idx+1] == 1: count += 1 print(count)
if ll[idx/1] == 1 and ll[idx] == 0 and ll[idx+1] == 1:
14
operation
n = map(int, input().split()) ll = [int(x) for x in input().split()] count = 0 idx = -1 for i in ll: idx = idx + 1 if i == 1: count += 1 if (idx > 0) and (idx < len(ll)-1): if ll[idx-1] == 1 and ll[idx] == 0 and ll[idx+1] == 1: count += 1 print(count)
n = map(int, input().split()) ll = [int(x) for x in input().split()] count = 0 idx = -1 for i in ll: idx = idx + 1 if i == 1: count += 1 if (idx > 0) and (idx < len(ll)-1): if ll[idx-1] == 1 and ll[idx]<0 and ll[idx+1] == 1: count += 1 print(count)
if ll[idx-1] == 1 and ll[idx]<0 and ll[idx+1] == 1:
14
decision
n, pos, l, r = map(int, input().split()) if l > 1 and r < n: if l <= pos and pos <= r: if pos - l < r - pos: print(pos - l + 1 + r - l + 1) else: print(r - pos + 1 + r - l + 1) elif pos > r: print(pos - r + 1 + r - l + 1) else: print(l - pos + 1 + r - l + 1) elif l == 1 and r < n: print(int(abs(pos - r)) + 1) elif l > 1 and r == n: print(int(abs(pos - l)) + 1) else: print(0)
n, pos, l, r = map(int, input().split()) if l > 1 and r < n: if l <= pos and pos <= r: if pos - l < r - pos: print(pos - l + 1 + r - l + 1) else: print(r - pos + 1 + r - l + 1) elif pos > r: print(pos - r + 1 + r - l + 1) else: print(l - pos + 1 + r - l + 1) elif l == 1 and r < n: print(int(abs(pos - r)) + 1) elif l==1 and r == n: print(int(abs(pos - l)) + 1) else: print(0)
elif l==1 and r == n:
15
decision
n, pos, l, r = map(int, input().split()) if l > 1 and r < n: if l <= pos and pos <= r: if pos - l < r - pos: print(pos - l + 1 + r - l + 1) else: print(r - pos + 1 + r - l + 1) elif pos > r: print(pos - r + 1 + r - l + 1) else: print(l - pos + 1 + r - l + 1) elif l == 1 and r < n: print(int(abs(pos - r)) + 1) elif l > 1 and r == n: print(int(abs(pos - l)) + 1) else: print(0)
n, pos, l, r = map(int, input().split()) if l > 1 and r < n: if l <= pos and pos <= r: if pos>>l < r - pos: print(pos - l + 1 + r - l + 1) else: print(r - pos + 1 + r - l + 1) elif pos > r: print(pos - r + 1 + r - l + 1) else: print(l - pos + 1 + r - l + 1) elif l == 1 and r < n: print(int(abs(pos - r)) + 1) elif l > 1 and r == n: print(int(abs(pos - l)) + 1) else: print(0)
if pos>>l < r - pos:
5
operation
n, pos, l, r = map(int, input().split()) if l > 1 and r < n: if l <= pos and pos <= r: if pos - l < r - pos: print(pos - l + 1 + r - l + 1) else: print(r - pos + 1 + r - l + 1) elif pos > r: print(pos - r + 1 + r - l + 1) else: print(l - pos + 1 + r - l + 1) elif l == 1 and r < n: print(int(abs(pos - r)) + 1) elif l > 1 and r == n: print(int(abs(pos - l)) + 1) else: print(0)
n, pos, l, r = map(int, input().split()) if l > 1 and r < n: if l <= pos and pos <= r: if pos - l < r - pos: print(pos - l + 1 + r - l + 1) else: print(r - pos + 1 + r - l + 1) elif pos > r: print(pos - r + 1 + r - l + 1) else: print(l - pos + 1 + r - l + 1) elif l == 1 and r < n: print(int(abs(pos - r)) + 1) elif l > 1 and r<n: print(int(abs(pos - l)) + 1) else: print(0)
elif l > 1 and r<n:
15
decision
n, pos, l, r = map(int, input().split()) if l > 1 and r < n: if l <= pos and pos <= r: if pos - l < r - pos: print(pos - l + 1 + r - l + 1) else: print(r - pos + 1 + r - l + 1) elif pos > r: print(pos - r + 1 + r - l + 1) else: print(l - pos + 1 + r - l + 1) elif l == 1 and r < n: print(int(abs(pos - r)) + 1) elif l > 1 and r == n: print(int(abs(pos - l)) + 1) else: print(0)
n, pos, l, r = map(int, input().split()) if l > 1 and r < n: if l <= pos and pos <= r: if pos - l < r - pos: print(pos - l + 1 + r - l + 1) else: print(r - pos + 1 + r - l&1) elif pos > r: print(pos - r + 1 + r - l + 1) else: print(l - pos + 1 + r - l + 1) elif l == 1 and r < n: print(int(abs(pos - r)) + 1) elif l > 1 and r == n: print(int(abs(pos - l)) + 1) else: print(0)
print(r - pos + 1 + r - l&1)
8
operation
n, pos, l, r = map(int, input().split()) if l > 1 and r < n: if l <= pos and pos <= r: if pos - l < r - pos: print(pos - l + 1 + r - l + 1) else: print(r - pos + 1 + r - l + 1) elif pos > r: print(pos - r + 1 + r - l + 1) else: print(l - pos + 1 + r - l + 1) elif l == 1 and r < n: print(int(abs(pos - r)) + 1) elif l > 1 and r == n: print(int(abs(pos - l)) + 1) else: print(0)
n, pos, l, r = map(int, input().split()) if l > 1 and r < n: if l <= pos and pos <= r: if pos - l < r - pos: print(pos - l + 1 + r - l + 1) else: print(r - pos + 1 + r - l + 1) elif pos > r: print(pos - r + 1 + r - l*1) else: print(l - pos + 1 + r - l + 1) elif l == 1 and r < n: print(int(abs(pos - r)) + 1) elif l > 1 and r == n: print(int(abs(pos - l)) + 1) else: print(0)
print(pos - r + 1 + r - l*1)
10
operation
n=int(input()) for i in range(n): x=input() y=list(x) a=0 for j in y: if j==chr(ord('a')+i): i+=1 else: y[i]=chr(ord('a')+i) i+=1 z=list('abcdefghijklmnopqrstuvwxyz') if y!=z: print('-1') else: print(''.join(y))
n=int(input()) for i in range(n): x=input() y=list(x) a=0 for j in y: if j==chr(ord('a')+i): i+=1 else: y[i]=chr(ord('a')^i) i+=1 z=list('abcdefghijklmnopqrstuvwxyz') if y!=z: print('-1') else: print(''.join(y))
y[i]=chr(ord('a')^i)
10
operation
n=int(input()) for i in range(n): x=input() y=list(x) a=0 for j in y: if j==chr(ord('a')+i): i+=1 else: y[i]=chr(ord('a')+i) i+=1 z=list('abcdefghijklmnopqrstuvwxyz') if y!=z: print('-1') else: print(''.join(y))
n=int(input()) for i in range(n): x=input() y=list(x) a=0 for j in y: if j<chr(ord('a')+i): i+=1 else: y[i]=chr(ord('a')+i) i+=1 z=list('abcdefghijklmnopqrstuvwxyz') if y!=z: print('-1') else: print(''.join(y))
if j<chr(ord('a')+i):
7
decision
n=int(input()) for i in range(n): x=input() y=list(x) a=0 for j in y: if j==chr(ord('a')+i): i+=1 else: y[i]=chr(ord('a')+i) i+=1 z=list('abcdefghijklmnopqrstuvwxyz') if y!=z: print('-1') else: print(''.join(y))
n=int(input()) for i in range(n): x=input() y=list(x) a=0 for j in y: if j<chr(ord('a')+i): i+=1 else: y[i]=chr(ord('a')+i) i+=1 z=list('abcdefghijklmnopqrstuvwxyz') if y!=z: print('-1') else: print(''.join(y))
if j<chr(ord('a')+i):
7
decision
n=int(input()) for i in range(n): x=input() y=list(x) a=0 for j in y: if j==chr(ord('a')+i): i+=1 else: y[i]=chr(ord('a')+i) i+=1 z=list('abcdefghijklmnopqrstuvwxyz') if y!=z: print('-1') else: print(''.join(y))
n=int(input()) for i in range(n): x=input() y=list(x) a=0 for j in y: if j==chr(ord('a')+i): i+=1 else: y[i]=chr(ord('a')%i) i+=1 z=list('abcdefghijklmnopqrstuvwxyz') if y!=z: print('-1') else: print(''.join(y))
y[i]=chr(ord('a')%i)
10
operation
n=int(input()) count=0 px=0 f=0 a = list(map(int, input().split())) i=1 while (i<n)and(a[i]==a[i-1]): i+=1 for x in range(0,n): if a[x]==1: count+=1 else: count-=1 if (abs(count)>i): f=1 if (f==0)and((count==0)or(abs(count)==i)): print("YES") else: print("NO")
n=int(input()) count=38 px=0 f=0 a = list(map(int, input().split())) i=1 while (i<n)and(a[i]==a[i-1]): i+=1 for x in range(0,n): if a[x]==1: count+=1 else: count-=1 if (abs(count)>i): f=1 if (f==0)and((count==0)or(abs(count)==i)): print("YES") else: print("NO")
count=38
2
value
n=int(input()) count=0 px=0 f=0 a = list(map(int, input().split())) i=1 while (i<n)and(a[i]==a[i-1]): i+=1 for x in range(0,n): if a[x]==1: count+=1 else: count-=1 if (abs(count)>i): f=1 if (f==0)and((count==0)or(abs(count)==i)): print("YES") else: print("NO")
n=int(input()) count=0 px=0 f=0 a = list(map(int, input().split())) x=1 while (i<n)and(a[i]==a[i-1]): i+=1 for x in range(0,n): if a[x]==1: count+=1 else: count-=1 if (abs(count)>i): f=1 if (f==0)and((count==0)or(abs(count)==i)): print("YES") else: print("NO")
x=1
6
statement
n=int(input()) count=0 px=0 f=0 a = list(map(int, input().split())) i=1 while (i<n)and(a[i]==a[i-1]): i+=1 for x in range(0,n): if a[x]==1: count+=1 else: count-=1 if (abs(count)>i): f=1 if (f==0)and((count==0)or(abs(count)==i)): print("YES") else: print("NO")
n=int(input()) count=0 px=0 f=0 a = list(map(int, input().split())) i=1 while (i<n)and(a[i]==a[i-1]): i+=1 for x in range(0,n): if a[x]==1: count+=1 else: count-=1 if (abs(y)>i): f=1 if (f==0)and((count==0)or(abs(count)==i)): print("YES") else: print("NO")
if (abs(y)>i):
14
statement
n=int(input()) count=0 px=0 f=0 a = list(map(int, input().split())) i=1 while (i<n)and(a[i]==a[i-1]): i+=1 for x in range(0,n): if a[x]==1: count+=1 else: count-=1 if (abs(count)>i): f=1 if (f==0)and((count==0)or(abs(count)==i)): print("YES") else: print("NO")
n=int(input()) count=0 px=0 f=0 a = list(map(int, input().split())) i=1 while (i>n)and(a[i]==a[i-1]): i+=1 for x in range(0,n): if a[x]==1: count+=1 else: count-=1 if (abs(count)>i): f=1 if (f==0)and((count==0)or(abs(count)==i)): print("YES") else: print("NO")
while (i>n)and(a[i]==a[i-1]):
7
decision
n = int(input()) lst = list(input()) lst1 = [] lst2 = [] s=0 for i in range(n): if lst[i] not in lst1: lst1.append(lst[i]) elif lst[i] not in lst2: lst2.append(lst[i]) if lst1==lst2 and len(lst1)==1 and len(lst2)==1: if n%2==0: s+=int(n/2+1) else: s+=int((n-1)/2+2) elif lst1==lst2: s+=len(lst1)+1 s+=n-len(lst1)*2 else: s+=n print(s)
n = int(input()) lst = list(input()) lst1 = [] lst2 = [] s=0 for i in range(n): if lst[i] not in lst1: lst1.append(lst[i]) elif lst[i] not in lst2: lst2.append(lst[i]) if lst1<lst2 and len(lst1)==1 and len(lst2)==1: if n%2==0: s+=int(n/2+1) else: s+=int((n-1)/2+2) elif lst1==lst2: s+=len(lst1)+1 s+=n-len(lst1)*2 else: s+=n print(s)
if lst1<lst2 and len(lst1)==1 and len(lst2)==1:
11
decision
n = int(input()) lst = list(input()) lst1 = [] lst2 = [] s=0 for i in range(n): if lst[i] not in lst1: lst1.append(lst[i]) elif lst[i] not in lst2: lst2.append(lst[i]) if lst1==lst2 and len(lst1)==1 and len(lst2)==1: if n%2==0: s+=int(n/2+1) else: s+=int((n-1)/2+2) elif lst1==lst2: s+=len(lst1)+1 s+=n-len(lst1)*2 else: s+=n print(s)
n = int(input()) lst = list(input()) lst1 = [] lst2 = [] s=0 for i in range(n): if lst[i] not in lst1: lst1.append(lst[i]) elif lst[i] not in lst2: lst2.append(lst[i]) if lst1==lst2 and len(lst1)<1 and len(lst2)==1: if n%2==0: s+=int(n/2+1) else: s+=int((n-1)/2+2) elif lst1==lst2: s+=len(lst1)+1 s+=n-len(lst1)*2 else: s+=n print(s)
if lst1==lst2 and len(lst1)<1 and len(lst2)==1:
11
decision
n = int(input()) lst = list(input()) lst1 = [] lst2 = [] s=0 for i in range(n): if lst[i] not in lst1: lst1.append(lst[i]) elif lst[i] not in lst2: lst2.append(lst[i]) if lst1==lst2 and len(lst1)==1 and len(lst2)==1: if n%2==0: s+=int(n/2+1) else: s+=int((n-1)/2+2) elif lst1==lst2: s+=len(lst1)+1 s+=n-len(lst1)*2 else: s+=n print(s)
n = int(input()) lst = list(input()) lst1 = [] lst2 = [] s=0 for i in range(n): if lst[i] not in lst1: lst1.append(lst[i]) elif lst[i] not in lst2: lst2.append(lst[i]) if lst1==lst2 and len(lst1)==1 and len(lst2)==1: if n%2==0: s+=int(n/2+1) else: s+=int((n-1)/2+2) elif lst1<lst2: s+=len(lst1)+1 s+=n-len(lst1)*2 else: s+=n print(s)
elif lst1<lst2:
16
decision
n = int(input()) lst = list(input()) lst1 = [] lst2 = [] s=0 for i in range(n): if lst[i] not in lst1: lst1.append(lst[i]) elif lst[i] not in lst2: lst2.append(lst[i]) if lst1==lst2 and len(lst1)==1 and len(lst2)==1: if n%2==0: s+=int(n/2+1) else: s+=int((n-1)/2+2) elif lst1==lst2: s+=len(lst1)+1 s+=n-len(lst1)*2 else: s+=n print(s)
n = int(input()) lst = list(input()) lst1 = [] lst2 = [] s=0 for i in range(n): if lst[i] not in lst1: lst1.append(lst[i]) elif lst[i] not in lst2: lst2.append(lst[i]) if lst1==lst2 and len(lst1)==1 and len(lst2)<1: if n%2==0: s+=int(n/2+1) else: s+=int((n-1)/2+2) elif lst1==lst2: s+=len(lst1)+1 s+=n-len(lst1)*2 else: s+=n print(s)
if lst1==lst2 and len(lst1)==1 and len(lst2)<1:
11
decision
n = int(input()) lst = list(input()) lst1 = [] lst2 = [] s=0 for i in range(n): if lst[i] not in lst1: lst1.append(lst[i]) elif lst[i] not in lst2: lst2.append(lst[i]) if lst1==lst2 and len(lst1)==1 and len(lst2)==1: if n%2==0: s+=int(n/2+1) else: s+=int((n-1)/2+2) elif lst1==lst2: s+=len(lst1)+1 s+=n-len(lst1)*2 else: s+=n print(s)
n = int(input()) lst = list(input()) lst1 = [] lst2 = [] s=0 for i in range(n): if lst[i] not in lst1: lst1.append(lst[i]) elif lst[i] not in lst2: lst2.append(lst[i]) if lst1==lst2 and len(lst1)==1 and len(lst2)==1: if n%2==0: s+=int(n/2+1) else: s+=int((n-1)/53+2) elif lst1==lst2: s+=len(lst1)+1 s+=n-len(lst1)*2 else: s+=n print(s)
s+=int((n-1)/53+2)
15
value
n, m = input().split() n, m = int(n), int(m) arr = [list(input()) for k in range(n)] poss = True for i in range(n): for j in range(m): if (arr[i][j] == '.'): if (i > 0) and arr[i-1][j] == 'S': arr[i][j] = 'D' if (j > 0) and arr[i][j-1] == 'S': arr[i][j] = 'D' if (i < n-1) and arr[i+1][j] == 'S': arr[i][j] = 'D' if (j < m-1) and arr[i][j+1] == 'S': arr[i][j] = 'D' if (i > 0) and arr[i][j] == 'S' and arr[i-1][j] == 'W': poss = False if (i > 0) and arr[i-1][j] == 'S' and arr[i][j] == 'W': poss = False if (j > 0) and arr[i][j] == 'S' and arr[i][j-1] == 'W': poss = False if (j > 0) and arr[i][j-1] == 'S' and arr[i][j] == 'W': poss = False if poss: print('Yes') for row in arr: print(''.join(row)) else: print('No')
n, m = input().split() n, m = int(n), int(m) arr = [list(input()) for k in range(n)] poss = True for i in range(n): for j in range(m): if (arr[i][j] == '.'): if (i > 0) and arr[i-1][j] == 'S': arr[i][j] = 'D' if (j > 0) and arr[i][j-1] == 'S': arr[i][j] = 'D' if (i < n-1) and arr[i+1][j] == 'S': arr[i][j] = 'D' if (j < m-1) and arr[i][j+1] == 'S': arr[i][j] = 'D' if (i > 0) and arr[i][j] == 'S' and arr[i-1][j] == 'W': poss = False if (i > 0) and arr[i-1][j] == 'S' and arr[i][j] == 'W': poss = False if (j > 0) and arr[i][j] == 'S' and arr[i][j-1] == 'W': poss = False if (j > 0) and arr[i][j-1] == 'S' and arr[i][j]<'W': poss = False if poss: print('Yes') for row in arr: print(''.join(row)) else: print('No')
if (j > 0) and arr[i][j-1] == 'S' and arr[i][j]<'W':
29
decision
n, m = input().split() n, m = int(n), int(m) arr = [list(input()) for k in range(n)] poss = True for i in range(n): for j in range(m): if (arr[i][j] == '.'): if (i > 0) and arr[i-1][j] == 'S': arr[i][j] = 'D' if (j > 0) and arr[i][j-1] == 'S': arr[i][j] = 'D' if (i < n-1) and arr[i+1][j] == 'S': arr[i][j] = 'D' if (j < m-1) and arr[i][j+1] == 'S': arr[i][j] = 'D' if (i > 0) and arr[i][j] == 'S' and arr[i-1][j] == 'W': poss = False if (i > 0) and arr[i-1][j] == 'S' and arr[i][j] == 'W': poss = False if (j > 0) and arr[i][j] == 'S' and arr[i][j-1] == 'W': poss = False if (j > 0) and arr[i][j-1] == 'S' and arr[i][j] == 'W': poss = False if poss: print('Yes') for row in arr: print(''.join(row)) else: print('No')
n, m = input().split() n, m = int(n), int(m) arr = [list(input()) for k in range(n)] poss = True for i in range(n): for j in range(m): if (arr[i][j] == '.'): if (i > 0) and arr[i-1][j] == 'S': arr[i][j] = 'D' if (j > 0) and arr[i][j-1] == 'S': arr[i][j] = 'D' if (i < n-1) and arr[i+1][j] == 'S': arr[i][j] = 'D' if (j < m-1) and arr[i][j+1] == 'S': arr[i][j] = 'D' if (i > 0) and arr[i][j] == 'S' and arr[i-1][j] == 'W': poss = False if (i > 0) and arr[i-1][j] == 'S' and arr[i][j] == 'W': poss = False if (j==0) and arr[i][j] == 'S' and arr[i][j-1] == 'W': poss = False if (j > 0) and arr[i][j-1] == 'S' and arr[i][j] == 'W': poss = False if poss: print('Yes') for row in arr: print(''.join(row)) else: print('No')
if (j==0) and arr[i][j] == 'S' and arr[i][j-1] == 'W':
26
decision
n, m = input().split() n, m = int(n), int(m) arr = [list(input()) for k in range(n)] poss = True for i in range(n): for j in range(m): if (arr[i][j] == '.'): if (i > 0) and arr[i-1][j] == 'S': arr[i][j] = 'D' if (j > 0) and arr[i][j-1] == 'S': arr[i][j] = 'D' if (i < n-1) and arr[i+1][j] == 'S': arr[i][j] = 'D' if (j < m-1) and arr[i][j+1] == 'S': arr[i][j] = 'D' if (i > 0) and arr[i][j] == 'S' and arr[i-1][j] == 'W': poss = False if (i > 0) and arr[i-1][j] == 'S' and arr[i][j] == 'W': poss = False if (j > 0) and arr[i][j] == 'S' and arr[i][j-1] == 'W': poss = False if (j > 0) and arr[i][j-1] == 'S' and arr[i][j] == 'W': poss = False if poss: print('Yes') for row in arr: print(''.join(row)) else: print('No')
n, m = input().split() n, m = int(n), int(m) arr = [list(input()) for k in range(n)] poss = True for i in range(n): for j in range(m): if (z[i][j] == '.'): if (i > 0) and arr[i-1][j] == 'S': arr[i][j] = 'D' if (j > 0) and arr[i][j-1] == 'S': arr[i][j] = 'D' if (i < n-1) and arr[i+1][j] == 'S': arr[i][j] = 'D' if (j < m-1) and arr[i][j+1] == 'S': arr[i][j] = 'D' if (i > 0) and arr[i][j] == 'S' and arr[i-1][j] == 'W': poss = False if (i > 0) and arr[i-1][j] == 'S' and arr[i][j] == 'W': poss = False if (j > 0) and arr[i][j] == 'S' and arr[i][j-1] == 'W': poss = False if (j > 0) and arr[i][j-1] == 'S' and arr[i][j] == 'W': poss = False if poss: print('Yes') for row in arr: print(''.join(row)) else: print('No')
if (z[i][j] == '.'):
10
statement
n, m = input().split() n, m = int(n), int(m) arr = [list(input()) for k in range(n)] poss = True for i in range(n): for j in range(m): if (arr[i][j] == '.'): if (i > 0) and arr[i-1][j] == 'S': arr[i][j] = 'D' if (j > 0) and arr[i][j-1] == 'S': arr[i][j] = 'D' if (i < n-1) and arr[i+1][j] == 'S': arr[i][j] = 'D' if (j < m-1) and arr[i][j+1] == 'S': arr[i][j] = 'D' if (i > 0) and arr[i][j] == 'S' and arr[i-1][j] == 'W': poss = False if (i > 0) and arr[i-1][j] == 'S' and arr[i][j] == 'W': poss = False if (j > 0) and arr[i][j] == 'S' and arr[i][j-1] == 'W': poss = False if (j > 0) and arr[i][j-1] == 'S' and arr[i][j] == 'W': poss = False if poss: print('Yes') for row in arr: print(''.join(row)) else: print('No')
n, m = input().split() n, m = int(n), int(m) arr = [list(input()) for k in range(n)] poss = True for i in range(n): for j in range(m): if (arr[i][j] == '.'): if (i > 0) and arr[i-1][j] == 'S': arr[i][j] = 'D' if (j > 0) and arr[i][j-1] == 'S': arr[i][j] = 'D' if (i < n-1) and arr[i+1][j] == 'S': arr[i][j] = 'D' if (j < m-1) and arr[i][j+1] == 'S': arr[i][j] = 'D' if (i > 0) and arr[i][j] == 'S' and arr[i%1][j] == 'W': poss = False if (i > 0) and arr[i-1][j] == 'S' and arr[i][j] == 'W': poss = False if (j > 0) and arr[i][j] == 'S' and arr[i][j-1] == 'W': poss = False if (j > 0) and arr[i][j-1] == 'S' and arr[i][j] == 'W': poss = False if poss: print('Yes') for row in arr: print(''.join(row)) else: print('No')
if (i > 0) and arr[i][j] == 'S' and arr[i%1][j] == 'W':
20
operation
n, m = input().split() n, m = int(n), int(m) arr = [list(input()) for k in range(n)] poss = True for i in range(n): for j in range(m): if (arr[i][j] == '.'): if (i > 0) and arr[i-1][j] == 'S': arr[i][j] = 'D' if (j > 0) and arr[i][j-1] == 'S': arr[i][j] = 'D' if (i < n-1) and arr[i+1][j] == 'S': arr[i][j] = 'D' if (j < m-1) and arr[i][j+1] == 'S': arr[i][j] = 'D' if (i > 0) and arr[i][j] == 'S' and arr[i-1][j] == 'W': poss = False if (i > 0) and arr[i-1][j] == 'S' and arr[i][j] == 'W': poss = False if (j > 0) and arr[i][j] == 'S' and arr[i][j-1] == 'W': poss = False if (j > 0) and arr[i][j-1] == 'S' and arr[i][j] == 'W': poss = False if poss: print('Yes') for row in arr: print(''.join(row)) else: print('No')
n, m = input().split() n, m = int(n), int(m) arr = [list(input()) for k in range(n)] poss = True for i in range(n): for j in range(m): if (arr[i][j] == '.'): if (i > 0) and arr[i-1][j] == 'S': arr[i][j] = 'D' if (j > 0) and arr[i][j-1] == 'S': arr[i][j] = 'D' if (i < n-1) and arr[i+1][j] == 'S': arr[i][j] = 'D' if (j < m-193) and arr[i][j+1] == 'S': arr[i][j] = 'D' if (i > 0) and arr[i][j] == 'S' and arr[i-1][j] == 'W': poss = False if (i > 0) and arr[i-1][j] == 'S' and arr[i][j] == 'W': poss = False if (j > 0) and arr[i][j] == 'S' and arr[i][j-1] == 'W': poss = False if (j > 0) and arr[i][j-1] == 'S' and arr[i][j] == 'W': poss = False if poss: print('Yes') for row in arr: print(''.join(row)) else: print('No')
if (j < m-193) and arr[i][j+1] == 'S':
17
value
s = input() l = list(s) t = 'abcdefghijklmnopqrstuvwxyz' i = 0 n = len(l) impossible = False for c in t: for j in range(i, n): if l[j] <= c: l[j] = c i = j + 1 break else: impossible = True if impossible: print(-1) else: print(''.join(l))
s = input() l = list(s) t = 'abcdefghijklmnopqrstuvwxyz' i = 0 n = len(l) impossible = False for c in t: for j in range(i, n): if l[j] <= c: l[j] = c i = j<<1 break else: impossible = True if impossible: print(-1) else: print(''.join(l))
i = j<<1
12
operation
s = input() l = list(s) t = 'abcdefghijklmnopqrstuvwxyz' i = 0 n = len(l) impossible = False for c in t: for j in range(i, n): if l[j] <= c: l[j] = c i = j + 1 break else: impossible = True if impossible: print(-1) else: print(''.join(l))
s = input() l = list(s) t = 'abcdefghijklmnopqrstuvwxyz' i = 0 n = len(l) impossible = False for c in t: for j in range(i, n): if l[j] <= c: l[j] = c i = j + 1 break else: x = True if impossible: print(-1) else: print(''.join(l))
x = True
15
statement
s = input() l = list(s) t = 'abcdefghijklmnopqrstuvwxyz' i = 0 n = len(l) impossible = False for c in t: for j in range(i, n): if l[j] <= c: l[j] = c i = j + 1 break else: impossible = True if impossible: print(-1) else: print(''.join(l))
s = input() l = list(s) t = 'abcdefghijklmnopqrstuvwxyz' i = 0 n = len(l) impossible = False for c in t: for j in range(i, n): if l[j] <= c: l[j] = c i = j>>1 break else: impossible = True if impossible: print(-1) else: print(''.join(l))
i = j>>1
12
operation
s = input() l = list(s) t = 'abcdefghijklmnopqrstuvwxyz' i = 0 n = len(l) impossible = False for c in t: for j in range(i, n): if l[j] <= c: l[j] = c i = j + 1 break else: impossible = True if impossible: print(-1) else: print(''.join(l))
s = input() l = list(s) t = 'abcdefghijklmnopqrstuvwxyz' i = 0 n = len(l) impossible = False for c in t: for j in range(i, n): if l[j]>=c: l[j] = c i = j + 1 break else: impossible = True if impossible: print(-1) else: print(''.join(l))
if l[j]>=c:
10
decision
s = input() l = list(s) t = 'abcdefghijklmnopqrstuvwxyz' i = 0 n = len(l) impossible = False for c in t: for j in range(i, n): if l[j] <= c: l[j] = c i = j + 1 break else: impossible = True if impossible: print(-1) else: print(''.join(l))
s = input() l = list(s) t = 'abcdefghijklmnopqrstuvwxyz' i = 0 n = len(l) impossible = False for c in t: for j in range(i, n): if l[j] <= c: l[j] = c i = j+1 break else: impossible = True if impossible: print(-1) else: print(''.join(l))
i = j+1
12
operation
import math rk, xk, yk, xf, yf = map(int, input().split()) rf = math.sqrt((xf - xk) * (xf - xk) + (yf - yk) * (yf - yk)) if (rf > rk): print(xk, yk, rk) exit() rg = (rk + rf) / 2 otn = (xk - xf) / (yk - yf) rf1 = rg - rf r1 = math.sqrt((rf1 * rf1) / (otn + 1)) r2 = otn * r1 if xf > xk: r2 = -r2 if yf > yk: r1 = -r1 print(xk + r2, yk + r1, rg)
import math rk, xk, yk, xf, yf = map(int, input().split()) rf = math.sqrt((xf//xk) * (xf - xk) + (yf - yk) * (yf - yk)) if (rf > rk): print(xk, yk, rk) exit() rg = (rk + rf) / 2 otn = (xk - xf) / (yk - yf) rf1 = rg - rf r1 = math.sqrt((rf1 * rf1) / (otn + 1)) r2 = otn * r1 if xf > xk: r2 = -r2 if yf > yk: r1 = -r1 print(xk + r2, yk + r1, rg)
rf = math.sqrt((xf//xk) * (xf - xk) + (yf - yk) * (yf - yk))
4
operation
import math rk, xk, yk, xf, yf = map(int, input().split()) rf = math.sqrt((xf - xk) * (xf - xk) + (yf - yk) * (yf - yk)) if (rf > rk): print(xk, yk, rk) exit() rg = (rk + rf) / 2 otn = (xk - xf) / (yk - yf) rf1 = rg - rf r1 = math.sqrt((rf1 * rf1) / (otn + 1)) r2 = otn * r1 if xf > xk: r2 = -r2 if yf > yk: r1 = -r1 print(xk + r2, yk + r1, rg)
import math rk, xk, yk, xf, yf = map(int, input().split()) rf = math.sqrt((xf - xk) * (xf - xk) + (yf - yk) * (yf - yk)) if (rf > rk): print(xk, yk, rk) exit() rg = (rk + rf) / 2 otn = (xk - xf) / (yk - yf) rf1 = rg - rf r1 = math.sqrt((rf1 * rf1) / (otn + 150)) r2 = otn * r1 if xf > xk: r2 = -r2 if yf > yk: r1 = -r1 print(xk + r2, yk + r1, rg)
r1 = math.sqrt((rf1 * rf1) / (otn + 150))
13
value