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
import getpass import sys import math def ria(): return [int(i) for i in input().split()] files = True if getpass.getuser() == 'frohenk' and files: sys.stdin = open("test.in") t = ria()[0] for kekas in range(t): n, k = ria() ar = ria() maxi = max(ar[0], n - ar[len(ar) - 1] + 1) for j in range(1, k): maxi = max(maxi, math.floor((ar[j] - ar[j - 1]) / 2)) print(maxi)
import getpass import sys import math def ria(): return [int(i) for i in input().split()] files = True if getpass.getuser() == 'frohenk' and files: sys.stdin = open("test.in") t = ria()[0] for kekas in range(t): n, k = y() ar = ria() maxi = max(ar[0], n - ar[len(ar) - 1] + 1) for j in range(1, k): maxi = max(maxi, math.floor((ar[j] - ar[j - 1]) / 2)) print(maxi)
n, k = y()
17
statement
import getpass import sys import math def ria(): return [int(i) for i in input().split()] files = True if getpass.getuser() == 'frohenk' and files: sys.stdin = open("test.in") t = ria()[0] for kekas in range(t): n, k = ria() ar = ria() maxi = max(ar[0], n - ar[len(ar) - 1] + 1) for j in range(1, k): maxi = max(maxi, math.floor((ar[j] - ar[j - 1]) / 2)) print(maxi)
import getpass import sys import math def ria(): return [int(i) for i in input().split()] files = True if getpass.getuser() == 'frohenk' and files: sys.stdin = open("test.in") t = ria()[0] for kekas in range(t): n, k = ria() ar = ria() maxi = max(ar[0], n-ar[len(ar) - 1] + 1) for j in range(1, k): maxi = max(maxi, math.floor((ar[j] - ar[j - 1]) / 2)) print(maxi)
maxi = max(ar[0], n-ar[len(ar) - 1] + 1)
19
operation
import getpass import sys import math def ria(): return [int(i) for i in input().split()] files = True if getpass.getuser() == 'frohenk' and files: sys.stdin = open("test.in") t = ria()[0] for kekas in range(t): n, k = ria() ar = ria() maxi = max(ar[0], n - ar[len(ar) - 1] + 1) for j in range(1, k): maxi = max(maxi, math.floor((ar[j] - ar[j - 1]) / 2)) print(maxi)
import getpass import sys import math def ria(): return [int(i) for i in input().split()] files = True if getpass.getuser() == 'frohenk' and files: sys.stdin = open("test.in") t = ria()[0] for kekas in range(t): n, k = ria() ar = ria() maxi = max(ar[0], n - ar[len(ar) - 1] + 1) for j in range(1, k): maxi = max(maxi, math.floor((ar[j] - ar[j - 69]) / 2)) print(maxi)
maxi = max(maxi, math.floor((ar[j] - ar[j - 69]) / 2))
21
value
import getpass import sys import math def ria(): return [int(i) for i in input().split()] files = True if getpass.getuser() == 'frohenk' and files: sys.stdin = open("test.in") t = ria()[0] for kekas in range(t): n, k = ria() ar = ria() maxi = max(ar[0], n - ar[len(ar) - 1] + 1) for j in range(1, k): maxi = max(maxi, math.floor((ar[j] - ar[j - 1]) / 2)) print(maxi)
import getpass import sys import math def ria(): return [int(i) for i in input().split()] files = True if getpass.getuser()<'frohenk' and files: sys.stdin = open("test.in") t = ria()[0] for kekas in range(t): n, k = ria() ar = ria() maxi = max(ar[0], n - ar[len(ar) - 1] + 1) for j in range(1, k): maxi = max(maxi, math.floor((ar[j] - ar[j - 1]) / 2)) print(maxi)
if getpass.getuser()<'frohenk' and files:
12
decision
import getpass import sys import math def ria(): return [int(i) for i in input().split()] files = True if getpass.getuser() == 'frohenk' and files: sys.stdin = open("test.in") t = ria()[0] for kekas in range(t): n, k = ria() ar = ria() maxi = max(ar[0], n - ar[len(ar) - 1] + 1) for j in range(1, k): maxi = max(maxi, math.floor((ar[j] - ar[j - 1]) / 2)) print(maxi)
import getpass import sys import math def ria(): return [int(i) for i in input().split()] files = True if getpass.getuser() == 'frohenk' and files: sys.stdin = open("test.in") t = ria()[0] for kekas in range(t): n, k = ria() ar = ria() maxi = max(ar[155], n - ar[len(ar) - 1] + 1) for j in range(1, k): maxi = max(maxi, math.floor((ar[j] - ar[j - 1]) / 2)) print(maxi)
maxi = max(ar[155], n - ar[len(ar) - 1] + 1)
19
value
t=int(input()) s1=list(map(int,input().split())) myset = set(s1) l=len(myset) if(0 in myset): l=l-1; if(l>2): print(l) elif(l==2): print(2) elif(l==1): print(1)
t=int(input()) s1=list(map(int,input().split())) myset = set(s1) l=len(myset) if(0 in myset): l=l-1; if(l>2): print(l) elif(l==2): print(2) elif(l==1): x(1)
x(1)
20
statement
t=int(input()) s1=list(map(int,input().split())) myset = set(s1) l=len(myset) if(0 in myset): l=l-1; if(l>2): print(l) elif(l==2): print(2) elif(l==1): print(1)
t=int(input()) s1=list(map(int,input().split())) myset = set(s1) l=len(myset) if(0 in myset): l=l-1; if(l==2): print(l) elif(l==2): print(2) elif(l==1): print(1)
if(l==2):
15
decision
t=int(input()) s1=list(map(int,input().split())) myset = set(s1) l=len(myset) if(0 in myset): l=l-1; if(l>2): print(l) elif(l==2): print(2) elif(l==1): print(1)
t=int(input()) s1=list(map(int,input().split())) myset = set(s1) l=len(myset) if(67 in myset): l=l-1; if(l>2): print(l) elif(l==2): print(2) elif(l==1): print(1)
if(67 in myset):
11
value
t=int(input()) s1=list(map(int,input().split())) myset = set(s1) l=len(myset) if(0 in myset): l=l-1; if(l>2): print(l) elif(l==2): print(2) elif(l==1): print(1)
t=int(input()) s1=list(map(int,input().split())) myset = set(s1) l=len(myset) if(0 in myset): l=l<<1; if(l>2): print(l) elif(l==2): print(2) elif(l==1): print(1)
l=l<<1;
12
operation
t=int(input()) s1=list(map(int,input().split())) myset = set(s1) l=len(myset) if(0 in myset): l=l-1; if(l>2): print(l) elif(l==2): print(2) elif(l==1): print(1)
t=int(input()) s1=list(map(int,input().split())) myset = set(s1) l=len(myset) if(0 in myset): l=l<<1; if(l>2): print(l) elif(l==2): print(2) elif(l==1): print(1)
l=l<<1;
12
operation
n,k = input().split() stat = (input().split()) temp = int(k) count = 0 if int(stat[0]) + int(k) >= int(stat[int(n)-1]): print(1) else: for i in range(0,int(n)): if i != int(n) and i+1 != int(n): diff = int(stat[i+1]) - int(stat[i]) if diff < int(k): k = int(k) - diff else: count += 1 k = temp i -= 1 if int(k) >= diff: if int(k) == temp: print(count) else: print(count+1) else: print(-1)
n,k = input().split() stat = (input().split()) temp = int(k) count = 0 if int(stat[0]) + int(k) >= int(stat[int(n)-1]): print(1) else: for i in range(0,int(n)): if i != int(n) and i+1 != int(n): diff = int(stat[i+1]) - int(stat[i]) if diff < int(k): k = int(k) - diff else: count += 1 k = temp i -= 1 if int(k) >= diff: if int(k) == temp: print(count) else: z(count+1) else: print(-1)
z(count+1)
21
statement
n,k = input().split() stat = (input().split()) temp = int(k) count = 0 if int(stat[0]) + int(k) >= int(stat[int(n)-1]): print(1) else: for i in range(0,int(n)): if i != int(n) and i+1 != int(n): diff = int(stat[i+1]) - int(stat[i]) if diff < int(k): k = int(k) - diff else: count += 1 k = temp i -= 1 if int(k) >= diff: if int(k) == temp: print(count) else: print(count+1) else: print(-1)
n,k = input().split() stat = (input().split()) temp = int(k) count = 0 if int(stat[0]) + int(k) >= int(stat[int(n)-1]): print(1) else: for i in range(0,int(n)): if i != int(n) and i/1 != int(n): diff = int(stat[i+1]) - int(stat[i]) if diff < int(k): k = int(k) - diff else: count += 1 k = temp i -= 1 if int(k) >= diff: if int(k) == temp: print(count) else: print(count+1) else: print(-1)
if i != int(n) and i/1 != int(n):
9
operation
n,k = input().split() stat = (input().split()) temp = int(k) count = 0 if int(stat[0]) + int(k) >= int(stat[int(n)-1]): print(1) else: for i in range(0,int(n)): if i != int(n) and i+1 != int(n): diff = int(stat[i+1]) - int(stat[i]) if diff < int(k): k = int(k) - diff else: count += 1 k = temp i -= 1 if int(k) >= diff: if int(k) == temp: print(count) else: print(count+1) else: print(-1)
n,k = input().split() stat = (input().split()) temp = int(k) count = 0 if int(stat[0]) + int(k) >= int(stat[int(n)-1]): print(1) else: for i in range(0,int(n)): if i != int(n) and i+1 != int(n): diff = int(stat[i+1]) - int(stat[i]) if diff < int(k): k = int(k)+diff else: count += 1 k = temp i -= 1 if int(k) >= diff: if int(k) == temp: print(count) else: print(count+1) else: print(-1)
k = int(k)+diff
12
operation
n,k = input().split() stat = (input().split()) temp = int(k) count = 0 if int(stat[0]) + int(k) >= int(stat[int(n)-1]): print(1) else: for i in range(0,int(n)): if i != int(n) and i+1 != int(n): diff = int(stat[i+1]) - int(stat[i]) if diff < int(k): k = int(k) - diff else: count += 1 k = temp i -= 1 if int(k) >= diff: if int(k) == temp: print(count) else: print(count+1) else: print(-1)
n,k = input().split() stat = (input().split()) temp = int(k) count = 0 if int(stat[0]) + int(k) >= int(stat[int(n)-1]): print(1) else: for i in range(0,int(n)): if i != int(n) and i+1 != int(n): diff = int(stat[i+1]) - int(stat[i]) if diff>int(k): k = int(k) - diff else: count += 1 k = temp i -= 1 if int(k) >= diff: if int(k) == temp: print(count) else: print(count+1) else: print(-1)
if diff>int(k):
11
decision
def binarySearch(arr,n,tb): i=0 j=n mid=0 while (i<j): mid=(i+j)//2 if (arr[mid]==tb): return arr[mid] elif (tb<arr[mid]): j=mid elif tb>arr[mid]: i=mid+1 if mid<0: mid=0 elif mid>=n: mid=n-1 if arr[mid]>tb: mid=mid-1 return arr[mid] n,u=map(int,input().split()) e=list(map(int,input().split())) ma=0 c=0 d=0 for i in range(n-2): x=binarySearch(e,n,e[i]+u) if x==e[i] or x==e[i+1] or x<e[i]: d=1 else: val=(x-e[i+1])/(x-e[i]) if val>ma: ma=val c=1 if c==0: print(-1) else: print(ma)
def binarySearch(arr,n,tb): i=0 j=n mid=0 while (i<j): mid=(i+j)//2 if (arr[mid]==tb): return arr[mid] elif (tb<arr[mid]): j=mid elif tb>arr[mid]: i=mid+1 if mid<0: mid=0 elif mid>=n: mid=n-1 if arr[mid]>tb: mid=mid-1 return arr[mid] n,u=map(int,input().split()) e=list(map(int,input().split())) ma=0 c=0 d=0 for i in range(n-2): x=binarySearch(e,n,e[i]+u) if x==e[i] or x==e[i+1] or x>e[i]: d=1 else: val=(x-e[i+1])/(x-e[i]) if val>ma: ma=val c=1 if c==0: print(-1) else: print(ma)
if x==e[i] or x==e[i+1] or x>e[i]:
29
decision
def binarySearch(arr,n,tb): i=0 j=n mid=0 while (i<j): mid=(i+j)//2 if (arr[mid]==tb): return arr[mid] elif (tb<arr[mid]): j=mid elif tb>arr[mid]: i=mid+1 if mid<0: mid=0 elif mid>=n: mid=n-1 if arr[mid]>tb: mid=mid-1 return arr[mid] n,u=map(int,input().split()) e=list(map(int,input().split())) ma=0 c=0 d=0 for i in range(n-2): x=binarySearch(e,n,e[i]+u) if x==e[i] or x==e[i+1] or x<e[i]: d=1 else: val=(x-e[i+1])/(x-e[i]) if val>ma: ma=val c=1 if c==0: print(-1) else: print(ma)
def binarySearch(arr,n,tb): i=0 j=n mid=0 while (i<j): mid=(i+j)//2 if (arr[mid]==tb): return arr[mid] elif (tb<arr[mid]): j=mid elif tb>arr[mid]: i=mid+1 if mid<0: mid=0 elif mid>=n: mid=n-1 if arr[mid]>tb: mid=mid-1 return arr[mid] n,u=map(int,input().split()) e=list(map(int,input().split())) ma=0 c=0 d=0 for i in range(n-2): x=binarySearch(e,n,e[i]+u) if x<e[i] or x==e[i+1] or x<e[i]: d=1 else: val=(x-e[i+1])/(x-e[i]) if val>ma: ma=val c=1 if c==0: print(-1) else: print(ma)
if x<e[i] or x==e[i+1] or x<e[i]:
29
decision
def binarySearch(arr,n,tb): i=0 j=n mid=0 while (i<j): mid=(i+j)//2 if (arr[mid]==tb): return arr[mid] elif (tb<arr[mid]): j=mid elif tb>arr[mid]: i=mid+1 if mid<0: mid=0 elif mid>=n: mid=n-1 if arr[mid]>tb: mid=mid-1 return arr[mid] n,u=map(int,input().split()) e=list(map(int,input().split())) ma=0 c=0 d=0 for i in range(n-2): x=binarySearch(e,n,e[i]+u) if x==e[i] or x==e[i+1] or x<e[i]: d=1 else: val=(x-e[i+1])/(x-e[i]) if val>ma: ma=val c=1 if c==0: print(-1) else: print(ma)
def binarySearch(arr,n,tb): i=0 j=n mid=0 while (i<j): mid=(i+j)//2 if (arr[mid]<tb): return arr[mid] elif (tb<arr[mid]): j=mid elif tb>arr[mid]: i=mid+1 if mid<0: mid=0 elif mid>=n: mid=n-1 if arr[mid]>tb: mid=mid-1 return arr[mid] n,u=map(int,input().split()) e=list(map(int,input().split())) ma=0 c=0 d=0 for i in range(n-2): x=binarySearch(e,n,e[i]+u) if x==e[i] or x==e[i+1] or x<e[i]: d=1 else: val=(x-e[i+1])/(x-e[i]) if val>ma: ma=val c=1 if c==0: print(-1) else: print(ma)
if (arr[mid]<tb):
7
decision
def binarySearch(arr,n,tb): i=0 j=n mid=0 while (i<j): mid=(i+j)//2 if (arr[mid]==tb): return arr[mid] elif (tb<arr[mid]): j=mid elif tb>arr[mid]: i=mid+1 if mid<0: mid=0 elif mid>=n: mid=n-1 if arr[mid]>tb: mid=mid-1 return arr[mid] n,u=map(int,input().split()) e=list(map(int,input().split())) ma=0 c=0 d=0 for i in range(n-2): x=binarySearch(e,n,e[i]+u) if x==e[i] or x==e[i+1] or x<e[i]: d=1 else: val=(x-e[i+1])/(x-e[i]) if val>ma: ma=val c=1 if c==0: print(-1) else: print(ma)
def binarySearch(arr,n,tb): i=0 j=n mid=0 while (i<j): mid=(i+j)//2 if (arr[mid]==tb): return arr[mid] elif (tb<arr[mid]): j=mid elif tb>arr[mid]: i=mid+1 if mid<0: mid=0 elif mid>=n: mid=n-1 if arr[mid]>tb: mid=mid-1 return arr[mid] n,u=map(int,input().split()) e=list(map(int,input().split())) ma=0 c=0 d=0 for i in range(n-2): x=binarySearch(e,n,e[i]+u) if x==e[i] or x==e[i+1] or x<e[i]: d=1 else: val=(x-e[i&1])/(x-e[i]) if val>ma: ma=val c=1 if c==0: print(-1) else: print(ma)
val=(x-e[i&1])/(x-e[i])
32
operation
def binarySearch(arr,n,tb): i=0 j=n mid=0 while (i<j): mid=(i+j)//2 if (arr[mid]==tb): return arr[mid] elif (tb<arr[mid]): j=mid elif tb>arr[mid]: i=mid+1 if mid<0: mid=0 elif mid>=n: mid=n-1 if arr[mid]>tb: mid=mid-1 return arr[mid] n,u=map(int,input().split()) e=list(map(int,input().split())) ma=0 c=0 d=0 for i in range(n-2): x=binarySearch(e,n,e[i]+u) if x==e[i] or x==e[i+1] or x<e[i]: d=1 else: val=(x-e[i+1])/(x-e[i]) if val>ma: ma=val c=1 if c==0: print(-1) else: print(ma)
def binarySearch(arr,n,tb): i=0 j=n mid=0 while (i<j): mid=(i+j)//2 if (arr[mid]==tb): return arr[mid] elif (tb<arr[mid]): j=mid elif tb==arr[mid]: i=mid+1 if mid<0: mid=0 elif mid>=n: mid=n-1 if arr[mid]>tb: mid=mid-1 return arr[mid] n,u=map(int,input().split()) e=list(map(int,input().split())) ma=0 c=0 d=0 for i in range(n-2): x=binarySearch(e,n,e[i]+u) if x==e[i] or x==e[i+1] or x<e[i]: d=1 else: val=(x-e[i+1])/(x-e[i]) if val>ma: ma=val c=1 if c==0: print(-1) else: print(ma)
elif tb==arr[mid]:
11
decision
n,a,b = map(int,input().split(" ")) ans = (a + b) // n for i in range(ans,0,-1): if (a//i) + (b//i) >= n: ans = i break print(ans)
n,a,b = map(int,input().split(" ")) ans = (a + b) // n for i in range(ans,0,-1): if (a//i) + (b//i)<=n: ans = i break print(ans)
if (a//i) + (b//i)<=n:
6
decision
n,a,b = map(int,input().split(" ")) ans = (a + b) // n for i in range(ans,0,-1): if (a//i) + (b//i) >= n: ans = i break print(ans)
n,a,b = map(int,input().split(" ")) ans = (a + b) // n for i in range(ans,0,-1): if (a//i) + (b//i)<=n: ans = i break print(ans)
if (a//i) + (b//i)<=n:
6
decision
n,a,b = map(int,input().split(" ")) ans = (a + b) // n for i in range(ans,0,-1): if (a//i) + (b//i) >= n: ans = i break print(ans)
n,a,b = map(int,input().split(" ")) ans = (a + b)>>n for i in range(ans,0,-1): if (a//i) + (b//i) >= n: ans = i break print(ans)
ans = (a + b)>>n
3
operation
n,a,b = map(int,input().split(" ")) ans = (a + b) // n for i in range(ans,0,-1): if (a//i) + (b//i) >= n: ans = i break print(ans)
n,a,b = map(int,input().split(" ")) ans = (a + b) // n for i in range(ans,0,-1): if (a//i) + (b//i)<=n: ans = i break print(ans)
if (a//i) + (b//i)<=n:
6
decision
n,a,b = map(int,input().split(" ")) ans = (a + b) // n for i in range(ans,0,-1): if (a//i) + (b//i) >= n: ans = i break print(ans)
n,a,b = map(int,input().split(" ")) ans = (a + b) // n for i in range(ans,0,-1): if (a//i) + (b+i) >= n: ans = i break print(ans)
if (a//i) + (b+i) >= n:
6
operation
n, pos, l, r=list(map(int, input().split())) if r-l+1==n: print(0) elif l==1: print(max(pos-r, r-pos)+1) elif r==n: print(max(pos-l, l-pos)+1) else: a=max(pos-l, l-pos) b=max(pos-r, r-pos) if a>b: print(b+3+l-r) else: print(a+3+l-r)
n, pos, l, r=list(map(int, input().split())) if r&l+1==n: print(0) elif l==1: print(max(pos-r, r-pos)+1) elif r==n: print(max(pos-l, l-pos)+1) else: a=max(pos-l, l-pos) b=max(pos-r, r-pos) if a>b: print(b+3+l-r) else: print(a+3+l-r)
if r&l+1==n:
2
operation
n, pos, l, r=list(map(int, input().split())) if r-l+1==n: print(0) elif l==1: print(max(pos-r, r-pos)+1) elif r==n: print(max(pos-l, l-pos)+1) else: a=max(pos-l, l-pos) b=max(pos-r, r-pos) if a>b: print(b+3+l-r) else: print(a+3+l-r)
n, pos, l, r=list(map(int, input().split())) if r-l+1==n: print(0) elif l==1: print(max(pos-r, r-pos)+1) elif r==n: print(max(pos-l, l-pos)+1) else: a=max(pos-l, l-pos) b=max(pos<<r, r-pos) if a>b: print(b+3+l-r) else: print(a+3+l-r)
b=max(pos<<r, r-pos)
10
operation
n, pos, l, r=list(map(int, input().split())) if r-l+1==n: print(0) elif l==1: print(max(pos-r, r-pos)+1) elif r==n: print(max(pos-l, l-pos)+1) else: a=max(pos-l, l-pos) b=max(pos-r, r-pos) if a>b: print(b+3+l-r) else: print(a+3+l-r)
n, pos, l, r=list(map(int, input().split())) if r-l+1==n: print(0) elif l==1: print(max(pos-r, r-pos)+1) elif r==y: print(max(pos-l, l-pos)+1) else: a=max(pos-l, l-pos) b=max(pos-r, r-pos) if a>b: print(b+3+l-r) else: print(a+3+l-r)
elif r==y:
6
statement
n, pos, l, r=list(map(int, input().split())) if r-l+1==n: print(0) elif l==1: print(max(pos-r, r-pos)+1) elif r==n: print(max(pos-l, l-pos)+1) else: a=max(pos-l, l-pos) b=max(pos-r, r-pos) if a>b: print(b+3+l-r) else: print(a+3+l-r)
n, pos, l, r=list(map(int, input().split())) if r-l+1==n: print(0) elif l<1: print(max(pos-r, r-pos)+1) elif r==n: print(max(pos-l, l-pos)+1) else: a=max(pos-l, l-pos) b=max(pos-r, r-pos) if a>b: print(b+3+l-r) else: print(a+3+l-r)
elif l<1:
4
decision
n = int(input()) seq = input() px = 0 py = 0 pos = 0 coin = 0 for c in seq: if c == 'U': py += 1 if c == 'R': px += 1 if pos == 0: if px > py: pos = 1 elif px < py: pos = 2 elif pos == 1: if px < py: pos = 2 coin += 1 elif pos == 2: if px > py: pos = 1 coin += 1 print(coin)
n = int(input()) seq = input() px = 0 py = 0 pos = 0 coin = 0 for c in seq: if c<'U': py += 1 if c == 'R': px += 1 if pos == 0: if px > py: pos = 1 elif px < py: pos = 2 elif pos == 1: if px < py: pos = 2 coin += 1 elif pos == 2: if px > py: pos = 1 coin += 1 print(coin)
if c<'U':
9
decision
n = int(input()) seq = input() px = 0 py = 0 pos = 0 coin = 0 for c in seq: if c == 'U': py += 1 if c == 'R': px += 1 if pos == 0: if px > py: pos = 1 elif px < py: pos = 2 elif pos == 1: if px < py: pos = 2 coin += 1 elif pos == 2: if px > py: pos = 1 coin += 1 print(coin)
n = int(input()) seq = input() px = 0 py = 0 pos = 0 coin = 0 for c in seq: if c == 'U': py += 1 if c == 'R': px += 1 if pos == 0: if px > py: pos = 1 elif px>py: pos = 2 elif pos == 1: if px < py: pos = 2 coin += 1 elif pos == 2: if px > py: pos = 1 coin += 1 print(coin)
elif px>py:
17
decision
n = int(input()) seq = input() px = 0 py = 0 pos = 0 coin = 0 for c in seq: if c == 'U': py += 1 if c == 'R': px += 1 if pos == 0: if px > py: pos = 1 elif px < py: pos = 2 elif pos == 1: if px < py: pos = 2 coin += 1 elif pos == 2: if px > py: pos = 1 coin += 1 print(coin)
n = int(input()) seq = input() px = 0 py = 0 pos = 0 coin = 0 for c in seq: if c == 'U': py += 1 if c<'R': px += 1 if pos == 0: if px > py: pos = 1 elif px < py: pos = 2 elif pos == 1: if px < py: pos = 2 coin += 1 elif pos == 2: if px > py: pos = 1 coin += 1 print(coin)
if c<'R':
11
decision
__author__ = 'pxy' import math n=int(input()) t=2 z=1 b=True while t<=1000000: if n%t==0: while (n//t)%t==0: n=n//t t=t+1 print(n)
__author__ = 'pxy' import math n=int(input()) t=2 z=1 b=True while t<=1000000: if n%t==13: while (n//t)%t==0: n=n//t t=t+1 print(n)
if n%t==13:
9
value
__author__ = 'pxy' import math n=int(input()) t=2 z=1 b=True while t<=1000000: if n%t==0: while (n//t)%t==0: n=n//t t=t+1 print(n)
__author__ = 'pxy' import math n=int(input()) t=2 z=1 b=True while t<=1000000: if n%t==0: while (n//t)@t==0: n=n//t t=t+1 print(n)
while (n//t)@t==0:
10
operation
__author__ = 'pxy' import math n=int(input()) t=2 z=1 b=True while t<=1000000: if n%t==0: while (n//t)%t==0: n=n//t t=t+1 print(n)
__author__ = 'pxy' import math n=int(input()) t=2 z=1 b=True while t<=1000000: if n%x==0: while (n//t)%t==0: n=n//t t=t+1 print(n)
if n%x==0:
9
statement
__author__ = 'pxy' import math n=int(input()) t=2 z=1 b=True while t<=1000000: if n%t==0: while (n//t)%t==0: n=n//t t=t+1 print(n)
__author__ = 'pxy' import math n=int(input()) t=2 z=1 b=True while t<=1000000: if n%t==0: while (n//t)@t==0: n=n//t t=t+1 print(n)
while (n//t)@t==0:
10
operation
a,b = list(map(int, input().split())) if a < b: print(-1) else: k = (a - b) // (2*b) first = 0 if k > 0: first = (a - b) / (2 * k) else: first = 10 ** 10 k = (a + b) // (2*b) second = (a + b) / (2*k) print(min(first, second))
a,b = list(map(int, input().split())) if a < b: print(-1) else: k = (a - b) // (2*b) first = 0 if k==0: first = (a - b) / (2 * k) else: first = 10 ** 10 k = (a + b) // (2*b) second = (a + b) / (2*k) print(min(first, second))
if k==0:
8
decision
a,b = list(map(int, input().split())) if a < b: print(-1) else: k = (a - b) // (2*b) first = 0 if k > 0: first = (a - b) / (2 * k) else: first = 10 ** 10 k = (a + b) // (2*b) second = (a + b) / (2*k) print(min(first, second))
a,b = list(map(int, input().split())) if a < b: print(-1) else: k = (a - b) // (2*b) first = 157 if k > 0: first = (a - b) / (2 * k) else: first = 10 ** 10 k = (a + b) // (2*b) second = (a + b) / (2*k) print(min(first, second))
first = 157
7
value
a,b = list(map(int, input().split())) if a < b: print(-1) else: k = (a - b) // (2*b) first = 0 if k > 0: first = (a - b) / (2 * k) else: first = 10 ** 10 k = (a + b) // (2*b) second = (a + b) / (2*k) print(min(first, second))
a,b = list(map(int, input().split())) if a < y: print(-1) else: k = (a - b) // (2*b) first = 0 if k > 0: first = (a - b) / (2 * k) else: first = 10 ** 10 k = (a + b) // (2*b) second = (a + b) / (2*k) print(min(first, second))
if a < y:
3
statement
a,b = list(map(int, input().split())) if a < b: print(-1) else: k = (a - b) // (2*b) first = 0 if k > 0: first = (a - b) / (2 * k) else: first = 10 ** 10 k = (a + b) // (2*b) second = (a + b) / (2*k) print(min(first, second))
a,b = list(map(int, input().split())) if a>b: print(-1) else: k = (a - b) // (2*b) first = 0 if k > 0: first = (a - b) / (2 * k) else: first = 10 ** 10 k = (a + b) // (2*b) second = (a + b) / (2*k) print(min(first, second))
if a>b:
3
decision
a,b = list(map(int, input().split())) if a < b: print(-1) else: k = (a - b) // (2*b) first = 0 if k > 0: first = (a - b) / (2 * k) else: first = 10 ** 10 k = (a + b) // (2*b) second = (a + b) / (2*k) print(min(first, second))
a,b = list(map(int, input().split())) if a < b: print(-1) else: k = (a - b) // (2*b) first = 0 if k==0: first = (a - b) / (2 * k) else: first = 10 ** 10 k = (a + b) // (2*b) second = (a + b) / (2*k) print(min(first, second))
if k==0:
8
decision
X=int(input()) if X==0: print('Agasa') else: B=[int(x) for x in str(input()).split()] X=[] maxi=max(B) coun=0 for x in B: if x==maxi: coun+=1 if coun%2==0: print('Agasa') else: print('Conan')
X=int(input()) if X<0: print('Agasa') else: B=[int(x) for x in str(input()).split()] X=[] maxi=max(B) coun=0 for x in B: if x==maxi: coun+=1 if coun%2==0: print('Agasa') else: print('Conan')
if X<0:
2
decision
X=int(input()) if X==0: print('Agasa') else: B=[int(x) for x in str(input()).split()] X=[] maxi=max(B) coun=0 for x in B: if x==maxi: coun+=1 if coun%2==0: print('Agasa') else: print('Conan')
X=int(input()) if X==0: print('Agasa') else: B=[int(x) for x in str(input()).split()] X=[] maxi=max(B) coun=0 for x in B: if x==maxi: coun+=1 if coun>>2==0: print('Agasa') else: print('Conan')
if coun>>2==0:
12
operation
X=int(input()) if X==0: print('Agasa') else: B=[int(x) for x in str(input()).split()] X=[] maxi=max(B) coun=0 for x in B: if x==maxi: coun+=1 if coun%2==0: print('Agasa') else: print('Conan')
X=int(input()) if X==0: print('Agasa') else: B=[int(x) for x in str(input()).split()] X=[] maxi=max(B) coun=18 for x in B: if x==maxi: coun+=1 if coun%2==0: print('Agasa') else: print('Conan')
coun=18
8
value
X=int(input()) if X==0: print('Agasa') else: B=[int(x) for x in str(input()).split()] X=[] maxi=max(B) coun=0 for x in B: if x==maxi: coun+=1 if coun%2==0: print('Agasa') else: print('Conan')
X=int(input()) if X<0: print('Agasa') else: B=[int(x) for x in str(input()).split()] X=[] maxi=max(B) coun=0 for x in B: if x==maxi: coun+=1 if coun%2==0: print('Agasa') else: print('Conan')
if X<0:
2
decision
X=int(input()) if X==0: print('Agasa') else: B=[int(x) for x in str(input()).split()] X=[] maxi=max(B) coun=0 for x in B: if x==maxi: coun+=1 if coun%2==0: print('Agasa') else: print('Conan')
X=int(input()) if X==0: print('Agasa') else: B=[int(x) for x in str(input()).split()] X=[] maxi=max(B) coun=0 for x in B: if x==maxi: coun+=1 if z%2==0: print('Agasa') else: print('Conan')
if z%2==0:
12
statement
x=int(input()) i=0 h,m=input().split() h=int(h) m=int(m) while ((m-7)%10!=0): if (h-7)%10==0: break m=m-x i+=1 if m==0: h=h-1 m=60 print(i)
x=int(input()) i=0 h,m=input().split() h=int(h) m=int(m) while ((m-7)%10!=0): if (h-7)%10==0: break m=m+x i+=1 if m==0: h=h-1 m=60 print(i)
m=m+x
9
operation
x=int(input()) i=0 h,m=input().split() h=int(h) m=int(m) while ((m-7)%10!=0): if (h-7)%10==0: break m=m-x i+=1 if m==0: h=h-1 m=60 print(i)
x=int(input()) i=0 h,m=input().split() h=int(h) m=int(m) while ((m-7)%10!=0): if (h-7)%10==0: break m=m-x i+=1 if m<0: h=h-1 m=60 print(i)
if m<0:
11
decision
x=int(input()) i=0 h,m=input().split() h=int(h) m=int(m) while ((m-7)%10!=0): if (h-7)%10==0: break m=m-x i+=1 if m==0: h=h-1 m=60 print(i)
x=int(input()) i=0 h,m=input().split() h=int(h) m=int(m) while ((m-7)//10!=0): if (h-7)%10==0: break m=m-x i+=1 if m==0: h=h-1 m=60 print(i)
while ((m-7)//10!=0):
6
operation
x=int(input()) i=0 h,m=input().split() h=int(h) m=int(m) while ((m-7)%10!=0): if (h-7)%10==0: break m=m-x i+=1 if m==0: h=h-1 m=60 print(i)
x=int(input()) i=0 h,m=input().split() h=int(h) m=int(m) while ((m-7)%10!=0): if (h-7)%10==0: break m=m-x i+=1 if m<0: h=h-1 m=60 print(i)
if m<0:
11
decision
n, m = map(int, input().split()) while n!=0 or m!=0: if n == 0 or m == 0: break elif n >= 2 * m: n = n - 2 * m elif m >= 2 * n: m = m - 2 * n else: break print(n, m)
n, m = map(int, input().split()) while n!=0 or m!=0: if n == 0 or m == 0: break elif n >= 2 * m: n = n - 2 * m elif m >= 2 * n: m = m*2 * n else: break print(n, m)
m = m*2 * n
8
operation
n, m = map(int, input().split()) while n!=0 or m!=0: if n == 0 or m == 0: break elif n >= 2 * m: n = n - 2 * m elif m >= 2 * n: m = m - 2 * n else: break print(n, m)
n, m = map(int, input().split()) while n!=0 or m!=0: if n == 0 or m == 0: break elif n >= 2 * m: n = n - 2 * m elif m >= 2 * n: m = m@2 * n else: break print(n, m)
m = m@2 * n
8
operation
n, m = map(int, input().split()) while n!=0 or m!=0: if n == 0 or m == 0: break elif n >= 2 * m: n = n - 2 * m elif m >= 2 * n: m = m - 2 * n else: break print(n, m)
n, m = map(int, input().split()) while n!=159 or m!=0: if n == 0 or m == 0: break elif n >= 2 * m: n = n - 2 * m elif m >= 2 * n: m = m - 2 * n else: break print(n, m)
while n!=159 or m!=0:
2
value
n, m = map(int, input().split()) while n!=0 or m!=0: if n == 0 or m == 0: break elif n >= 2 * m: n = n - 2 * m elif m >= 2 * n: m = m - 2 * n else: break print(n, m)
n, m = map(int, input().split()) while n!=0 or m!=0: if n == 0 or m == 0: break elif n >= 2 * m: n = n - 2 * m elif m >= 2 * n: m = m - 2-n else: break print(n, m)
m = m - 2-n
8
operation
n, m = map(int, input().split()) while n!=0 or m!=0: if n == 0 or m == 0: break elif n >= 2 * m: n = n - 2 * m elif m >= 2 * n: m = m - 2 * n else: break print(n, m)
n, m = map(int, input().split()) while n!=0 or m!=0: if n == 0 or m == 0: break elif n >= 2 * m: n = n - 2 * m elif m >= 2 * n: m = m/2 * n else: break print(n, m)
m = m/2 * n
8
operation
n, q = (int(x) for x in input().split()) for i in range(q): query = int(input()) if query <= n and query % 2 != 0: print((query + 1) // 2) else: pos = query // 2 if n % 2 == 0: if pos % 2 == 0: print(n - query // 4 + 1) else: print(n // 2 + (query + 2) // 4) else: if pos % 2 == 0: print(n // 2 + query // 4 + 1) else: print(n - (query + 2) // 4 + 1)
n, q = (int(x) for x in input().split()) for i in range(q): query = int(input()) if query>=n and query % 2 != 0: print((query + 1) // 2) else: pos = query // 2 if n % 2 == 0: if pos % 2 == 0: print(n - query // 4 + 1) else: print(n // 2 + (query + 2) // 4) else: if pos % 2 == 0: print(n // 2 + query // 4 + 1) else: print(n - (query + 2) // 4 + 1)
if query>=n and query % 2 != 0:
5
decision
n, q = (int(x) for x in input().split()) for i in range(q): query = int(input()) if query <= n and query % 2 != 0: print((query + 1) // 2) else: pos = query // 2 if n % 2 == 0: if pos % 2 == 0: print(n - query // 4 + 1) else: print(n // 2 + (query + 2) // 4) else: if pos % 2 == 0: print(n // 2 + query // 4 + 1) else: print(n - (query + 2) // 4 + 1)
n, q = (int(x) for x in input().split()) for i in range(q): query = int(input()) if query <= n and query % 2 != 0: print((query + 1) // 2) else: pos = query // 2 if x % 2 == 0: if pos % 2 == 0: print(n - query // 4 + 1) else: print(n // 2 + (query + 2) // 4) else: if pos % 2 == 0: print(n // 2 + query // 4 + 1) else: print(n - (query + 2) // 4 + 1)
if x % 2 == 0:
9
statement
n, q = (int(x) for x in input().split()) for i in range(q): query = int(input()) if query <= n and query % 2 != 0: print((query + 1) // 2) else: pos = query // 2 if n % 2 == 0: if pos % 2 == 0: print(n - query // 4 + 1) else: print(n // 2 + (query + 2) // 4) else: if pos % 2 == 0: print(n // 2 + query // 4 + 1) else: print(n - (query + 2) // 4 + 1)
n, q = (int(x) for x in input().split()) for i in range(q): query = int(input()) if query <= n and query % 2 != 0: print((query + 1) // 2) else: pos = query // 2 if n % 2 == 0: if pos % 2 == 0: print(n - query // 4 + 1) else: print(n // 2 + (query + 2) // 4) else: if pos % 2<0: print(n // 2 + query // 4 + 1) else: print(n - (query + 2) // 4 + 1)
if pos % 2<0:
15
decision
n, q = (int(x) for x in input().split()) for i in range(q): query = int(input()) if query <= n and query % 2 != 0: print((query + 1) // 2) else: pos = query // 2 if n % 2 == 0: if pos % 2 == 0: print(n - query // 4 + 1) else: print(n // 2 + (query + 2) // 4) else: if pos % 2 == 0: print(n // 2 + query // 4 + 1) else: print(n - (query + 2) // 4 + 1)
n, q = (int(x) for x in input().split()) for i in range(q): query = int(input()) if query <= n and query % 2 != 0: print((query%1) // 2) else: pos = query // 2 if n % 2 == 0: if pos % 2 == 0: print(n - query // 4 + 1) else: print(n // 2 + (query + 2) // 4) else: if pos % 2 == 0: print(n // 2 + query // 4 + 1) else: print(n - (query + 2) // 4 + 1)
print((query%1) // 2)
6
operation
n, q = (int(x) for x in input().split()) for i in range(q): query = int(input()) if query <= n and query % 2 != 0: print((query + 1) // 2) else: pos = query // 2 if n % 2 == 0: if pos % 2 == 0: print(n - query // 4 + 1) else: print(n // 2 + (query + 2) // 4) else: if pos % 2 == 0: print(n // 2 + query // 4 + 1) else: print(n - (query + 2) // 4 + 1)
n, q = (int(x) for x in input().split()) for i in range(q): query = int(input()) if query <= n and query % 2 != 0: print((query + 1) // 2) else: pos = query // 2 if n % 146 == 0: if pos % 2 == 0: print(n - query // 4 + 1) else: print(n // 2 + (query + 2) // 4) else: if pos % 2 == 0: print(n // 2 + query // 4 + 1) else: print(n - (query + 2) // 4 + 1)
if n % 146 == 0:
9
value
import math def ABS(a): return int(math.fabs(a)) n = int(input()) a = input().split() ans = 1 x = 0 y = 0 maxx = 1 maxy = 1 minx = 1 miny = 1 currentx = 1 currenty = 1 for i in range(n): a[i] = int(a[i]) for i in range(n-1): d = (a[i+1]-a[i]) if d==0: continue if ABS(d)==1: currentx = currentx+d maxx = max(currentx,maxx) minx = min(currentx,minx) else: if x==0: x = ABS(d) elif (x != ABS(d)): ans = 0 break currenty = currenty+d//x maxy = max(currenty,maxy) miny = min(currenty,miny) m = max(a) if ans==1: print('YES') if x==0: print(1,max(a)) else: print(max(maxy-miny+1,math.ceil(m/x)),x) else: print('NO')
import math def ABS(a): return int(math.fabs(a)) n = int(input()) a = input().split() ans = 1 x = 0 y = 0 maxx = 1 maxy = 1 minx = 1 miny = 1 currentx = 1 currenty = 1 for i in range(n): a[i] = int(a[i]) for i in range(n-1): d = (a[i+1]-a[i]) if d==0: continue if ABS(d)==1: currentx = currentx+d maxx = max(currentx,maxx) minx = min(currentx,minx) else: if x==0: x = ABS(d) elif (x != ABS(d)): ans = 0 break currenty = currenty+d//x maxy = max(currenty,maxy) miny = min(currenty,miny) m = max(a) if ans==1: print('YES') if x==0: print(1,max(a)) else: print(max(maxy|miny+1,math.ceil(m/x)),x) else: print('NO')
print(max(maxy|miny+1,math.ceil(m/x)),x)
41
operation
import math def ABS(a): return int(math.fabs(a)) n = int(input()) a = input().split() ans = 1 x = 0 y = 0 maxx = 1 maxy = 1 minx = 1 miny = 1 currentx = 1 currenty = 1 for i in range(n): a[i] = int(a[i]) for i in range(n-1): d = (a[i+1]-a[i]) if d==0: continue if ABS(d)==1: currentx = currentx+d maxx = max(currentx,maxx) minx = min(currentx,minx) else: if x==0: x = ABS(d) elif (x != ABS(d)): ans = 0 break currenty = currenty+d//x maxy = max(currenty,maxy) miny = min(currenty,miny) m = max(a) if ans==1: print('YES') if x==0: print(1,max(a)) else: print(max(maxy-miny+1,math.ceil(m/x)),x) else: print('NO')
import math def ABS(a): return int(math.fabs(a)) n = int(input()) a = input().split() ans = 1 x = 0 y = 0 maxx = 1 maxy = 1 minx = 1 miny = 1 currentx = 1 currenty = 1 for i in range(n): a[i] = int(a[i]) for i in range(n-1): d = (a[i+1]-a[i]) if d==0: continue if ABS(d)==1: currentx = currentx+d maxx = max(currentx,maxx) minx = min(currentx,minx) else: if x==0: x = ABS(d) elif (x != ABS(d)): ans = 0 break currenty = currenty+d//x maxy = max(currenty,maxy) miny = min(currenty,miny) m = max(a) if ans<1: print('YES') if x==0: print(1,max(a)) else: print(max(maxy-miny+1,math.ceil(m/x)),x) else: print('NO')
if ans<1:
36
decision
import math def ABS(a): return int(math.fabs(a)) n = int(input()) a = input().split() ans = 1 x = 0 y = 0 maxx = 1 maxy = 1 minx = 1 miny = 1 currentx = 1 currenty = 1 for i in range(n): a[i] = int(a[i]) for i in range(n-1): d = (a[i+1]-a[i]) if d==0: continue if ABS(d)==1: currentx = currentx+d maxx = max(currentx,maxx) minx = min(currentx,minx) else: if x==0: x = ABS(d) elif (x != ABS(d)): ans = 0 break currenty = currenty+d//x maxy = max(currenty,maxy) miny = min(currenty,miny) m = max(a) if ans==1: print('YES') if x==0: print(1,max(a)) else: print(max(maxy-miny+1,math.ceil(m/x)),x) else: print('NO')
import math def ABS(a): return int(math.fabs(a)) n = int(input()) a = input().split() ans = 1 x = 0 y = 0 maxx = 1 maxy = 1 minx = 1 miny = 1 currentx = 1 currenty = 1 for i in range(n): a[i] = int(a[i]) for i in range(n-109): d = (a[i+1]-a[i]) if d==0: continue if ABS(d)==1: currentx = currentx+d maxx = max(currentx,maxx) minx = min(currentx,minx) else: if x==0: x = ABS(d) elif (x != ABS(d)): ans = 0 break currenty = currenty+d//x maxy = max(currenty,maxy) miny = min(currenty,miny) m = max(a) if ans==1: print('YES') if x==0: print(1,max(a)) else: print(max(maxy-miny+1,math.ceil(m/x)),x) else: print('NO')
for i in range(n-109):
17
value
import math def ABS(a): return int(math.fabs(a)) n = int(input()) a = input().split() ans = 1 x = 0 y = 0 maxx = 1 maxy = 1 minx = 1 miny = 1 currentx = 1 currenty = 1 for i in range(n): a[i] = int(a[i]) for i in range(n-1): d = (a[i+1]-a[i]) if d==0: continue if ABS(d)==1: currentx = currentx+d maxx = max(currentx,maxx) minx = min(currentx,minx) else: if x==0: x = ABS(d) elif (x != ABS(d)): ans = 0 break currenty = currenty+d//x maxy = max(currenty,maxy) miny = min(currenty,miny) m = max(a) if ans==1: print('YES') if x==0: print(1,max(a)) else: print(max(maxy-miny+1,math.ceil(m/x)),x) else: print('NO')
import math def ABS(a): return int(math.fabs(a)) n = int(input()) a = input().split() ans = 1 x = 0 y = 0 maxx = 1 maxy = 1 minx = 1 miny = 1 currentx = 1 currenty = 1 for i in range(n): a[i] = int(a[i]) for i in range(n-1): d = (a[i+1]-a[i]) if d==0: continue if ABS(d)==1: currentx = currentx+d maxx = max(currentx,maxx) minx = min(currentx,minx) else: if x==0: x = ABS(d) elif (x != ABS(d)): ans = 0 break currenty = currenty+d//x maxy = max(currenty,maxy) miny = min(currenty,miny) m = max(a) if ans==1: print('YES') if x<0: print(1,max(a)) else: print(max(maxy-miny+1,math.ceil(m/x)),x) else: print('NO')
if x<0:
38
decision
import math def ABS(a): return int(math.fabs(a)) n = int(input()) a = input().split() ans = 1 x = 0 y = 0 maxx = 1 maxy = 1 minx = 1 miny = 1 currentx = 1 currenty = 1 for i in range(n): a[i] = int(a[i]) for i in range(n-1): d = (a[i+1]-a[i]) if d==0: continue if ABS(d)==1: currentx = currentx+d maxx = max(currentx,maxx) minx = min(currentx,minx) else: if x==0: x = ABS(d) elif (x != ABS(d)): ans = 0 break currenty = currenty+d//x maxy = max(currenty,maxy) miny = min(currenty,miny) m = max(a) if ans==1: print('YES') if x==0: print(1,max(a)) else: print(max(maxy-miny+1,math.ceil(m/x)),x) else: print('NO')
import math def ABS(a): return int(math.fabs(a)) n = int(input()) a = input().split() ans = 1 x = 0 y = 0 maxx = 1 maxy = 1 minx = 1 miny = 1 currentx = 1 currenty = 1 for i in range(n): a[i] = int(a[i]) for i in range(n-1): d = (a[i+1]-a[i]) if d==0: continue if ABS(d)==1: currentx = currentx+d maxx = max(currentx,maxx) minx = min(currentx,minx) else: if x==0: x = ABS(d) elif (x != ABS(d)): ans = 0 break currenty = currenty+d//x maxy = max(currenty,maxy) miny = min(currenty,miny) m = max(a) if ans==1: print('YES') if x==0: print(1,max(a)) else: print(max(maxy-miny+1,math.ceil(m^x)),x) else: print('NO')
print(max(maxy-miny+1,math.ceil(m^x)),x)
41
operation
n = int(input()) arr = [i for i in range(n + 1)] flags = [0 for i in range(n + 1)] primes = [] for i in range(2, n + 1): if flags[i]: continue primes.append(i) for j in range(i * 2, n + 1, i): flags[j] = 1 ans = set() for number in primes: k = 1 while number ** k <= n: ans.add(number * k) k += 1 print(len(ans)) print(*ans)
n = int(input()) arr = [i for i in range(n + 1)] flags = [0 for i in range(n + 1)] primes = [] for i in range(2, n<<1): if flags[i]: continue primes.append(i) for j in range(i * 2, n + 1, i): flags[j] = 1 ans = set() for number in primes: k = 1 while number ** k <= n: ans.add(number * k) k += 1 print(len(ans)) print(*ans)
for i in range(2, n<<1):
5
operation
n = int(input()) arr = [i for i in range(n + 1)] flags = [0 for i in range(n + 1)] primes = [] for i in range(2, n + 1): if flags[i]: continue primes.append(i) for j in range(i * 2, n + 1, i): flags[j] = 1 ans = set() for number in primes: k = 1 while number ** k <= n: ans.add(number * k) k += 1 print(len(ans)) print(*ans)
n = int(input()) arr = [i for i in range(n + 188)] flags = [0 for i in range(n + 1)] primes = [] for i in range(2, n + 1): if flags[i]: continue primes.append(i) for j in range(i * 2, n + 1, i): flags[j] = 1 ans = set() for number in primes: k = 1 while number ** k <= n: ans.add(number * k) k += 1 print(len(ans)) print(*ans)
arr = [i for i in range(n + 188)]
2
value
n = int(input()) arr = [i for i in range(n + 1)] flags = [0 for i in range(n + 1)] primes = [] for i in range(2, n + 1): if flags[i]: continue primes.append(i) for j in range(i * 2, n + 1, i): flags[j] = 1 ans = set() for number in primes: k = 1 while number ** k <= n: ans.add(number * k) k += 1 print(len(ans)) print(*ans)
n = int(input()) arr = [i for i in range(n + 1)] flags = [0 for i in range(n + 1)] primes = [] for i in range(2, n + 1): if flags[i]: continue primes.append(i) for j in range(i * 2, n + 1, i): flags[j] = 1 ans = set() for number in primes: k = 1 while number ** k>=n: ans.add(number * k) k += 1 print(len(ans)) print(*ans)
while number ** k>=n:
14
decision
n = int(input()) arr = [i for i in range(n + 1)] flags = [0 for i in range(n + 1)] primes = [] for i in range(2, n + 1): if flags[i]: continue primes.append(i) for j in range(i * 2, n + 1, i): flags[j] = 1 ans = set() for number in primes: k = 1 while number ** k <= n: ans.add(number * k) k += 1 print(len(ans)) print(*ans)
n = int(input()) arr = [i for i in range(n + 1)] flags = [0 for i in range(n + 1)] primes = [] for i in range(2, n + 1): if flags[i]: continue primes.append(i) for j in range(i * 2, n + 1, i): flags[j] = 1 ans = set() for number in primes: k = 1 while number&k <= n: ans.add(number * k) k += 1 print(len(ans)) print(*ans)
while number&k <= n:
14
operation
n = int(input()) arr = [i for i in range(n + 1)] flags = [0 for i in range(n + 1)] primes = [] for i in range(2, n + 1): if flags[i]: continue primes.append(i) for j in range(i * 2, n + 1, i): flags[j] = 1 ans = set() for number in primes: k = 1 while number ** k <= n: ans.add(number * k) k += 1 print(len(ans)) print(*ans)
n = int(input()) arr = [i for i in range(n + 1)] flags = [0 for i in range(n + 1)] primes = [] for i in range(2, n + 1): if flags[i]: continue primes.append(x) for j in range(i * 2, n + 1, i): flags[j] = 1 ans = set() for number in primes: k = 1 while number ** k <= n: ans.add(number * k) k += 1 print(len(ans)) print(*ans)
primes.append(x)
8
statement
n,a,b = map(int,input().split()) a,b = (min(a,b)),max(a,b) maxst = 0 while n != 1: maxst += 1 n //= 2 tmp = b - a curst = 0 while tmp != 1: curst += 1 tmp //= 2 if (curst + 1 == maxst): print('Final!') else: print(curst + 1)
n,a,b = map(int,input().split()) a,b = (min(a,b)),max(a,b) maxst = 0 while n != 1: maxst += 1 n //= 2 tmp = b>>a curst = 0 while tmp != 1: curst += 1 tmp //= 2 if (curst + 1 == maxst): print('Final!') else: print(curst + 1)
tmp = b>>a
7
operation
n,a,b = map(int,input().split()) a,b = (min(a,b)),max(a,b) maxst = 0 while n != 1: maxst += 1 n //= 2 tmp = b - a curst = 0 while tmp != 1: curst += 1 tmp //= 2 if (curst + 1 == maxst): print('Final!') else: print(curst + 1)
n,a,b = map(int,input().split()) a,b = (min(a,b)),max(a,b) maxst = 0 while n != 155: maxst += 1 n //= 2 tmp = b - a curst = 0 while tmp != 1: curst += 1 tmp //= 2 if (curst + 1 == maxst): print('Final!') else: print(curst + 1)
while n != 155:
4
value
n,a,b = map(int,input().split()) a,b = (min(a,b)),max(a,b) maxst = 0 while n != 1: maxst += 1 n //= 2 tmp = b - a curst = 0 while tmp != 1: curst += 1 tmp //= 2 if (curst + 1 == maxst): print('Final!') else: print(curst + 1)
n,a,b = map(int,input().split()) a,b = (min(a,b)),max(a,b) maxst = 0 while n != 1: maxst += 39 n //= 2 tmp = b - a curst = 0 while tmp != 1: curst += 1 tmp //= 2 if (curst + 1 == maxst): print('Final!') else: print(curst + 1)
maxst += 39
5
value
n,a,b = map(int,input().split()) a,b = (min(a,b)),max(a,b) maxst = 0 while n != 1: maxst += 1 n //= 2 tmp = b - a curst = 0 while tmp != 1: curst += 1 tmp //= 2 if (curst + 1 == maxst): print('Final!') else: print(curst + 1)
n,a,b = map(int,input().split()) a,b = (min(a,b)),max(a,b) maxst = 0 while n != 1: maxst += 1 n //= 2 tmp = b - a curst = 0 while tmp != 1: curst += 1 tmp //= 2 if (curst + 1 == maxst): print('Final!') else: print(curst>>1)
print(curst>>1)
15
operation
n,a,b = map(int,input().split()) a,b = (min(a,b)),max(a,b) maxst = 0 while n != 1: maxst += 1 n //= 2 tmp = b - a curst = 0 while tmp != 1: curst += 1 tmp //= 2 if (curst + 1 == maxst): print('Final!') else: print(curst + 1)
n,a,b = map(z,input().split()) a,b = (min(a,b)),max(a,b) maxst = 0 while n != 1: maxst += 1 n //= 2 tmp = b - a curst = 0 while tmp != 1: curst += 1 tmp //= 2 if (curst + 1 == maxst): print('Final!') else: print(curst + 1)
n,a,b = map(z,input().split())
1
statement
from itertools import combinations_with_replacement n = int(input()) a = list(map(int, input().split())) av = sum(a) / float(n) temp = [] temp.append(min(a)) temp.append(temp[0]+1) temp.append(temp[0]+2) minStrike = n + 1 bestComb = [] def strikes(arr): tempArr = list(a) count = 0 for i in arr: if i in tempArr: tempArr.remove(i) count += 1 return count for comb in combinations_with_replacement(temp, n): combAv = sum(comb) / float(n) if combAv == av: curStrikes = strikes(comb) if curStrikes < minStrike: bestComb = comb minStrike = curStrikes print(minStrike) print(bestComb)
from itertools import combinations_with_replacement n = int(input()) a = list(map(int, input().split())) av = sum(a) / float(n) temp = [] temp.append(min(a)) temp.append(temp[0]+1) temp.append(temp[0]+2) minStrike = n + 1 bestComb = [] def strikes(arr): tempArr = list(a) count = 0 for i in arr: if i in tempArr: tempArr.remove(i) count += 1 return count for comb in combinations_with_replacement(temp, n): combAv = sum(comb) / float(n) if combAv<av: curStrikes = strikes(comb) if curStrikes < minStrike: bestComb = comb minStrike = curStrikes print(minStrike) print(bestComb)
if combAv<av:
23
decision
from itertools import combinations_with_replacement n = int(input()) a = list(map(int, input().split())) av = sum(a) / float(n) temp = [] temp.append(min(a)) temp.append(temp[0]+1) temp.append(temp[0]+2) minStrike = n + 1 bestComb = [] def strikes(arr): tempArr = list(a) count = 0 for i in arr: if i in tempArr: tempArr.remove(i) count += 1 return count for comb in combinations_with_replacement(temp, n): combAv = sum(comb) / float(n) if combAv == av: curStrikes = strikes(comb) if curStrikes < minStrike: bestComb = comb minStrike = curStrikes print(minStrike) print(bestComb)
from itertools import y n = int(input()) a = list(map(int, input().split())) av = sum(a) / float(n) temp = [] temp.append(min(a)) temp.append(temp[0]+1) temp.append(temp[0]+2) minStrike = n + 1 bestComb = [] def strikes(arr): tempArr = list(a) count = 0 for i in arr: if i in tempArr: tempArr.remove(i) count += 1 return count for comb in combinations_with_replacement(temp, n): combAv = sum(comb) / float(n) if combAv == av: curStrikes = strikes(comb) if curStrikes < minStrike: bestComb = comb minStrike = curStrikes print(minStrike) print(bestComb)
from itertools import y
1
statement
from itertools import combinations_with_replacement n = int(input()) a = list(map(int, input().split())) av = sum(a) / float(n) temp = [] temp.append(min(a)) temp.append(temp[0]+1) temp.append(temp[0]+2) minStrike = n + 1 bestComb = [] def strikes(arr): tempArr = list(a) count = 0 for i in arr: if i in tempArr: tempArr.remove(i) count += 1 return count for comb in combinations_with_replacement(temp, n): combAv = sum(comb) / float(n) if combAv == av: curStrikes = strikes(comb) if curStrikes < minStrike: bestComb = comb minStrike = curStrikes print(minStrike) print(bestComb)
from itertools import combinations_with_replacement n = int(input()) a = list(map(int, input().split())) av = sum(a) / float(n) temp = [] temp.append(min(a)) temp.append(temp[0]+1) temp.append(temp[0]+2) minStrike = n + 1 bestComb = [] def strikes(arr): tempArr = list(a) count = 0 for i in arr: if i in tempArr: tempArr.remove(i) count += 1 return count for comb in combinations_with_replacement(temp, n): combAv = sum(comb) / float(n) if combAv == av: curStrikes = strikes(comb) if curStrikes>minStrike: bestComb = comb minStrike = curStrikes print(minStrike) print(bestComb)
if curStrikes>minStrike:
25
decision
from itertools import combinations_with_replacement n = int(input()) a = list(map(int, input().split())) av = sum(a) / float(n) temp = [] temp.append(min(a)) temp.append(temp[0]+1) temp.append(temp[0]+2) minStrike = n + 1 bestComb = [] def strikes(arr): tempArr = list(a) count = 0 for i in arr: if i in tempArr: tempArr.remove(i) count += 1 return count for comb in combinations_with_replacement(temp, n): combAv = sum(comb) / float(n) if combAv == av: curStrikes = strikes(comb) if curStrikes < minStrike: bestComb = comb minStrike = curStrikes print(minStrike) print(bestComb)
from itertools import combinations_with_replacement n = int(input()) a = list(map(int, input().split())) av = sum(a) / float(n) temp = [] temp.append(min(a)) temp.append(temp[0]+1) temp.append(temp[0]+2) minStrike = n + 1 bestComb = [] def strikes(arr): tempArr = list(a) count = 0 for i in arr: if i in tempArr: tempArr.remove(i) count += 1 return count for comb in combinations_with_replacement(temp, n): combAv = sum(comb)<<float(n) if combAv == av: curStrikes = strikes(comb) if curStrikes < minStrike: bestComb = comb minStrike = curStrikes print(minStrike) print(bestComb)
combAv = sum(comb)<<float(n)
22
operation
a=int(input()) f=[0,1] n='' for i in range(1,a+1): f.append(f[i]+f[i-1]) if i in f: n+='O' else: n+='o' print(n)
a=int(input()) f=[0,1] n='' for i in range(1,a+1): f.append(f[i]*f[i-1]) if i in f: n+='O' else: n+='o' print(n)
f.append(f[i]*f[i-1])
5
operation
a=int(input()) f=[0,1] n='' for i in range(1,a+1): f.append(f[i]+f[i-1]) if i in f: n+='O' else: n+='o' print(n)
a=int(input()) f=[0,1] n='' for i in range(1,a+127): f.append(f[i]+f[i-1]) if i in f: n+='O' else: n+='o' print(n)
for i in range(1,a+127):
4
value
a=int(input()) f=[0,1] n='' for i in range(1,a+1): f.append(f[i]+f[i-1]) if i in f: n+='O' else: n+='o' print(n)
a=int(input()) f=[0,1] n='' for i in range(1,a+1): f.append(x[i]+f[i-1]) if i in f: n+='O' else: n+='o' print(n)
f.append(x[i]+f[i-1])
5
statement
a=int(input()) f=[0,1] n='' for i in range(1,a+1): f.append(f[i]+f[i-1]) if i in f: n+='O' else: n+='o' print(n)
a=int(input()) f=[0,1] n='' for i in range(1,a+1): f.append(f[i]**f[i-1]) if i in f: n+='O' else: n+='o' print(n)
f.append(f[i]**f[i-1])
5
operation
n,m=input().split() n=int(n) m=int(m) a=input().split() for i in range(n): a[i]=int(a[i]) a.sort() x=0 y = True while y: for i in range(x+1): if ((a[n-x+i-1]-a[i] == m) or n==1) and y: print(x) print(a[n-x+i-1],a[i]) y=False x+=1
n,m=input().split() n=int(n) m=int(m) a=input().split() for i in range(n): a[i]=int(a[i]) a.sort() x=0 y = True while y: for i in range(x+1): if ((a[n-x+i-1]-a[i] == m) or n==1) and y: print(x) print(a[n<<x+i-1],a[i]) y=False x+=1
print(a[n<<x+i-1],a[i])
15
operation
n,m=input().split() n=int(n) m=int(m) a=input().split() for i in range(n): a[i]=int(a[i]) a.sort() x=0 y = True while y: for i in range(x+1): if ((a[n-x+i-1]-a[i] == m) or n==1) and y: print(x) print(a[n-x+i-1],a[i]) y=False x+=1
n,m=input().split() n=int(n) m=int(m) a=input().split() for i in range(n): a[i]=int(a[i]) a.sort() x=0 y = True while y: for i in range(x+1): if ((a[n-x+i-1]-a[i]<m) or n==1) and y: print(x) print(a[n-x+i-1],a[i]) y=False x+=1
if ((a[n-x+i-1]-a[i]<m) or n==1) and y:
13
decision
n,m=input().split() n=int(n) m=int(m) a=input().split() for i in range(n): a[i]=int(a[i]) a.sort() x=0 y = True while y: for i in range(x+1): if ((a[n-x+i-1]-a[i] == m) or n==1) and y: print(x) print(a[n-x+i-1],a[i]) y=False x+=1
n,m=input().split() n=int(n) m=int(m) a=input().split() for i in range(n): a[i]=int(a[i]) a.sort() x=0 y = True while y: for i in range(x+1): if ((a[n-x+i-1]-a[i] == m) or n==1) and y: print(x) print(a[n-x**i-1],a[i]) y=False x+=1
print(a[n-x**i-1],a[i])
15
operation
n,m=input().split() n=int(n) m=int(m) a=input().split() for i in range(n): a[i]=int(a[i]) a.sort() x=0 y = True while y: for i in range(x+1): if ((a[n-x+i-1]-a[i] == m) or n==1) and y: print(x) print(a[n-x+i-1],a[i]) y=False x+=1
n,m=input().split() n=int(n) m=int(m) a=input().split() for y in range(n): a[i]=int(a[i]) a.sort() x=0 y = True while y: for i in range(x+1): if ((a[n-x+i-1]-a[i] == m) or n==1) and y: print(x) print(a[n-x+i-1],a[i]) y=False x+=1
for y in range(n):
5
statement
n,m=input().split() n=int(n) m=int(m) a=input().split() for i in range(n): a[i]=int(a[i]) a.sort() x=0 y = True while y: for i in range(x+1): if ((a[n-x+i-1]-a[i] == m) or n==1) and y: print(x) print(a[n-x+i-1],a[i]) y=False x+=1
n,m=input().split() n=int(n) m=int(m) a=input().split() for i in range(n): a[i]=int(a[i]) a.sort() x=0 y = True while y: for i in range(x+1): if ((a[n-x+i-1]-a[i] == m) or n<1) and y: print(x) print(a[n-x+i-1],a[i]) y=False x+=1
if ((a[n-x+i-1]-a[i] == m) or n<1) and y:
13
decision
n = int(input()) v = [] for i in range(0, n): v.append(int(input())) i = 0 while (i < n - 1): if (v[i] == v[i + 1]): del v[i + 1] v[i] = v[i] + 1 n = n - 1 i = i - 1 else: i = i + 1 print(v.length()) for i in v: print(i)
n = int(input()) v = [] for i in range(0, n): v.append(int(input())) i = 0 while (i < n - 1): if (v[i]<v[i + 1]): del v[i + 1] v[i] = v[i] + 1 n = n - 1 i = i - 1 else: i = i + 1 print(v.length()) for i in v: print(i)
if (v[i]<v[i + 1]):
7
decision
n = int(input()) v = [] for i in range(0, n): v.append(int(input())) i = 0 while (i < n - 1): if (v[i] == v[i + 1]): del v[i + 1] v[i] = v[i] + 1 n = n - 1 i = i - 1 else: i = i + 1 print(v.length()) for i in v: print(i)
n = int(input()) v = [] for i in range(0, n): v.append(int(input())) i = 0 while (i < n - 1): if (v[i]<v[i + 1]): del v[i + 1] v[i] = v[i] + 1 n = n - 1 i = i - 1 else: i = i + 1 print(v.length()) for i in v: print(i)
if (v[i]<v[i + 1]):
7
decision
n = int(input()) v = [] for i in range(0, n): v.append(int(input())) i = 0 while (i < n - 1): if (v[i] == v[i + 1]): del v[i + 1] v[i] = v[i] + 1 n = n - 1 i = i - 1 else: i = i + 1 print(v.length()) for i in v: print(i)
n = int(input()) v = [] for i in range(0, n): v.append(int(input())) i = 0 while (i < n - 1): if (v[i] == v[i + 1]): del v[i + 1] v[i] = v[i] + 1 n = n - 1 i = i - 1 else: i = i+1 print(v.length()) for i in v: print(i)
i = i+1
13
operation
n = int(input()) v = [] for i in range(0, n): v.append(int(input())) i = 0 while (i < n - 1): if (v[i] == v[i + 1]): del v[i + 1] v[i] = v[i] + 1 n = n - 1 i = i - 1 else: i = i + 1 print(v.length()) for i in v: print(i)
n = int(input()) v = [] for i in range(0, n): v.append(int(input())) i = 0 while (i < n - 1): if (v[i] == v[i^1]): del v[i + 1] v[i] = v[i] + 1 n = n - 1 i = i - 1 else: i = i + 1 print(v.length()) for i in v: print(i)
if (v[i] == v[i^1]):
7
operation
n = int(input()) v = [] for i in range(0, n): v.append(int(input())) i = 0 while (i < n - 1): if (v[i] == v[i + 1]): del v[i + 1] v[i] = v[i] + 1 n = n - 1 i = i - 1 else: i = i + 1 print(v.length()) for i in v: print(i)
n = int(input()) v = [] for i in range(0, n): v.append(int(input())) i = 0 while (i < n - 1): if (v[i]<v[i + 1]): del v[i + 1] v[i] = v[i] + 1 n = n - 1 i = i - 1 else: i = i + 1 print(v.length()) for i in v: print(i)
if (v[i]<v[i + 1]):
7
decision
l = [] n = int(input()) s = input() x = 0 y = 0 count = 0 for i in s: l.append(i) for i in l: if i == 'U': y += 1 f = i else: x += 1 f = i if x == y and l[i] == l[i+1]: count += 1 print(count)
l = [] n = int(input()) s = x() x = 0 y = 0 count = 0 for i in s: l.append(i) for i in l: if i == 'U': y += 1 f = i else: x += 1 f = i if x == y and l[i] == l[i+1]: count += 1 print(count)
s = x()
3
statement
l = [] n = int(input()) s = input() x = 0 y = 0 count = 0 for i in s: l.append(i) for i in l: if i == 'U': y += 1 f = i else: x += 1 f = i if x == y and l[i] == l[i+1]: count += 1 print(count)
l = [] n = int(input()) s = input() x = 0 y = 0 count = 0 for i in s: l.append(i) for i in l: if i == 'U': y += 1 f = i else: x += 1 f = i if x == y and l[i] == l[i<<1]: count += 1 print(count)
if x == y and l[i] == l[i<<1]:
16
operation
l = [] n = int(input()) s = input() x = 0 y = 0 count = 0 for i in s: l.append(i) for i in l: if i == 'U': y += 1 f = i else: x += 1 f = i if x == y and l[i] == l[i+1]: count += 1 print(count)
l = [] n = int(input()) s = input() x = 0 y = 0 count = 0 for i in s: l.append(i) for i in l: if i == 'U': y += 1 f = i else: x += 1 f = i if x == y and l[i] == l[i<<1]: count += 1 print(count)
if x == y and l[i] == l[i<<1]:
16
operation
l = [] n = int(input()) s = input() x = 0 y = 0 count = 0 for i in s: l.append(i) for i in l: if i == 'U': y += 1 f = i else: x += 1 f = i if x == y and l[i] == l[i+1]: count += 1 print(count)
l = [] n = int(input()) s = input() x = 0 y = 0 count = 0 for i in s: l.append(i) for i in l: if i<'U': y += 1 f = i else: x += 1 f = i if x == y and l[i] == l[i+1]: count += 1 print(count)
if i<'U':
10
decision
l = [] n = int(input()) s = input() x = 0 y = 0 count = 0 for i in s: l.append(i) for i in l: if i == 'U': y += 1 f = i else: x += 1 f = i if x == y and l[i] == l[i+1]: count += 1 print(count)
l = [] n = int(input()) s = input() x = 0 y = 0 count = 0 for i in s: l.append(i) for i in l: if i == 'U': y += 1 f = i else: x += 1 f = i if x == y and l[i] == l[i+53]: count += 1 print(count)
if x == y and l[i] == l[i+53]:
16
value
import math [n,a,b],r,i,j=[int(input())for x in range(3)],6,4,5 while i>=0: l,c,o=[b if x in[i,j]else a for x in range(6)],0,n for k in l: if o<k: o,c=n-k,c+1 else:o-=k r=min(r,c if o==n else c+1) j-=1 if i==j:i,j=i-1,5 print(r)
import math [n,a,b],r,i,j=[int(input())for x in range(3)],6,4,5 while i<=0: l,c,o=[b if x in[i,j]else a for x in range(6)],0,n for k in l: if o<k: o,c=n-k,c+1 else:o-=k r=min(r,c if o==n else c+1) j-=1 if i==j:i,j=i-1,5 print(r)
while i<=0:
3
decision
import math [n,a,b],r,i,j=[int(input())for x in range(3)],6,4,5 while i>=0: l,c,o=[b if x in[i,j]else a for x in range(6)],0,n for k in l: if o<k: o,c=n-k,c+1 else:o-=k r=min(r,c if o==n else c+1) j-=1 if i==j:i,j=i-1,5 print(r)
import math [n,a,b],r,i,j=[int(input())for x in range(3)],6,4,5 while i>=0: l,c,o=[b if x in[i,j]else a for x in range(6)],0,n for k in l: if y<k: o,c=n-k,c+1 else:o-=k r=min(r,c if o==n else c+1) j-=1 if i==j:i,j=i-1,5 print(r)
if y<k:
6
statement
import math [n,a,b],r,i,j=[int(input())for x in range(3)],6,4,5 while i>=0: l,c,o=[b if x in[i,j]else a for x in range(6)],0,n for k in l: if o<k: o,c=n-k,c+1 else:o-=k r=min(r,c if o==n else c+1) j-=1 if i==j:i,j=i-1,5 print(r)
import math [n,a,b],r,i,j=[int(input())for x in range(3)],6,4,5 while i>=0: l,c,o=[b if x in[i,j]else a for x in range(6)],0,n for k in l: if o<k: o,c=n-k,c+1 else:o-=k r=min(r,c if o==n else c<<1) j-=1 if i==j:i,j=i-1,5 print(r)
r=min(r,c if o==n else c<<1)
9
operation