Datasets:

problem_id
stringlengths
6
6
buggy_code
stringlengths
8
526k
fixed_code
stringlengths
12
526k
labels
listlengths
0
15
buggy_submission_id
int64
1
1.54M
fixed_submission_id
int64
2
1.54M
user_id
stringlengths
10
10
language
stringclasses
8 values
p02832
import sys n=int(input()) a = list(map(int, input().split())) ans = 0 _find = 1 before = 0 if not 1 in set(a): print(-1) sys.exit() for i in range(n): if a[i]==_find: ans += i-before _find += 1 before = i+1 print(ans)
import sys n=int(input()) a = list(map(int, input().split())) ans = 0 _find = 1 before = 0 if not 1 in set(a): print(-1) sys.exit() for i in range(n): if a[i]==_find: ans += i-before _find += 1 before = i+1 print(ans+n-before)
[ "expression.operation.binary.add" ]
634,926
634,927
u877415670
python
p02832
# ABC148D - Brick Break def main(): N, *A = map(int, open(0).read().split()) remaining = 0 cur = 0 # current index for target in range(1, N + 1): be_kept = False for i in range(cur, N): if A[i] == target: remaining += 1 cur += 1 be_kept = True break if not be_kept: break print(N - remaining if remaining else -1) if __name__ == "__main__": main()
# ABC148D - Brick Break def main(): N, *A = map(int, open(0).read().split()) remaining = 0 cur = 0 # current index for target in range(1, N + 1): be_kept = False for i in range(cur, N): if A[i] == target: remaining += 1 cur = i + 1 be_kept = True break if not be_kept: break print(N - remaining if remaining else -1) if __name__ == "__main__": main()
[ "assignment.value.change" ]
634,928
634,929
u077291787
python
p02832
def main(): N = int(input()) A = list(map(int, input().split(" "))) i = 1 flag = True for a in A: if a == 1: flag = False i += 1 if flag: print(-1) else: print(max(len(A) - i, 0)) if __name__ == "__main__": main()
def main(): N = int(input()) A = list(map(int, input().split(" "))) i = 1 flag = True for a in A: if a == i: flag = False i += 1 if flag: print(-1) else: print(len(A) - i + 1) if __name__ == "__main__": main()
[ "identifier.replace.add", "literal.replace.remove", "control_flow.branch.if.condition.change", "call.remove", "call.arguments.change" ]
634,940
634,941
u022979415
python
p02832
N = int(input()) A = list(map(int, input().split())) index = [] num = 1 tmp = 0 for i,a in enumerate(A): tmp += 1 if a == num: index.append(i+1) num += 1 tmp = 0 continue if num == 1: print(-1) else: ans = index[0]-1 for i in range(1, len(index)): ans += index[i] - index[i-1] - 1 + tmp print(ans)
N = int(input()) A = list(map(int, input().split())) index = [] num = 1 tmp = 0 for i,a in enumerate(A): tmp += 1 if a == num: index.append(i+1) num += 1 tmp = 0 continue if num == 1: print(-1) else: ans = index[0]-1 for i in range(1, len(index)): ans += index[i] - index[i-1] - 1 ans += tmp print(ans)
[ "expression.operation.binary.change" ]
634,944
634,945
u164368835
python
p02832
n = int(input()) a = list(map(int, input().split())) cnt = 0 flag = 0 for i in range(n): if flag + 1 != a[i]: cnt += 1 else: flag = a[i] if flag == n - cnt: print(cnt) else: print(-1)
n = int(input()) a = list(map(int, input().split())) cnt = 0 flag = 0 for i in range(n): if flag + 1 != a[i]: cnt += 1 else: flag = a[i] if cnt != n: print(cnt) else: print(-1)
[ "control_flow.branch.if.condition.change" ]
634,946
634,947
u597455618
python
p02832
from sys import stdin import fractions N = stdin.readline().rstrip().split() A = [int(x) for x in stdin.readline().rstrip().split()] # print(N) # print(A) nex = 1 ans = 0 for i in range(N): if A[i] == nex: nex += 1 else: ans += 1 print(-1) if N == ans else print(ans)
from sys import stdin import fractions N = int(stdin.readline().rstrip()) A = [int(x) for x in stdin.readline().rstrip().split()] # print(N) # print(A) nex = 1 ans = 0 for i in range(N): if A[i] == nex: nex += 1 else: ans += 1 print(-1) if N == ans else print(ans)
[ "call.add", "call.remove" ]
634,948
634,949
u973744316
python
p02832
import sys n = int(input()) a = list(map(int, input().split())) for i in range(n): if a[i] == 1: break else: pass else: print("-1") sys.exit() j = 1 for i in range(n): if a[i] == j: j += 1 else: pass print(str(n-j-1))
import sys n = int(input()) a = list(map(int, input().split())) for i in range(n): if a[i] == 1: break else: pass else: print("-1") sys.exit() j = 1 for i in range(n): if a[i] == j: j += 1 else: pass print(str(n-j+1))
[ "misc.opposites", "expression.operator.arithmetic.change", "call.arguments.change", "expression.operation.binary.change", "io.output.change" ]
634,950
634,951
u272336707
python
p02832
N = int(input()) #= map(int,input().split()) a =list(map(int,input().split())) # [list(map(int,input().split())) for i in range(N)] counter = 1 for i in range(N): if a[i]==counter: counter +=1 if counter == N: print('-1') else: print(N-counter+1)
N = int(input()) #= map(int,input().split()) a =list(map(int,input().split())) # [list(map(int,input().split())) for i in range(N)] counter = 1 for i in range(N): if a[i]==counter: counter +=1 if (N-counter+1)==N: print('-1') else: print(N-counter+1)
[ "control_flow.branch.if.condition.change" ]
634,962
634,963
u211236379
python
p02832
N = int(input()) a = [int(s) -1 for s in input().split()] result = 0 for i in range(N): if a[i] != (i-result): result += 1 if result == 0: print(-1) else: print(result)
N = int(input()) a = [int(s) -1 for s in input().split()] result = 0 for i in range(N): if a[i] != (i-result): result += 1 if result == N: print(-1) else: print(result)
[ "identifier.replace.add", "literal.replace.remove", "control_flow.branch.if.condition.change" ]
634,969
634,970
u140840711
python
p02832
n = int(input()) m = list(map(int, input().split())) ans = 0 if m == [i+1 for i in range(n)]: print(0) elif 1 not in m: print(-1) else: for i in m: if i == target: ans += 1 target += 1 print(n-ans)
n = int(input()) m = list(map(int, input().split())) ans = 0 if m == [i+1 for i in range(n)]: print(0) elif 1 not in m: print(-1) else: target = 1 for i in m: if i == target: ans += 1 target += 1 print(n-ans)
[ "assignment.add" ]
634,975
634,976
u007263493
python
p02832
n = int(input()) a = list(map(int,input().split())) cnt = 0 num = 1 for i in range(n): if a[i] == num: num += 1 cnt += 1 if cnt == 0: pirnt(-1) else: print(n - cnt)
n = int(input()) a = list(map(int,input().split())) cnt = 0 num = 1 for i in range(n): if a[i] == num: num += 1 cnt += 1 if cnt == 0: print(-1) else: print(n - cnt)
[ "identifier.change", "call.function.change" ]
634,977
634,978
u357230322
python
p02832
N = int(input()) li_str = input().split() li_int = [] for i in li_str: li_int.append(int(i)) count= 1 for i in li_int: if i == count: num = count count += 1 print(N - num)
N = int(input()) li_str = input().split() li_int = [] for i in li_str: li_int.append(int(i)) count= 1 num = N + 1 for i in li_int: if i == count: num = count count += 1 print(N - num)
[ "assignment.add" ]
635,005
635,006
u387628278
python
p02832
N = int(input()) a = map(int, input().split()) num = 0 for i in range(N): if a[i] == (num + 1): num += 1 if num == 0: print(-1) else: print(N-num)
N = int(input()) a = [i for i in map(int, input().split())] num = 0 for i in range(N): if a[i] == (num + 1): num += 1 if num == 0: print(-1) else: print(N-num)
[]
635,009
635,010
u857698093
python
p02832
def getdata_input(): while True: yield input() it=getdata_input() N=int(next(it)) arr=[-1]*N arr[0],*arr[1:]=map(int,next(it).split()) n=1 out=[] i=-1 while True: try: i=arr.index(n,i+1) out.append(i) n+=1 except ValueError: if(i<N-1): out.append(N) break if len(out) ==0: print(-1) else: i,j=0,0 total=0 for x in out: j=x total+=(j-i) i=j+1 print(total)
def getdata_input(): while True: yield input() it=getdata_input() N=int(next(it)) arr=[-1]*N arr[0],*arr[1:]=map(int,next(it).split()) n=1 out=[] i=-1 while True: try: i=arr.index(n,i+1) out.append(i) n+=1 except ValueError: if i<N-1 and n>1 : out.append(N) break if len(out) ==0: print(-1) else: i,j=0,0 total=0 for x in out: j=x total+=(j-i) i=j+1 print(total)
[ "control_flow.branch.if.condition.change" ]
635,011
635,012
u754339480
python
p02832
N = int(input()) al = list(map(int,input().split())) target = 1 ans = 0 for a in al: if a == target: target += 1 else: ans += 1 if ans == 0: print(-1) else: print(ans)
N = int(input()) al = list(map(int,input().split())) target = 1 ans = 0 for a in al: if a == target: target += 1 else: ans += 1 if ans == N: print(-1) else: print(ans)
[ "identifier.replace.add", "literal.replace.remove", "control_flow.branch.if.condition.change" ]
635,015
635,016
u007018214
python
p02832
# データ読み込み import sys from collections import deque def input_data(d=""): t = sys.stdin.read() if t: return t else: if d[0] == "\n": d = d[1:] if d[-1] == "\n": d = d[:-1] return d A, *B = map(int,input_data().split()) m = [] if 1 not in B: print(-1) out = 0 c = 1 for i in B: if i == c: c+=1 else: out+=1 print(out)
# データ読み込み import sys from collections import deque def input_data(d=""): t = sys.stdin.read() if t: return t else: if d[0] == "\n": d = d[1:] if d[-1] == "\n": d = d[:-1] return d A, *B = map(int,input_data().split()) m = [] if 1 not in B: print(-1) else: out = 0 c = 1 for i in B: if i == c: c+=1 else: out+=1 print(out)
[]
635,021
635,022
u871550854
python
p02832
N=int(input()) b=list(map(int,input().split())) var=1 _break=0 for i in range(N): if b[i] != var: _break+=1 var+=1 if _break==N: print(-1) else: print(_break)
N=int(input()) b=list(map(int,input().split())) var=1 _break=0 for i in range(N): if b[i] != var: _break+=1 else: var+=1 if _break==N: print(-1) else: print(_break)
[]
635,027
635,028
u782616557
python
p02832
n=int(input()) A=[int(i) for i in input().split()] k=1 cnt=0 for i in range(n): if A[i]!=k: cnt+=1 else: k+=1 if cnt==n: print(-1) else: print(-1)
n=int(input()) A=[int(i) for i in input().split()] k=1 cnt=0 for i in range(n): if A[i]!=k: cnt+=1 else: k+=1 if cnt==n: print(-1) else: print(cnt)
[ "call.arguments.change", "io.output.change", "expression.operation.unary.remove" ]
635,029
635,030
u561231954
python
p02832
n = int(input()) a = list(map(int,input().split())) num = 1 ans = 0 if i in range(n): if num == a[i]: num += 1 if num == 1: ans = -1 else: ans = n - num + 1 print(ans)
n = int(input()) a = list(map(int,input().split())) num = 1 ans = 0 for i in range(n): if num == a[i]: num += 1 if num == 1: ans = -1 else: ans = n - num + 1 print(ans)
[]
635,031
635,032
u890461092
python
p02832
N = int(input()) a = input().split() for i in range(N): a[i] = int(a[i]) index = 1 count = 0 for i in range(N): if a[i] == index: index += 1 else: count += 1 if count == 0: count = -1 print(count)
N = int(input()) a = input().split() for i in range(N): a[i] = int(a[i]) index = 1 count = 0 for i in range(N): if a[i] == index: index += 1 else: count += 1 if count == N: count = -1 print(count)
[ "identifier.replace.add", "literal.replace.remove", "control_flow.branch.if.condition.change" ]
635,037
635,038
u037190233
python
p02832
n=int(input()) a=list(map(int, input().split())) if a.count(1)==0: print('-1') num=1 for i in range(n): if a[i]==num: num +=1 continue print(n-num+1)
n=int(input()) a=list(map(int, input().split())) num=1 if a.count(1)==0: print('-1') else: for i in range(n): if a[i]==num: num +=1 continue print(n-num+1)
[ "assignment.add" ]
635,039
635,040
u993310962
python
p02832
quantity = int(input()) block = list(map(int,input().rstrip().split(" "))) num = 1 for i in block: if i == num: num += 1 if num == 1: print(0) else: print(quantity - num + 1)
quantity = int(input()) block = list(map(int,input().rstrip().split(" "))) num = 1 for i in block: if i == num: num += 1 if num == 1: print(-1) else: print(quantity - num + 1)
[ "call.arguments.change", "io.output.change", "expression.operation.unary.add" ]
635,041
635,042
u764773675
python
p02832
quantity = int(input()) block = list(map(int,input().rstrip().split(" "))) print(block) num = 1 for i in block: if i == num: num += 1 if num == 1: print(0) else: print(quantity - num + 1)
quantity = int(input()) block = list(map(int,input().rstrip().split(" "))) num = 1 for i in block: if i == num: num += 1 if num == 1: print(-1) else: print(quantity - num + 1)
[ "call.remove", "call.arguments.change", "io.output.change", "expression.operation.unary.add" ]
635,043
635,042
u764773675
python
p02832
N=int(input()) a=[int(i) for i in input().split()] print(a) if a.count(1)==0: print(-1) else: ans=[] for i in range(N): if a[i]==len(ans)+1: ans.append(a[i]) #print(N) #print(len(ans)) print(N-len(ans))
N=int(input()) a=[int(i) for i in input().split()] if a.count(1)==0: print(-1) else: ans=[] for i in range(N): if a[i]==len(ans)+1: ans.append(a[i]) #print(N) #print(len(ans)) print(N-len(ans))
[ "call.remove" ]
635,048
635,049
u557729026
python
p02832
N = int(input()) ori = [int(i) for i in input().split()] count = ori.count(1) if count == 0: print(-1) else: Break = 0 for j in range(1,N+1): for i in range(Break,N): if ori[i] == j: Break = i #print(Break) #print(savepoint) #print(j,i) sub = j break if i == N-1: break print(Break+1-sub)
N = int(input()) ori = [int(i) for i in input().split()] count = ori.count(1) if count == 0: print(-1) else: savepoint = 0 for j in range(1,N+1): for i in range(savepoint,N): if ori[i] == j: savepoint = i #print(savepoint) #print(j,i) sub = j break if i == N-1: break print(N-sub)
[ "assignment.variable.change", "identifier.change", "call.arguments.change", "control_flow.loop.range.bounds.lower.change", "expression.operation.binary.change", "io.output.change", "expression.operation.binary.remove" ]
635,050
635,051
u557729026
python
p02832
n = int(input()) a = list(map(int,input().spllit())) now = 1 brok = 0 for i in range(n): if(a[i] == now): brok += 1 else: now += 1 if(now == 1): print(-1) else: print(brok)
n = int(input()) A = list(map(int, input().split())) now = 1 brok = 0 for i in range (n): if(A[i] != now): brok += 1 else: now += 1 if(now == 1): print(-1) else: print(brok)
[ "assignment.variable.change", "identifier.change", "assignment.value.change", "call.arguments.change", "control_flow.branch.if.condition.change", "misc.opposites", "expression.operator.compare.change" ]
635,052
635,053
u440975163
python
p02832
N = int(input()) a = list(map(int,input().split())) count = currentnum = 0 if a==(list(i+1 for i in range(N))): print(0) exit() for i in a: if i!=currentnum+1: count+=1 else: currentnum+=1 print(-1 if count==0 else count)
N = int(input()) a = list(map(int,input().split())) count = currentnum = 0 if a==(list(i+1 for i in range(N))): print(0) exit() for i in a: if i!=currentnum+1: count+=1 else: currentnum+=1 print(-1 if currentnum==0 else count)
[ "identifier.change", "call.arguments.change", "io.output.change" ]
635,103
635,104
u216136179
python
p02832
n=int(input()) hoge=list(map(int,input().split())) flag=1 punch=0 for i in range(n): if(hoge[i]==flag): flag+=1 else: punch+=1 if(punch==n): print(-1) else: print(n-punch)
n=int(input()) hoge=list(map(int,input().split())) flag=1 punch=0 for i in range(n): if(hoge[i]==flag): flag+=1 else: punch+=1 if(punch==n): print(-1) else: print(punch)
[ "expression.operation.binary.remove" ]
635,105
635,106
u777028980
python
p02832
import sys n = int(input()) a = list(map(int,input().split())) if 1 in a == False: print(-1) sys.exit() res = 0 j = 1 for i in a: if i != j: res += 1 else: j += 1 print(res)
import sys n = int(input()) a = list(map(int,input().split())) if 1 not in a: print(-1) sys.exit() res = 0 j = 1 for i in a: if i != j: res += 1 else: j += 1 print(res)
[ "control_flow.branch.if.condition.change" ]
635,129
635,130
u743354620
python
p02832
a = list(map(int, input().split())) idx = 1 cnt = 0 for i in a: if i == idx: idx += 1 continue cnt += 1 if idx == 1: cnt = -1 print(cnt)
n = input() a = list(map(int, input().split())) idx = 1 cnt = 0 for i in a: if i == idx: idx += 1 continue cnt += 1 if idx == 1: cnt = -1 print(cnt)
[ "assignment.add" ]
635,140
635,141
u371132735
python
p02832
N=int(input()) number=input().split(' ') number_list=[] for i in number: number_list.append(int(i)) index=1 flag=0 count=0 for i in number_list: if(i==1): flag=1 index+=1 elif (i==index): index+=1 else: count+=1 if(flag==0): print(-1) else: print(count)
N=int(input()) number=input().split(' ') number_list=[] for i in number: number_list.append(int(i)) index=1 flag=0 count=0 for i in number_list: if(i==1 and flag==0): flag=1 index+=1 elif (i==index): index+=1 else: count+=1 if(flag==0): print(-1) else: print(count)
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
635,142
635,143
u790830953
python
p02832
N = int(input()) A = list(map(int, input().split())) # 無理な場合は-1 # 1からN-1が出てくるまでの個数を足していく? idx = 0 cnt = 0 num = 1 brick = 0 flg = False while True: if num == A[idx]: flg = True num += 1 brick += cnt cnt = 0 else: cnt += 1 idx += 1 if idx > N - 1: break if flg == False: brick = -1 print(brick)
N = int(input()) A = list(map(int, input().split())) # 無理な場合は-1 # 1からN-1が出てくるまでの個数を足していく? idx = 0 cnt = 0 num = 1 brick = 0 flg = False while True: if num == A[idx]: flg = True num += 1 brick += cnt cnt = 0 else: cnt += 1 idx += 1 if idx > N - 1: brick += cnt break if flg == False: brick = -1 print(brick)
[]
635,150
635,151
u285022453
python
p02832
n = int(input()) a = list(map(int, input().split())) x = 1 b = 0 for i in a: if i != x: b += 1 elif i == x: x += 1 if x == n: print(-1) else: print(b)
n = int(input()) a = list(map(int, input().split())) x = 1 b = 0 for i in a: if i != x: b += 1 elif i == x: x += 1 if b == n: print(-1) else: print(b)
[ "identifier.change", "control_flow.branch.if.condition.change" ]
635,152
635,153
u867826040
python
p02832
import sys n=int(input()) a=list(map(int,input().split())) purged_data = [] #purge : [動詞]〜を粛清する tmp = a[0] - 1 s=1 for i, e in enumerate(a): if e==s: purged_data.append(e) tmp = e s+=1 for i in range(len(purged_data)): if purged_data[i]!=i+1: print(-1) sys.exit() if len(purged_data)==0: print(-1) sys.exit() print(len(a)-len(purged_data),purged_data)
import sys n=int(input()) a=list(map(int,input().split())) purged_data = [] #purge : [動詞]〜を粛清する tmp = a[0] - 1 s=1 for i, e in enumerate(a): if e==s: purged_data.append(e) tmp = e s+=1 for i in range(len(purged_data)): if purged_data[i]!=i+1: print(-1) sys.exit() if len(purged_data)==0: print(-1) sys.exit() print(len(a)-len(purged_data))
[ "call.arguments.change" ]
635,167
635,168
u310381103
python
p02832
n = int(input()) a = list(map(int, input().split())) data = [] ans = -1 value = 1 for i in range(n): if i == value: data.append(value) value += 1 #print(data) if len(a) - len(data) == len(a): print('-1') else: print(len(a) - len(data))
n = int(input()) a = list(map(int, input().split())) data = [] ans = -1 value = 1 for i in range(n): if a[i] == value: data.append(value) value += 1 #print(value) #print(data) if len(a) - len(data) == len(a): print('-1') else: print(len(a) - len(data))
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
635,177
635,178
u361381049
python
p02832
#!python3.4.3 n = int(input()) a_list = list(map(int, input().split(' '))) result = [] c = 0 for i in range(1, n+1): for j in range(c, n): if i == a_list[j]: result.append(i) c = i break if len(result) != i: break # print(result) if len(result) == 0: print(-1) else: print(n - len(result))
#!python3.4.3 n = int(input()) a_list = list(map(int, input().split(' '))) result = [] c = 0 for i in range(1, n+1): for j in range(c, n): if i == a_list[j]: result.append(i) c = j break if len(result) != i: break if len(result) == 0: print(-1) else: print(n - len(result))
[ "assignment.value.change", "identifier.change" ]
635,179
635,180
u661347997
python
p02832
test = "" test = \ """ 1 1 """ test = list(reversed(test.strip().splitlines())) if test: def input2(): return test.pop() else: def input2(): return input() n = int(input2()) nums = list(map(int, input2().strip().split())) nums.reverse() ans = 0 wanted = 1 while nums: tmp = nums.pop() if tmp == wanted: wanted += 1 else: ans += 1 if ans == n: print(-1) else: print(ans)
test = "" #test = \ """ 1 1 """ test = list(reversed(test.strip().splitlines())) if test: def input2(): return test.pop() else: def input2(): return input() n = int(input2()) nums = list(map(int, input2().strip().split())) nums.reverse() ans = 0 wanted = 1 while nums: tmp = nums.pop() if tmp == wanted: wanted += 1 else: ans += 1 if ans == n: print(-1) else: print(ans)
[ "assignment.remove" ]
635,193
635,194
u272075541
python
p02832
N = int(input()) a = list(map(int, input().split())) index = 1 cnt = 0 for i in range(N): if index == a[i]: index += 1 else: cnt += 1 if cnt == N + N: print("-1") else: print(cnt)
N = int(input()) a = list(map(int, input().split())) index = 1 cnt = 0 for i in range(N): if index == a[i]: index += 1 else: cnt += 1 if cnt == N: print("-1") else: print(cnt)
[ "expression.operation.binary.remove" ]
635,199
635,200
u447166124
python
p02832
N = int(input()) a = list(map(int, input().split())) start = 0 cnt = 0 for i in range(1, N+1): try: start = a[start:].index(i) except: break else: cnt += 1 if cnt == 0: print(-1) else: print(N - cnt)
N = int(input()) a = list(map(int, input().split())) start = 0 cnt = 0 for i in range(1, N+1): try: start = a.index(i, start) except: break else: cnt += 1 if cnt == 0: print(-1) else: print(N - cnt)
[ "call.arguments.add" ]
635,203
635,204
u066413086
python
p02832
N = int(input()) a = [int(i) for i in input().split()] if 1 not in a: print(-1) num = 1 ans = 0 for i in a: if i == num: num += 1 else: ans += 1 print(ans)
N = int(input()) a = [int(i) for i in input().split()] if 1 not in a: print(-1) exit() num = 1 ans = 0 for i in a: if i == num: num += 1 else: ans += 1 print(ans)
[ "call.add" ]
635,206
635,207
u049574854
python
p02832
N = int(input()) A = map(int, input().split()) n,m = 1,0 if 1 not in A: print(-1) else: for i in range(N): if A[i] == n: n += 1 else: m += 1 print(m)
N = int(input()) A = list(map(int, input().split())) n,m = 1,0 if 1 not in A: print(-1) else: for i in range(N): if A[i] == n: n += 1 else: m += 1 print(m)
[ "call.add", "call.arguments.change" ]
635,210
635,211
u602740328
python
p02832
n=int(input()) a=list(map(int,input().split())) cnt=1 for i in range(n): if a[i]==cnt: cnt+=1 if cnt == n+1: print(-1) else: print(n-cnt+1)
n=int(input()) a=list(map(int,input().split())) cnt=1 for i in range(n): if a[i]==cnt: cnt+=1 if cnt == 1: print(-1) else: print(n-cnt+1)
[ "expression.operation.binary.remove" ]
635,230
635,231
u566529875
python
p02832
n = int(input()) l = [int(i) for i in input().split()] ct = 1 ans = 0 if n == 1: print(0 if l[0] == 1 else -1) else: for i in range(n): if l[i] == ct: ans += 1 ct += 1 else: pass print(ans if ans > 0 else -1)
n = int(input()) l = [int(i) for i in input().split()] ct = 1 ans = 0 if n == 1: print(0 if l[0] == 1 else -1) else: for i in range(n): if l[i] == ct: ans += 1 ct += 1 else: pass print(n - ans if ans > 0 else -1)
[ "expression.operation.binary.add" ]
635,237
635,238
u183840468
python
p02832
N = int(input()) a = list(map(int, input().split())) j = 0 for i in range(N): if i == a[i]: j += 1 if j == 0: print(-1) else: print(N - j)
N = int(input()) a = list(map(int, input().split())) j = 1 for i in range(N): if j == a[i]: j += 1 if j == 1: print(-1) else: print(N-j+1)
[ "literal.number.integer.change", "assignment.value.change", "identifier.change", "control_flow.branch.if.condition.change" ]
635,239
635,240
u612261372
python
p02832
n = int(input()) - 1 k = 1 for x in map(int, input().split()): if x == k: k += 1 print(n-(k or n+1))
n = int(input()) k = 0 for x in map(int, input().split()): if x == k + 1: k += 1 print(n-(k or n+1))
[ "expression.operation.binary.remove", "literal.number.integer.change", "assignment.value.change", "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change", "misc.off_by_one" ]
635,241
635,242
u021019433
python
p02832
n=int(input()) a=list(map(int,input().split())) cnt=1 for i in range(n): if a[i]==cnt: cnt+=1 if cnt==1: print(-1) print(n-cnt+1)
n=int(input()) a=list(map(int,input().split())) cnt=1 for i in range(n): if a[i]==cnt: cnt+=1 if cnt==1: print(-1) exit() print(n-cnt+1)
[ "call.add" ]
635,245
635,246
u225388820
python
p02832
import sys readline = sys.stdin.buffer.readline n = int(readline()) num = 1 res = 0 for i in readline().split(): if num != int(i): res += 1 else: i += 1 if res == n: print(-1) else: print(res)
import sys readline = sys.stdin.buffer.readline n = int(readline()) num = 1 res = 0 for i in readline().split(): if num != int(i): res += 1 else: num += 1 if res == n: print(-1) else: print(res)
[ "identifier.change" ]
635,255
635,256
u780475861
python
p02832
N = int(input()) A = list(map(int,input().split())) count = 0 num = 1 for i in range(N): if A[i] == num: num += 1 else: count += 1 if count == 0: print(-1) else: print(count)
N = int(input()) A = list(map(int,input().split())) count = 0 num = 1 for i in range(N): if A[i] == num: num += 1 else: count += 1 if count == N: print(-1) else: print(count)
[ "identifier.replace.add", "literal.replace.remove", "control_flow.branch.if.condition.change" ]
635,257
635,258
u906077984
python
p02832
n = int(input()) a = list(map(int,input().split())) k = 1 for i in a: if k == i: k += 1 if k == 1: print(-1) else: print(k-1)
n = int(input()) a = list(map(int,input().split())) k = 1 for i in a: if k == i: k += 1 if k == 1: print(-1) else: print(n-k+1)
[ "identifier.change", "call.arguments.change", "expression.operation.binary.change", "io.output.change" ]
635,271
635,272
u793666115
python
p02832
n = int(input()) a = [int(x) for x in input().split()] res = 0 cnt = 1 for i in range(0,n): if a[i] == cnt: cnt = cnt + 1 else: res = res + 1 if (cnt - 1) == (n - res): print(res) else: print(-1)
n = int(input()) a = [int(x) for x in input().split()] res = 0 cnt = 1 for i in range(0,n): if a[i] == cnt: cnt = cnt + 1 else: res = res + 1 if (cnt - 1) == (n - res) and not res == n: print(res) else: print(-1)
[ "control_flow.branch.if.condition.change" ]
635,290
635,291
u469315524
python
p02832
N = int(input()) A=[] A=[int(x) for x in input().split()] num = 1 count = 0 for i in range(N): if A[i] == num: num += 1 else: count += 1 if count == None: print(-1) else: print(count)
N = int(input()) A=[] A=[int(x) for x in input().split()] num = 1 count = 0 for i in range(N): if A[i] == num: num += 1 else: count += 1 if count == N: print(-1) else: print(count)
[ "control_flow.branch.if.condition.change" ]
635,296
635,297
u290886932
python
p02832
N = int(input()) A=[] A=[int(x) for x in input().split()] num = 1 count = 0 for i in range(N): if A[i] == num: num += 1 else: count += 1 if count >= N-1: print(-1) else: print(count)
N = int(input()) A=[] A=[int(x) for x in input().split()] num = 1 count = 0 for i in range(N): if A[i] == num: num += 1 else: count += 1 if count == N: print(-1) else: print(count)
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change", "expression.operation.binary.remove" ]
635,298
635,297
u290886932
python
p02832
N = int(input()) A=[] A=[int(x) for x in input().split()] num = 1 count = 0 for i in range(N): if A[i] == num: num += 1 else: count += 1 if count == None: print(-1) else: print(count)
N = int(input()) A=[] A=[int(x) for x in input().split()] num = 1 count = 0 for i in range(N): if A[i] == num: num += 1 else: count += 1 if count == N: print(-1) else: print(count)
[ "control_flow.branch.if.condition.change" ]
635,299
635,297
u290886932
python
p02832
n = int(input()) a = list(map(int, input().split())) total_breaks = 0 position = 0 for i in range(1, n + 1): try: next_position = a.index(i) if next_position < position: total_breaks = total_breaks + n - position break total_breaks = total_breaks + next_position - position position = next_position + 1 except ValueError: if position == 0: total_breaks = -1 break else: total_breaks = total_breaks + n - position break print(total_breaks)
n = int(input()) a = list(map(int, input().split())) total_breaks = 0 position = 0 for i in range(1, n + 1): try: next_position = a.index(i, position) if next_position < position: total_breaks = total_breaks + n - position break total_breaks = total_breaks + next_position - position position = next_position + 1 except ValueError: if position == 0: total_breaks = -1 break else: total_breaks = total_breaks + n - position break print(total_breaks)
[ "call.arguments.add" ]
635,304
635,305
u816637025
python
p02832
N = int(input()) A = map(int, input().split()) c = 0 start = 1 for a in A: if a == start: c+=1 start += 1 if c == N: print(-1) else: print(N-c)
N = int(input()) A = map(int, input().split()) c = 0 start = 1 for a in A: if a == start: c+=1 start += 1 if c == 0: print(-1) else: print(N-c)
[ "identifier.replace.remove", "literal.replace.add", "control_flow.branch.if.condition.change" ]
635,312
635,313
u051401873
python
p02832
n=int(input()) a=list(map(int,input().split())) if 1 not in a: print(-1) else: x=1 for i in range(n): if a[i]==x: x+=1 print(n-x)
n=int(input()) a=list(map(int,input().split())) if 1 not in a: print(-1) else: x=1 for i in range(n): if a[i]==x: x+=1 print(n-x+1)
[ "expression.operation.binary.add" ]
635,316
635,317
u539517139
python
p02832
n = int(input()) a = [int(item) for item in input().split()] ans = 0 cur = 1 last = 0 if 1 not in a: print(-1) else: for i in range(n): if a[i] == cur: ans += last last = 0 cur += 1 else: last += 1 print(ans)
n = int(input()) a = [int(item) for item in input().split()] ans = 0 cur = 1 last = 0 if 1 not in a: print(-1) else: for i in range(n): if a[i] == cur: ans += last last = 0 cur += 1 else: last += 1 print(ans + last)
[ "expression.operation.binary.add" ]
635,318
635,319
u911537358
python
p02832
n = int(input()) a = list(map(int, input().split())) ans = 0 tmp = 1 for i in range(n): if a[i] == tmp: tmp += 1 else: ans += 1 if ans == 0 and tmp != 0: print(-1) else: print(ans)
n = int(input()) a = list(map(int, input().split())) ans = 0 tmp = 1 for i in range(n): if a[i] == tmp: tmp += 1 else: ans += 1 if ans != 0 and tmp ==1: print(-1) else: print(ans)
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
635,334
635,335
u880466014
python
p02832
n = int(input()) a = list(map(int, input().split())) ans = 0 tmp = 1 for i in range(n): if a[i] == tmp: tmp += 1 else: ans += 1 if ans == 0: print(-1) else: print(ans)
n = int(input()) a = list(map(int, input().split())) ans = 0 tmp = 1 for i in range(n): if a[i] == tmp: tmp += 1 else: ans += 1 if ans != 0 and tmp ==1: print(-1) else: print(ans)
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
635,336
635,335
u880466014
python
p02832
from copy import deepcopy from sys import exit,setrecursionlimit import math from collections import defaultdict,Counter,deque from fractions import Fraction as frac import fractions from functools import reduce from operator import mul import bisect import sys import logging import heapq import itertools logging.basicConfig(level=logging.ERROR) input = sys.stdin.readline setrecursionlimit(1000000) def main(): n = int(input()) a = list(map(int,input().split())) if(1 not in a): print(-1) c = 1 for i in a: if(i==c): c+=1 print(n-c+1) def factorization(n): if n<2: return [] arr = [] temp = n for i in range(2, int(-(-n**0.5//1))+1): if temp%i==0: cnt=0 while temp%i==0: cnt+=1 temp //= i arr.append([i, cnt]) if temp!=1: arr.append([temp, 1]) if arr==[]: arr.append([n, 1]) return arr def cmb(n,r): r = min(n-r,r) if r == 0: return 1 over = reduce(mul, range(n, n - r, -1)) under = reduce(mul, range(1,r + 1)) return over // under def zip(a): mae = a[0] ziparray = [mae] for i in range(1,len(a)): if(mae != a[i]): ziparray.append(a[i]) mae = a[i] return ziparray def is_prime(n): if n < 2: return False for k in range(2, int(math.sqrt(n)) + 1): if n % k == 0: return False return True def list_replace(n,f,t): return [t if i==f else i for i in n] def base_10_to_n(X, n): X_dumy = X out = '' while X_dumy>0: out = str(X_dumy%n)+out X_dumy = int(X_dumy/n) if(out == ''): return '0' return out def gcd(numbers): return reduce(math.gcd, numbers) def lcm(numbers): return reduce(lcm_base, numbers, 1) def lcm_base(x, y): return (x * y) // fractions.gcd(x, y) class Queue(): def __init__(self): self.q = deque([]) def push(self,i): self.q.append(i) def pop(self): return self.q.popleft() def size(self): return len(self.q) def debug(self): return self.q class Stack(): def __init__(self): self.q = [] def push(self,i): self.q.append(i) def pop(self): return self.q.pop() def size(self): return len(self.q) def debug(self): return self.q class graph(): def __init__(self): self.graph = defaultdict(list) def addnode(self,l): f,t = l[0],l[1] self.graph[f].append(t) self.graph[t].append(f) def rmnode(self,l): f,t = l[0],l[1] self.graph[f].remove(t) self.graph[t].remove(f) def linked(self,f): return self.graph[f] class dgraph(): def __init__(self): self.graph = defaultdict(set) def addnode(self,l): f,t = l[0],l[1] self.graph[f].append(t) def rmnode(self,l): f,t = l[0],l[1] self.graph[f].remove(t) def linked(self,f): return self.graph[f] class PriorityQueue(): def __init__(self): self.queue = [] def push(self,i): heapq.heappush(self.queue,-i) def pop(self): return -1 * heapq.heappop(self.queue) def sum(self): return -sum(self.queue) main()
from copy import deepcopy from sys import exit,setrecursionlimit import math from collections import defaultdict,Counter,deque from fractions import Fraction as frac import fractions from functools import reduce from operator import mul import bisect import sys import logging import heapq import itertools logging.basicConfig(level=logging.ERROR) input = sys.stdin.readline setrecursionlimit(1000000) def main(): n = int(input()) a = list(map(int,input().split())) if(1 not in a): print(-1) return c = 1 for i in a: if(i==c): c+=1 print(n-c+1) def factorization(n): if n<2: return [] arr = [] temp = n for i in range(2, int(-(-n**0.5//1))+1): if temp%i==0: cnt=0 while temp%i==0: cnt+=1 temp //= i arr.append([i, cnt]) if temp!=1: arr.append([temp, 1]) if arr==[]: arr.append([n, 1]) return arr def cmb(n,r): r = min(n-r,r) if r == 0: return 1 over = reduce(mul, range(n, n - r, -1)) under = reduce(mul, range(1,r + 1)) return over // under def zip(a): mae = a[0] ziparray = [mae] for i in range(1,len(a)): if(mae != a[i]): ziparray.append(a[i]) mae = a[i] return ziparray def is_prime(n): if n < 2: return False for k in range(2, int(math.sqrt(n)) + 1): if n % k == 0: return False return True def list_replace(n,f,t): return [t if i==f else i for i in n] def base_10_to_n(X, n): X_dumy = X out = '' while X_dumy>0: out = str(X_dumy%n)+out X_dumy = int(X_dumy/n) if(out == ''): return '0' return out def gcd(numbers): return reduce(math.gcd, numbers) def lcm(numbers): return reduce(lcm_base, numbers, 1) def lcm_base(x, y): return (x * y) // fractions.gcd(x, y) class Queue(): def __init__(self): self.q = deque([]) def push(self,i): self.q.append(i) def pop(self): return self.q.popleft() def size(self): return len(self.q) def debug(self): return self.q class Stack(): def __init__(self): self.q = [] def push(self,i): self.q.append(i) def pop(self): return self.q.pop() def size(self): return len(self.q) def debug(self): return self.q class graph(): def __init__(self): self.graph = defaultdict(list) def addnode(self,l): f,t = l[0],l[1] self.graph[f].append(t) self.graph[t].append(f) def rmnode(self,l): f,t = l[0],l[1] self.graph[f].remove(t) self.graph[t].remove(f) def linked(self,f): return self.graph[f] class dgraph(): def __init__(self): self.graph = defaultdict(set) def addnode(self,l): f,t = l[0],l[1] self.graph[f].append(t) def rmnode(self,l): f,t = l[0],l[1] self.graph[f].remove(t) def linked(self,f): return self.graph[f] class PriorityQueue(): def __init__(self): self.queue = [] def push(self,i): heapq.heappush(self.queue,-i) def pop(self): return -1 * heapq.heappop(self.queue) def sum(self): return -sum(self.queue) main()
[ "control_flow.return.add" ]
635,352
635,353
u676059589
python
p02832
N = int(input()) a = list(map(int, input().split())) ans = 0 cnt = 0 num = 1 for i in range(N): if a[i] != num: cnt += 1 else: ans += cnt cnt = 0 num += 1 if 1 not in a: print(-1) else: print(ans)
N = int(input()) a = list(map(int, input().split())) ans = 0 cnt = 0 num = 1 for i in range(N): if a[i] != num: cnt += 1 else: ans += cnt cnt = 0 num += 1 ans += cnt if 1 not in a: print(-1) else: print(ans)
[]
635,382
635,383
u066455063
python
p02832
N=int(input()) A=list(map(int,input().split())) s=1 i=0 while i<N: if s==A[i]: s+=1 i+=1 mi=N-s if 1 not in A: print(-1) else: print(mi)
N=int(input()) A=list(map(int,input().split())) s=1 i=0 while i<N: if s==A[i]: s+=1 i+=1 mi=N-(s-1) if 1 not in A: print(-1) else: print(mi)
[]
635,384
635,385
u109617108
python
p02832
N=int(input()) a=list(map(int,input().split(" "))) count=0 target=1 suc=0 for i in range(N): if a[i]!=target: count+=1 else: suc+=1 if suc>0: print(count) else: print(-1)
N=int(input()) a=list(map(int,input().split(" "))) count=0 target=1 suc=0 for i in range(N): if a[i]!=target: count+=1 else: suc+=1 target+=1 if suc>0: print(count) else: print(-1)
[]
635,388
635,389
u025241948
python
p02832
n=int(input()) a=list(map(int,input().split())) count=1 sum1=0 for i in range(n): if a[i]==count: count+=1 else: sum1+=1 if n==sum: print("-1") else: print(sum1)
n=int(input()) a=list(map(int,input().split())) count=1 sum1=0 for i in range(n): if a[i]==count: count+=1 else: sum1+=1 if n==sum1: print("-1") else: print(sum1)
[ "identifier.change", "control_flow.branch.if.condition.change" ]
635,394
635,395
u375695365
python
p02832
n=int(input()) a=list(map(int,input().split())) cnt=1 for i in a: if i==cnt: cnt+=1 if cnt==1:print(-1) else: print(cnt-1)
n=int(input()) a=list(map(int,input().split())) cnt=1 for i in a: if i==cnt: cnt+=1 if cnt==1:print(-1) else: print(n-(cnt-1))
[ "call.arguments.add", "call.arguments.change" ]
635,404
635,405
u623687794
python
p02832
import sys from fractions import * stdin = sys.stdin ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) ns = lambda: stdin.readline().rstrip() # ignore trailing spaces n = ni() a = na() now = 1 ct = 0 for i in range(n): if a[i] == now: now += 1 ct += 1 print(0) if ct == 0 else print(n-ct)
import sys from fractions import * stdin = sys.stdin ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) ns = lambda: stdin.readline().rstrip() # ignore trailing spaces n = ni() a = na() now = 1 ct = 0 for i in range(n): if a[i] == now: now += 1 ct += 1 print(-1) if ct == 0 else print(n-ct)
[ "call.arguments.change", "io.output.change", "expression.operation.unary.add" ]
635,410
635,411
u177411511
python
p02832
n = int(input()) lis = list(map(int,input().split())) ans = 0 cnt = 1 for num in lis: if num == cnt: ans += 1 cnt += 1 if ans == 0: print(-1) else: print(ans)
n = int(input()) lis = list(map(int,input().split())) ans = 0 cnt = 1 for num in lis: if num == cnt: ans += 1 cnt += 1 if ans == 0: print(-1) else: print(n-ans)
[ "expression.operation.binary.add" ]
635,429
635,430
u667024514
python
p02833
n = int(input()) if n % 2 == 0: print(0) exit(0) cnt = 0 five = 2 * 5 while n / five > 0: cnt += n // five five *= 5 print(cnt)
n = int(input()) if n % 2 == 1: print(0) exit(0) cnt = 0 five = 2 * 5 while n // five > 0: cnt += n // five five *= 5 print(cnt)
[ "literal.number.integer.change", "control_flow.branch.if.condition.change", "expression.operator.arithmetic.change", "control_flow.loop.condition.change" ]
635,435
635,436
u592758681
python
p02833
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) else: for i in range(1,27): cnt += n//((5**i)* 2) print(cnt)
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) else: for i in range(1,26): cnt += n//((5**i)* 2) print(cnt)
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
635,441
635,440
u306412379
python
p02833
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) else: for i in range(1,x+1): cnt += n//((5**i)* 2) print(cnt)
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) else: for i in range(1,26): cnt += n//((5**i)* 2) print(cnt)
[ "identifier.replace.remove", "literal.replace.add", "call.arguments.change", "expression.operation.binary.change", "control_flow.loop.range.bounds.upper.change", "expression.operation.binary.remove" ]
635,442
635,440
u306412379
python
p02833
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) else: for i in range(1,26): cnt += n//((5**i)* 2) print(cnt)
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) exit() else: for i in range(1,26): cnt += n//((5**i)* 2) print(cnt)
[ "call.add" ]
635,444
635,443
u306412379
python
p02833
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) else: for i in range(1,27): cnt += n//((5**i)* 2) print(cnt)
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) exit() else: for i in range(1,26): cnt += n//((5**i)* 2) print(cnt)
[ "call.add", "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
635,441
635,443
u306412379
python
p02833
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) else: for i in range(1,26): cnt += n//((5**i)* 2) print(cnt)
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) exit() else: for i in range(1,26): cnt += n//((5**i)* 2) print(cnt)
[ "call.add" ]
635,445
635,443
u306412379
python
p02833
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) else: for i in range(1,x+1): cnt += n//((5**i)* 2) print(cnt)
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) exit() else: for i in range(1,26): cnt += n//((5**i)* 2) print(cnt)
[ "call.add", "identifier.replace.remove", "literal.replace.add", "call.arguments.change", "expression.operation.binary.change", "control_flow.loop.range.bounds.upper.change", "expression.operation.binary.remove" ]
635,442
635,443
u306412379
python
p02833
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) else: for i in range(1,26): cnt += n//((5**i)* 2) print(cnt)
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) exit() for i in range(1,26): cnt += n//((5**i)* 2) print(cnt)
[ "call.arguments.change" ]
635,444
635,446
u306412379
python
p02833
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) else: for i in range(1,27): cnt += n//((5**i)* 2) print(cnt)
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) exit() for i in range(1,26): cnt += n//((5**i)* 2) print(cnt)
[ "call.arguments.change", "literal.number.integer.change", "control_flow.loop.range.bounds.upper.change" ]
635,441
635,446
u306412379
python
p02833
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) else: for i in range(1,26): cnt += n//((5**i)* 2) print(cnt)
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) exit() for i in range(1,26): cnt += n//((5**i)* 2) print(cnt)
[ "call.arguments.change" ]
635,445
635,446
u306412379
python
p02833
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) else: for i in range(1,x+1): cnt += n//((5**i)* 2) print(cnt)
n = int(input()) cnt = 0 x = len(str(n)) if n % 2 == 1: print(0) exit() for i in range(1,26): cnt += n//((5**i)* 2) print(cnt)
[ "call.arguments.change", "identifier.replace.remove", "literal.replace.add", "expression.operation.binary.change", "control_flow.loop.range.bounds.upper.change", "expression.operation.binary.remove" ]
635,442
635,446
u306412379
python
p02833
n=int(input()) if n%2==1: print(0) exit(0) k=n//2 from math import floor ans=0 deno=5 while deno<=k: ans+=floor(k/deno) deno*=5 print(ans)
n=int(input()) if n%2==1: print(0) exit(0) k=n//2 from math import floor ans=0 deno=5 while deno<=k: ans+=k//deno deno*=5 print(ans)
[ "call.remove", "expression.operator.arithmetic.change", "call.arguments.change", "expression.operation.binary.change" ]
635,469
635,470
u485319545
python
p02833
n=int(input()) if n%2!=0: print(0) exit(0) n//=10 def Base_10_to_n(X, n): X_dumy = X out = '' while X_dumy>0: out = str(X_dumy%n)+out X_dumy = int(X_dumy/n) return out n=Base_10_to_n(n,5) n=reversed(list(n)) tmp=1 ans=0 for i in n: ans+=int(i)*tmp tmp=tmp*5+1 print(ans)
n=int(input()) if n%2!=0: print(0) exit(0) n//=10 def Base_10_to_n(X, n): X_dumy = X out = '' while X_dumy>0: out = str(X_dumy%n)+out X_dumy = X_dumy//n return out n=Base_10_to_n(n,5) n=reversed(list(n)) tmp=1 ans=0 for i in n: ans+=int(i)*tmp tmp=tmp*5+1 print(ans)
[ "call.remove", "expression.operator.arithmetic.change", "assignment.value.change", "call.arguments.change", "expression.operation.binary.change" ]
635,473
635,474
u608007704
python
p02833
n=int(input()) if n%2!=0: print(0) exit(0) n//=10 def Base_10_to_n(X, n): X_dumy = X out = '' while X_dumy>0: out = str(X_dumy%n)+out X_dumy = int(X_dumy/n) return out n=Base_10_to_n(n,5) n=reversed(list(n)) tmp=1 ans=0 for i in n: ans+=int(i)*tmp tmp=tmp*5+1 print(ans)
n=int(input()) if n%2!=0: print(0) exit(0) n//=10 def Base_10_to_n(X, n): X_dumy = X out = '' while X_dumy>0: out = str(X_dumy%n)+out X_dumy = X_dumy//n return out n=Base_10_to_n(n,5) n=reversed(list(n)) tmp=1 ans=0 for i in n: ans+=int(i)*tmp tmp=tmp*5+1 print(ans)
[ "call.remove", "expression.operator.arithmetic.change", "assignment.value.change", "call.arguments.change", "expression.operation.binary.change" ]
635,473
635,476
u608007704
python
p02833
n = int(input()) if n%2 == 0: i = 1 ans = 0 while 2*pow(5,i) < n: ans += n//(2*pow(5,i)) i += 1 print(ans) else: print(0)
n = int(input()) if n%2 == 0: i = 1 ans = 0 while 2*pow(5,i) <= n: ans += n//(2*pow(5,i)) i += 1 print(ans) else: print(0)
[ "expression.operator.compare.change", "control_flow.loop.condition.change" ]
635,485
635,486
u614181788
python
p02833
def findTrailingZeros(n): # If n is odd if (n & 1): return 0 # If n is even else: ans = 0 # Find the trailing zeros # in n/2 factorial n //= 2 while (n): ans += n // 5 n //= 5 # Return the required answer return ans # Driver code n = 12 print(findTrailingZeros(n))
def findTrailingZeros(n): if (n & 1): return 0 else: ans = 0 n //= 2 while (n): ans += n // 5 n //= 5 return ans n = int(input()) print(findTrailingZeros(n))
[ "assignment.value.change", "identifier.replace.add", "literal.replace.remove", "call.arguments.add" ]
635,487
635,488
u089230684
python
p02833
import sys import itertools # import numpy as np import time import math sys.setrecursionlimit(10 ** 7) from collections import defaultdict read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N = int(input()) def f(n): if n < 2: return 1 else: return n * f(n - 2) if N % 2 == 1: print(0) else: ans = 0 x = 5 while x * 2 <= N: ans += N // x x *= 5 print(ans)
import sys import itertools # import numpy as np import time import math sys.setrecursionlimit(10 ** 7) from collections import defaultdict read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N = int(input()) def f(n): if n < 2: return 1 else: return n * f(n - 2) if N % 2 == 1: print(0) else: ans = 0 x = 5 while x * 2 <= N: ans += N // (x * 2) x *= 5 print(ans)
[]
635,509
635,510
u036104576
python
p02833
#E N=int(input()) ans=0 if N%2==0: N=N/2 else: N=-1 cnt=1 while cnt<=N: cnt*=5 ans+=N//cnt print(int(ans))
#E N=int(input()) ans=0 if N%2==0: N=N//2 else: N=-1 cnt=1 while cnt<=N: cnt*=5 ans+=N//cnt print(ans)
[ "expression.operator.arithmetic.change", "assignment.value.change", "expression.operation.binary.change", "call.remove", "call.arguments.change" ]
635,519
635,518
u330728443
python
p02833
def solve(N): if N%2==1: return 0 N2=(N-N%10)//10 count_zero=N2 x=5 while N2>x: count_zero+=N2//x x*=5 return count_zero N=int(input()) print(solve(N))
def solve(N): if N%2==1: return 0 N2=(N-N%10)//10 count_zero=N2 x=5 while N2>=x: count_zero+=N2//x x*=5 return count_zero N=int(input()) print(solve(N))
[ "expression.operator.compare.change", "control_flow.loop.condition.change" ]
635,526
635,527
u611945374
python
p02833
import math N = int(input()) if N % 2 == 1: print(0) else: i = 10 ans = 0 while(True): a = math.floor(N / i) if a < 1: break ans += a i *= 5 print(ans)
import math N = int(input()) if N % 2 == 1: print(0) else: i = 10 ans = 0 while(True): a = math.floor(N // i) if a < 1: break ans += a i *= 5 print(ans)
[ "expression.operator.arithmetic.change", "assignment.value.change", "call.arguments.change", "expression.operation.binary.change" ]
635,528
635,529
u548684908
python
p02833
n=int(input()) ans=0 if n % 2==0: for i in range(1,10000): waru = 2*5**i if n <= waru: break else: tmp = n//waru ans += tmp print(str(ans))
n=int(input()) ans=0 if n % 2==0: for i in range(1,10000): waru = 2*5**i if n < waru: break else: tmp = n//waru ans += tmp print(str(ans))
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
635,532
635,533
u620464724
python
p02833
n=int(input()) ans=0 if n % 2==0: for i in range(1,10000): waru = 2*5**i if n <= waru: break else: tmp = n/waru ans += int(tmp) print(str(ans))
n=int(input()) ans=0 if n % 2==0: for i in range(1,10000): waru = 2*5**i if n < waru: break else: tmp = n//waru ans += tmp print(str(ans))
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change", "expression.operator.arithmetic.change", "assignment.value.change", "expression.operation.binary.change", "call.remove", "call.arguments.change" ]
635,534
635,533
u620464724
python
p02833
n=int(input()) ans=0 if n % 2==0: for i in range(1,10000): waru = 2*5**i if n < waru: break else: tmp = n/waru ans += int(tmp) print(str(ans))
n=int(input()) ans=0 if n % 2==0: for i in range(1,10000): waru = 2*5**i if n < waru: break else: tmp = n//waru ans += tmp print(str(ans))
[ "expression.operator.arithmetic.change", "assignment.value.change", "expression.operation.binary.change", "call.remove", "call.arguments.change" ]
635,535
635,533
u620464724
python
p02833
n=int(input()) ans=0 if n % 2==0: for i in range(1,100): waru = 2*5**i if n < waru: break else: tmp = n/waru ans += int(tmp) print(str(ans))
n=int(input()) ans=0 if n % 2==0: for i in range(1,10000): waru = 2*5**i if n < waru: break else: tmp = n//waru ans += tmp print(str(ans))
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change", "expression.operator.arithmetic.change", "assignment.value.change", "expression.operation.binary.change", "call.remove" ]
635,536
635,533
u620464724
python
p02833
n=int(input()) ans=0 if n % 2==0: for i in range(1,22): waru = 2*5**i if n < waru: break else: tmp = n/waru ans += int(tmp) print(str(ans))
n=int(input()) ans=0 if n % 2==0: for i in range(1,10000): waru = 2*5**i if n < waru: break else: tmp = n//waru ans += tmp print(str(ans))
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change", "expression.operator.arithmetic.change", "assignment.value.change", "expression.operation.binary.change", "call.remove" ]
635,537
635,533
u620464724
python
p02833
n=int(input()) ans=0 if n % 2==0: for i in range(1,19): waru = 2*5**i if n < waru: break else: tmp = n/waru ans += int(tmp) print(str(ans))
n=int(input()) ans=0 if n % 2==0: for i in range(1,10000): waru = 2*5**i if n < waru: break else: tmp = n//waru ans += tmp print(str(ans))
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change", "expression.operator.arithmetic.change", "assignment.value.change", "expression.operation.binary.change", "call.remove" ]
635,538
635,533
u620464724
python
p02833
n=int(input()) ans=0 if n % 2==1: for i in range(1,19): waru = 2*5**i if n < waru: break else: tmp = n/waru ans += int(tmp) print(str(ans))
n=int(input()) ans=0 if n % 2==0: for i in range(1,10000): waru = 2*5**i if n < waru: break else: tmp = n//waru ans += tmp print(str(ans))
[ "literal.number.integer.change", "control_flow.branch.if.condition.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change", "expression.operator.arithmetic.change", "assignment.value.change", "expression.operation.binary.change", "call.remove" ]
635,539
635,533
u620464724
python
p02833
n=int(input()) ans=0 if n%2==1: print(ans) else: i=10 while n>i: ans+=n//i i*=5 print(ans)
n=int(input()) ans=0 if n%2==1: print(ans) else: i=10 while n>i-1: ans+=n//i i*=5 print(ans)
[ "control_flow.loop.condition.change" ]
635,550
635,551
u769870836
python
p02833
n = int(input()) if n%2 == 1: print(0) else: answer = 0 count = 1 n=int(n/2) while 5**count <= n: answer += n//pow(5,count) count+=1 print(answer)
n = int(input()) if n%2 == 1: print(0) else: answer = 0 count = 1 n=n//2 while 5**count <= n: answer += n//pow(5,count) count+=1 print(answer)
[ "call.remove", "expression.operator.arithmetic.change", "assignment.value.change", "call.arguments.change", "expression.operation.binary.change" ]
635,567
635,568
u207097826
python
p02833
n = int(input()) if n%2 == 1: print(0) exit() point = 0 now = 10 while now < n: point += n//now now *= 5 print(point)
n = int(input()) if n%2 == 1: print(0) exit() point = 0 now = 10 while now <= n: point += n//now now *= 5 print(point)
[ "expression.operator.compare.change", "control_flow.loop.condition.change" ]
635,573
635,574
u987164499
python
p02833
N = int(input()) if N % 2 == 1: print(0) else: cnt = 0 for i in range(0,30): tmp = 10*(5**i) a = N // tmp print(tmp,a) cnt += a print(cnt)
N = int(input()) if N % 2 == 1: print(0) else: cnt = 0 for i in range(0,30): tmp = 10*(5**i) a = N // tmp cnt += a print(cnt)
[ "call.remove" ]
635,586
635,587
u619144316
python
p02833
N = int(input()) if N % 2 == 1: print(0) else: ans = 0 while N > 10: ans += N // 10 N //= 5 print(ans)
N = int(input()) if N % 2 == 1: print(0) else: ans = 0 while N > 0: ans += N // 10 N //= 5 print(ans)
[ "literal.number.integer.change", "control_flow.loop.condition.change" ]
635,590
635,591
u392319141
python
p02833
n = int(input()) def double_fac(n): if n<=2: return n return n*double_fac(n-2) tmp=0 if n%2==1: ans=0 print(ans) else: r=1 ans=0 k=n while 10*r < n: ans+=(n//(10*r)) r*=5 print(ans) #print(double_fac(n))
n = int(input()) def double_fac(n): if n<=2: return 1 return n*double_fac(n-2) tmp=0 if n%2==1: ans=0 print(ans) else: r=1 ans=0 k=n while 10*r <= n: ans+=(n//(10*r)) r*=5 print(ans) #print(double_fac(n))
[ "identifier.replace.remove", "literal.replace.add", "function.return_value.change", "expression.operator.compare.change", "control_flow.loop.condition.change" ]
635,596
635,597
u685983477
python