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
p02641
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10 ** 9) INF = 1 << 60 def main(): X, N, *P = map(int, read().split()) P = set(P) Q = [i for i in range(1, 101) if i not in P] Q.sort() error = INF for q in Q: if abs(X...
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10 ** 9) INF = 1 << 60 def main(): X, N, *P = map(int, read().split()) P = set(P) Q = [i for i in range(-10, 110) if i not in P] Q.sort() error = INF for q in Q: if abs...
[ "assignment.value.change", "call.arguments.change", "control_flow.loop.range.bounds.lower.change", "expression.operation.unary.add", "control_flow.loop.range.bounds.upper.change", "literal.number.integer.change" ]
361,495
361,496
u968166680
python
p02641
X, N = map(int, input().split()) if N == 0: print(X) exit() P = list(map(int, input().split())) ans = float('inf') for i in range(101): if i in P: continue if abs(ans - X) > abs(i - X): ans = i print(ans)
X, N = map(int, input().split()) if N == 0: print(X) exit() P = list(map(int, input().split())) ans = float('inf') for i in range(102): if i in P: continue if abs(ans - X) > abs(i - X): ans = i print(ans)
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
361,516
361,517
u038021590
python
p02641
X, N = map(int, input().split()) if N == 0: print(X) else: *p, = map(int, input().split()) ans = -1 d = 10**10 for i in range(-100, 101): if i in p: continue m = abs(i-X) if m < d: d = m ans = i print(ans)
X, N = map(int, input().split()) if N == 0: print(X) else: *p, = map(int, input().split()) ans = -1 d = 10**10 for i in range(-101, 102): if i in p: continue m = abs(i-X) if m < d: d = m ans = i print(ans)
[ "call.arguments.change", "call.arguments.add" ]
361,524
361,525
u342869120
python
p02641
# -*- coding: utf-8 -*- import sys import math import os import itertools import string import heapq import _collections from collections import Counter from collections import defaultdict from functools import lru_cache import bisect import re import queue import decimal class Scanner(): @staticmethod def in...
# -*- coding: utf-8 -*- import sys import math import os import itertools import string import heapq import _collections from collections import Counter from collections import defaultdict from functools import lru_cache import bisect import re import queue import decimal class Scanner(): @staticmethod def in...
[ "expression.operation.binary.remove", "control_flow.branch.if.condition.change" ]
361,566
361,567
u303039933
python
p02641
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement from operator import itemgetter, mul from copy import deepcopy from s...
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement from operator import itemgetter, mul from copy import deepcopy from s...
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
361,583
361,584
u279493135
python
p02641
import sys input = sys.stdin.readline # sys.setrecursionlimit(100000) def main(): X, N = [int(i) for i in input().strip().split()] p_list = [int(i) for i in input().strip().split()] base = list() for i in range(1, 101): if i not in p_list: base.append(i) dif = float("inf") ...
import sys input = sys.stdin.readline # sys.setrecursionlimit(100000) def main(): X, N = [int(i) for i in input().strip().split()] p_list = [int(i) for i in input().strip().split()] base = list() for i in range(-110, 110): if i not in p_list: base.append(i) dif = float("inf")...
[ "call.arguments.change", "control_flow.loop.range.bounds.lower.change", "expression.operation.unary.add", "control_flow.loop.range.bounds.upper.change", "literal.number.integer.change" ]
361,591
361,592
u397496203
python
p02641
x,n=map(int,input().split()) if n==0: print(x) exit() P=set(list(map(int,input().split()))) diff= 1000 ans = 0 for i in range(101): if i in P: continue if abs(x-i)<diff: diff = abs(x-i) #print(diff,i) ans = i print(ans)
x,n=map(int,input().split()) if n==0: print(x) exit() P=set(list(map(int,input().split()))) diff= 1000 ans = 0 for i in range(102): if i in P: continue if abs(x-i)<diff: diff = abs(x-i) #print(diff,i) ans = i print(ans)
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
361,604
361,605
u221061152
python
p02641
x,n = map(int,input().split()) if n > 0: a = list(map(int,input().split())) else: a = [] a = set(a) ans = x for i in range(100): if not x+i in a: print(x+i) break if not x-i in a: print(x+i) break
x,n = map(int,input().split()) if n > 0: a = list(map(int,input().split())) else: a = [] a = set(a) ans = x for i in range(100): if not x-i in a: print(x-i) break if not x+i in a: print(x+i) break
[ "call.remove", "control_flow.break.remove", "call.add", "control_flow.break.add", "control_flow.branch.if.add" ]
361,614
361,615
u075595666
python
p02641
x,n=map(int,input().split()) if n==0: print(x) else: a=list(map(int,input().split())) tmp=1000 for i in reversed(range(-1,102)): if i not in a: if tmp > abs(i-x): tmp=abs(i-x) ans=i print(ans)
x,n=map(int,input().split()) if n==0: print(x) else: a=list(map(int,input().split())) tmp=1000 for i in reversed(range(-1,102)): if i not in a: if tmp >= abs(i-x): tmp=abs(i-x) ans=i print(ans)
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
361,632
361,633
u970809473
python
p02641
x,n=map(int,input().split()) if n==0: print(x) else: a=list(map(int,input().split())) tmp=1000 for i in range(-1,101): if i not in a: if tmp > abs(i-x): tmp=abs(i-x) ans=i print(ans)
x,n=map(int,input().split()) if n==0: print(x) else: a=list(map(int,input().split())) tmp=1000 for i in reversed(range(-1,102)): if i not in a: if tmp >= abs(i-x): tmp=abs(i-x) ans=i print(ans)
[ "call.add", "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
361,634
361,633
u970809473
python
p02641
import sys X, N = map(int, input().split()) P = list(map(int, sys.stdin.readline().rsplit())) m = 1000 for i in range(101): if i in P: continue if abs(X - i) < m: m = abs(X - i) res = i else: break print(res)
import sys X, N = map(int, input().split()) P = list(map(int, sys.stdin.readline().rsplit())) m = 1000 for i in range(102): if i in P: continue if abs(X - i) < m: m = abs(X - i) res = i else: break print(res)
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
361,661
361,662
u339199690
python
p02641
def main(): import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline X, N = map(int, input().split()) if N == 0: print(X) return P = list(map(int, input().split())) check = 1 while True: if not X-check in P: print(X-check) retur...
def main(): import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline X, N = map(int, input().split()) if N == 0: print(X) return P = list(map(int, input().split())) check = 0 while True: if not X-check in P: print(X-check) retur...
[ "literal.number.integer.change", "assignment.value.change" ]
361,725
361,726
u111473084
python
p02641
""" Arnab Chanda """ from collections import defaultdict, deque from itertools import permutations from sys import stdin,stdout from bisect import bisect_left, bisect_right from copy import deepcopy import heapq int_input=lambda : int(stdin.readline()) string_input=lambda : stdin.readline().split() multi_int_in...
""" Arnab Chanda """ from collections import defaultdict, deque from itertools import permutations from sys import stdin,stdout from bisect import bisect_left, bisect_right from copy import deepcopy import heapq int_input=lambda : int(stdin.readline()) string_input=lambda : stdin.readline().split() multi_int_in...
[ "assignment.remove", "assignment.add" ]
361,727
361,728
u852870914
python
p02641
inf = float('inf') def resolve(): x, n = map(int, input().split()) if n == 0: print(x) return p = list(map(int, input().split())) ans = 0 score = inf for i in range(101): tmp = abs(x - i) if score > tmp and i not in p: ans = i score = tm...
inf = float('inf') def resolve(): x, n = map(int, input().split()) if n == 0: print(x) return p = list(map(int, input().split())) ans = inf score = inf for i in range(-1, 102): tmp = abs(x - i) if score > tmp and i not in p: ans = i scor...
[ "assignment.value.change", "identifier.replace.add", "literal.replace.remove", "call.arguments.change", "control_flow.loop.range.bounds.upper.change", "call.arguments.add" ]
361,733
361,734
u298297089
python
p02641
import sys sys.setrecursionlimit(10 ** 7) rl = sys.stdin.readline def solve(): X, N = map(int, rl().split()) p = set(map(int, rl().split())) ans = -1 d_min = 1000 for i in range(101): if i not in p: if abs(X - i) < d_min: d_min = abs(X - i) ...
import sys sys.setrecursionlimit(10 ** 7) rl = sys.stdin.readline def solve(): X, N = map(int, rl().split()) p = set(map(int, rl().split())) ans = -1 d_min = 1000 for i in range(102): if i not in p: if abs(X - i) < d_min: d_min = abs(X - i) ...
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
361,755
361,756
u935984175
python
p02641
def examA(): X = LI() for i in range(len(X)): if X[i]==0: ans = i+1 print(ans) return def examB(): X, Y = LI() ans = "No" for i in range(X+1): if i*2+(X-i)*4==Y: ans = "Yes" print(ans) return def examC(): X, N = LI() P = LI() P = ...
def examA(): X = LI() for i in range(len(X)): if X[i]==0: ans = i+1 print(ans) return def examB(): X, Y = LI() ans = "No" for i in range(X+1): if i*2+(X-i)*4==Y: ans = "Yes" print(ans) return def examC(): X, N = LI() P = LI() P = ...
[ "expression.operation.unary.add", "call.arguments.change", "control_flow.loop.range.bounds.upper.change", "literal.number.integer.change" ]
361,765
361,766
u638795007
python
p02641
def main(): X, N = map(int, input().split()) if N == 0: return X p = list(map(int, input().split())) p = set(p) ans = 1 l = float('inf') for i in range(1, 102): if i not in p and abs(i-X) < l: l = abs(i-X) ans = i return ans if __name__ == '__main__':...
def main(): X, N = map(int, input().split()) if N == 0: return X p = list(map(int, input().split())) p = set(p) ans = 1 l = float('inf') for i in range(-1, 102): if i not in p and abs(i-X) < l: l = abs(i-X) ans = i return ans if __name__ == '__main__'...
[ "expression.operation.unary.add", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
361,771
361,772
u116002573
python
p02641
import sys input=lambda: sys.stdin.readline().rstrip() x,n=map(int,input().split()) P=set([int(i) for i in input().split()]) ans=0 for i in range(1,101): if i in P: continue else: if abs(i-x)<abs(ans-x): ans=i print(ans)
import sys input=lambda: sys.stdin.readline().rstrip() x,n=map(int,input().split()) P=set([int(i) for i in input().split()]) ans=0 for i in range(1,102): if i in P: continue else: if abs(i-x)<abs(ans-x): ans=i print(ans)
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
361,773
361,774
u969190727
python
p02641
x,n=map(int,input().split()) if n>0: p=list(map(int,input().split())) p=set(p) mini=10**10 ans=0 for i in range(101): if i not in p: if abs(i-x)<mini: mini=abs(i-x) ans=i print(ans) else: print(x)
x,n=map(int,input().split()) if n>0: p=list(map(int,input().split())) p=set(p) mini=10**10 ans=0 for i in range(102): if i not in p: if abs(i-x)<mini: mini=abs(i-x) ans=i print(ans) else: print(x)
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
361,798
361,799
u169138653
python
p02641
X,N = map(int,input().split()) if N>0: p = list(map(int,input().split())) ans = [] for i in range(100): ans.append(X-i) ans.append(X+i) import sys for j in ans: if j not in p: print(j) sys.exit()
X,N = map(int,input().split()) if N>0: p = list(map(int,input().split())) else: p = [] ans = [] for i in range(100): ans.append(X-i) ans.append(X+i) import sys for j in ans: if j not in p: print(j) sys.exit()
[ "assignment.add" ]
361,808
361,809
u679520304
python
p02641
x, n = map(int, input().split()) if n == 0: print(x) exit() P = list(map(int, input().split())) for s in range(-101, 101): if s not in P: ans = s break for s in range(-101, 101): if s not in P: if abs(ans-x) > abs(s-x): ans = s elif abs(ans-x) == abs(s-x): ...
x, n = map(int, input().split()) if n == 0: print(x) exit() P = list(map(int, input().split())) for s in range(-101, 110): if s not in P: ans = s break for s in range(-101, 110): if s not in P: if abs(ans-x) > abs(s-x): ans = s elif abs(ans-x) == abs(s-x): ...
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
361,824
361,825
u518085378
python
p02641
def main(sample_file = ''): """ convenient functions # for i, a in enumerate(iterable) # q, mod = divmod(a, b) # divmod(x, y) returns the tuple (x//y, x%y) # Higher-order function: reduce(operator.mul, xyz_count, 1) # manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc...
def main(sample_file = ''): """ convenient functions # for i, a in enumerate(iterable) # q, mod = divmod(a, b) # divmod(x, y) returns the tuple (x//y, x%y) # Higher-order function: reduce(operator.mul, xyz_count, 1) # manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc...
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
361,843
361,844
u988402778
python
p02641
def main(sample_file = ''): """ convenient functions # for i, a in enumerate(iterable) # q, mod = divmod(a, b) # divmod(x, y) returns the tuple (x//y, x%y) # Higher-order function: reduce(operator.mul, xyz_count, 1) # manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc...
def main(sample_file = ''): """ convenient functions # for i, a in enumerate(iterable) # q, mod = divmod(a, b) # divmod(x, y) returns the tuple (x//y, x%y) # Higher-order function: reduce(operator.mul, xyz_count, 1) # manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc...
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
361,845
361,844
u988402778
python
p02641
x , n = map(int, input().split()) if n == 0: print(x) else: p = list(map(int,input().split())) mi = 200 for i in range(102): if not i in p: d1 = abs(x-i) if d1<mi and d1!=0: ans = i mi = min(d1,mi) print(ans)
x , n = map(int, input().split()) if n == 0: print(x) else: p = list(map(int,input().split())) mi = 200 for i in range(102): if not i in p: d1 = abs(x-i) if d1<mi: ans = i mi = min(d1,mi) print(ans)
[ "control_flow.loop.for.condition.change" ]
362,003
362,004
u151785909
python
p02641
#import numpy as np #import math X, N = map(int, input().split()) if N != 0: P = list(map(int, input().split())) # a,b=map(int, input().split()) #複数数値入力 「A B」みたいなスペース空いた入力のとき # c=list(map(int, input().split())) #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき # s=[list(map(int,list(input()))) for i in range(h)] ...
#import numpy as np #import math X, N = map(int, input().split()) if N != 0: P = list(map(int, input().split())) # a,b=map(int, input().split()) #複数数値入力 「A B」みたいなスペース空いた入力のとき # c=list(map(int, input().split())) #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき # s=[list(map(int,list(input()))) for i in range(h)] ...
[ "identifier.change", "call.arguments.change", "io.output.change" ]
362,005
362,007
u461463382
python
p02641
x,y=map(int,input().split()) if y==0: print(x) exit(0) s=list(map(int,input().split())) res=100 mn=110 for n in range(1,110): if n not in s: v=abs(x-n) if v<res: res=v mn=n print(mn)
x,y=map(int,input().split()) if y==0: print(x) exit(0) s=list(map(int,input().split())) res=100 mn=110 for n in range( 110): if n not in s: v=abs(x-n) if v<res: res=v mn=n print(mn)
[ "call.arguments.change" ]
362,072
362,074
u202641516
python
p02641
################################################### # # # author: raghav_0901 (Raghav Dalmia) # # updated on: Sunday, 14-06-2020, 17:41:34 pm # # # ################################################### from ma...
################################################### # # # author: raghav_0901 (Raghav Dalmia) # # updated on: Sunday, 14-06-2020, 17:43:43 pm # # # ################################################### from ma...
[ "literal.number.integer.change", "assignment.value.change" ]
362,090
362,092
u287182213
python
p02641
X,N = (int(x) for x in input().split()) ans = 10000 ansnum = -3 if (N > 0): p = list(map(int, input().strip().split())) for i in range(-1,100): preans = abs(X-i) if(preans < ans) and (i in p ) == False: ans = preans ansnum = i print(ansnum) else: print(X)
X,N = (int(x) for x in input().split()) ans = 10000 ansnum = -3 if (N > 0): p = list(map(int, input().strip().split())) for i in range(-1,102): preans = abs(X-i) if(preans < ans) and (i in p ) == False: ans = preans ansnum = i print(ansnum) else: print(X)
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
361,846
361,849
u107601154
python
p02641
from sys import stdin, setrecursionlimit def main(): input = stdin.buffer.readline x, n = map(int, input().split()) p = list(map(int, input().split())) arr = [] for i in range(1, 101): if not i in p: arr.append(i) ans = arr[0] for ai in arr: if abs(ai - x) < abs...
from sys import stdin, setrecursionlimit def main(): input = stdin.buffer.readline x, n = map(int, input().split()) p = list(map(int, input().split())) arr = [] for i in range(-100, 201): if not i in p: arr.append(i) ans = arr[0] for ai in arr: if abs(ai - x) < ...
[ "call.arguments.change", "control_flow.loop.range.bounds.lower.change", "expression.operation.unary.add", "control_flow.loop.range.bounds.upper.change", "literal.number.integer.change" ]
361,917
361,916
u390727364
python
p02641
import sys stdin = sys.stdin sys.setrecursionlimit(10**6) ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) nn = lambda: list(stdin.readline().split()) ns = lambda: stdin.readline().rstrip() x,n = na() p = na() q = [i for i in range(-1,101) if i not in p] r = [] for i in range(len(q)): ...
import sys stdin = sys.stdin sys.setrecursionlimit(10**6) ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) nn = lambda: list(stdin.readline().split()) ns = lambda: stdin.readline().rstrip() x,n = na() p = na() q = [i for i in range(-1,102) if i not in p] r = [] for i in range(len(q)): ...
[ "literal.number.integer.change", "assignment.value.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
361,933
361,934
u843135954
python
p02641
import sys stdin = sys.stdin sys.setrecursionlimit(10**6) ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) nn = lambda: list(stdin.readline().split()) ns = lambda: stdin.readline().rstrip() x,n = na() p = na() q = [i for i in range(100) if i not in p] r = [] for i in range(len(q)): r.a...
import sys stdin = sys.stdin sys.setrecursionlimit(10**6) ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) nn = lambda: list(stdin.readline().split()) ns = lambda: stdin.readline().rstrip() x,n = na() p = na() q = [i for i in range(-1,102) if i not in p] r = [] for i in range(len(q)): ...
[ "assignment.value.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change", "call.arguments.add" ]
361,935
361,934
u843135954
python
p02641
# coding: utf-8 import sys # from operator import itemgetter sysread = sys.stdin.readline read = sys.stdin.read sys.setrecursionlimit(10 ** 7) #from heapq import heappop, heappush #from collections import defaultdict # import math # from itertools import product, accumulate, combinations, product # import bisect# lower...
# coding: utf-8 import sys # from operator import itemgetter sysread = sys.stdin.readline read = sys.stdin.read sys.setrecursionlimit(10 ** 7) #from heapq import heappop, heappush #from collections import defaultdict # import math # from itertools import product, accumulate, combinations, product # import bisect# lower...
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change" ]
361,936
361,937
u044220565
python
p02641
x, n = map(int, input().split()) if n == 0: print(x) exit() pn = list(map(int, input().split())) ls = [i for i in range(101)] for i in pn: ls[i] = 0 ls = list(set(ls)) ans = 0 m = 10**5 for j in ls: if abs(x - j) < m: m = abs(x - j) ans = j print(ans)
x, n = map(int, input().split()) if n == 0: print(x) exit() pn = list(map(int, input().split())) ls = [i for i in range(102)] for i in pn: ls[i] = 0 ls = list(set(ls)) ans = 0 m = 10**5 for j in ls: if abs(x - j) < m: m = abs(x - j) ans = j print(ans)
[ "literal.number.integer.change", "assignment.value.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
361,947
361,949
u086438369
python
p02641
X, N = map(int, input().split()) if N != 0: P = [int(i) for i in input().split()] else: P = [] m = float("inf") ans = 0 l = set(range(-100, 101)) - set(P) for p in sorted(l): d = abs(p-X) if d < m: m = d ans = p print(ans)
X, N = map(int, input().split()) if N != 0: P = [int(i) for i in input().split()] else: P = [] m = float("inf") ans = 0 l = set(range(-1000, 1001)) - set(P) for p in sorted(l): d = abs(p-X) if d < m: m = d ans = p print(ans)
[ "literal.number.integer.change", "assignment.value.change", "call.arguments.change", "expression.operation.binary.change", "control_flow.loop.range.bounds.upper.change" ]
361,977
361,978
u451017206
python
p02641
X, N = map(int, input().split()) if N == 0: print(X) exit() p = list(map(int, input().split())) ans = -float('inf') d = float('inf') for i in range(-10, 101): if i not in p: if abs(X-i) < d: d = abs(X-i) ans = i print(ans)
X, N = map(int, input().split()) if N == 0: print(X) exit() p = list(map(int, input().split())) ans = -float('inf') d = float('inf') for i in range(-10, 2100): if i not in p: if abs(X-i) < d: d = abs(X-i) ans = i print(ans)
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
361,988
361,990
u844646164
python
p02641
def resolve(): X, N = [int(i) for i in input().split()] if N == 0: print(X) return P = sorted([int(i) for i in input().split()]) if X not in P: print(X) for i in range(100): if (X - i) not in P: print(X - i) return if (X + i) not in P: ...
def resolve(): X, N = [int(i) for i in input().split()] if N == 0: print(X) return P = sorted([int(i) for i in input().split()]) if X not in P: print(X) return for i in range(100): if (X - i) not in P: print(X - i) return if (X ...
[ "control_flow.return.add" ]
362,019
362,021
u761062383
python
p02641
x,n,*a=map(int,open(0).read().split()) b=[1]*101 for i in a: b[i]=0 c=100 ans=0 for i in range(101): if b[i] and c>abs(x-i): c=abs(x-i) ans=i print(ans)
x,n,*a=map(int,open(0).read().split()) b=[1]*103 for i in a: b[i]=0 c=1000 ans=n for i in range(102): if b[i] and c>abs(x-i): c=abs(x-i) ans=i print(ans)
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change", "identifier.replace.add", "literal.replace.remove", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
362,048
362,046
u941438707
python
p02641
X, N = list(map(int, input().split())) if N==0: print(X) else: ps = list(map(int, input().split())) sub_abs = 0 while True: if (X-sub_abs) not in ps: print(X-sub_abs) break if (X+sub_abs) not in ps: print(X+sub_abs) sub_abs += 1
X, N = list(map(int, input().split())) if N==0: print(X) else: ps = list(map(int, input().split())) sub_abs = 0 while True: if (X-sub_abs) not in ps: print(X-sub_abs) break if (X+sub_abs) not in ps: print(X+sub_abs) break sub_abs +=...
[ "control_flow.break.add" ]
362,091
362,093
u328608670
python
p02641
x, n = map(int, input().split()) if n == 0: print(x) exit() else: p = list(map(int, input().split())) li = [i for i in range(-101, 101) if i not in p] li.sort(reverse = True) tmp1 = float('inf') ans = float('inf') for i in li: if abs(i - x) <= tmp1: if i < ans: ...
x, n = map(int, input().split()) if n == 0: print(x) exit() else: p = list(map(int, input().split())) li = [i for i in range(-101, 102) if i not in p] li.sort(reverse = True) tmp1 = float('inf') ans = float('inf') for i in li: if abs(i - x) <= tmp1: if i < ans: ...
[ "literal.number.integer.change", "assignment.value.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
362,095
362,097
u642823003
python
p02641
x, n = map(int, input().split()) if n == 0: print(x) exit() else: p = list(map(int, input().split())) li = [i for i in range(1, 101) if i not in p] li.sort(reverse = True) tmp1 = float('inf') ans = float('inf') for i in li: if abs(i - x) <= tmp1: if i < ans: ...
x, n = map(int, input().split()) if n == 0: print(x) exit() else: p = list(map(int, input().split())) li = [i for i in range(-101, 102) if i not in p] li.sort(reverse = True) tmp1 = float('inf') ans = float('inf') for i in li: if abs(i - x) <= tmp1: if i < ans: ...
[ "assignment.value.change", "call.arguments.change", "control_flow.loop.range.bounds.lower.change", "call.arguments.add" ]
362,099
362,097
u642823003
python
p02641
x, n = map(int, input().split()) if n == 0: print(100) exit() else: p = list(map(int, input().split())) li = [i for i in range(1, 101) if i not in p] li.sort(reverse = True) tmp1 = float('inf') ans = float('inf') for i in li: if abs(i - x) <= tmp1: if i < ans:...
x, n = map(int, input().split()) if n == 0: print(x) exit() else: p = list(map(int, input().split())) li = [i for i in range(-101, 102) if i not in p] li.sort(reverse = True) tmp1 = float('inf') ans = float('inf') for i in li: if abs(i - x) <= tmp1: if i < ans: ...
[ "identifier.replace.add", "literal.replace.remove", "call.arguments.change", "io.output.change", "assignment.value.change", "control_flow.loop.range.bounds.lower.change", "call.arguments.add" ]
362,101
362,097
u642823003
python
p02641
x,n=map(int,input().split()) if n==0: print(x) else: lst=sorted(map(int,input().split())) dis=200 ans=100 for i in range(101): temp=abs(x-i) if temp<dis and i not in lst: dis=temp ans=i print(ans)
x,n=map(int,input().split()) if n==0: print(x) else: lst=sorted(map(int,input().split())) dis=200 ans=100 for i in range(102): temp=abs(x-i) if temp<dis and i not in lst: dis=temp ans=i print(ans)
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
362,136
362,137
u383450070
python
p02641
mod = 1000000007 eps = 10**-9 def main(): import sys input = sys.stdin.readline X, N = map(int, input().split()) P = set(map(int, input().split())) val = 1000 ans = -1 for x in range(0, 101): if x in P: continue if abs(X - x) < val: ans = x ...
mod = 1000000007 eps = 10**-9 def main(): import sys input = sys.stdin.readline X, N = map(int, input().split()) P = set(map(int, input().split())) val = 1000 ans = -1 for x in range(0, 102): if x in P: continue if abs(X - x) < val: ans = x ...
[ "literal.number.integer.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
362,202
362,203
u892251744
python
p02642
import numpy as np N = int(input()) A = list(map(int,input().split())) chofuku_dict = {} chofuku = [] for a in A: if a not in chofuku_dict: chofuku_dict[a] = 1 else: chofuku.append(a) chofuku = set(chofuku) A = list(set(A)) A.sort() bl = np.array([0] + [1]*A[-1]) ans = 0 for a in A...
import numpy as np N = int(input()) A = list(map(int,input().split())) chofuku_dict = {} chofuku = [] for a in A: if a not in chofuku_dict: chofuku_dict[a] = 1 else: chofuku.append(a) chofuku = set(chofuku) A = list(set(A)) A.sort() bl = np.array([0] + [1]*A[-1]) ans = 0 for a in A...
[ "control_flow.branch.if.condition.change" ]
362,206
362,207
u855831834
python
p02642
import collections def main(): n = int(input()) al = list(map(int, input().split())) al.sort() dp = [1]*(10**6+1) for a in al: if dp[a]: dp[a] -= 1 for i in range(2,10**6//a + 1): dp[a*i] -= 2 ans = 0 for a in al: if dp[a] >= 0...
import collections def main(): n = int(input()) al = list(map(int, input().split())) al.sort() dp = [1]*(10**6+1) for a in al: if dp[a] >= 0: dp[a] -= 1 for i in range(2,10**6//a + 1): dp[a*i] -= 2 ans = 0 for a in al: if dp[a]...
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
362,227
362,228
u493520238
python
p02642
N = int(input()) A = sorted(list(map(int,input().split()))) B = (10**6+1)*[0] for a in A: B[a]+=1 if B[a]==1: for n in range(2*a,10**6+1,a): B[n]+=1 print(B.count(1))
N = int(input()) A = sorted(list(map(int,input().split()))) B = (10**6+1)*[0] for a in A: B[a]+=1 if B[a]==1: for n in range(2*a,10**6+1,a): B[n]+=2 print(B.count(1))
[ "literal.number.integer.change" ]
362,247
362,248
u759412327
python
p02642
N = int(input()) As = sorted(list(map(int, input().split()))) sieve = [True] * 1000001 prev = 0 for i in range(N): if As[i] == prev: sieve[As[i]] = False continue else: prev = As[i] try: for j in range(2, 1000000 // prev + 1): sieve[prev * j] = Fals...
N = int(input()) As = sorted(list(map(int, input().split()))) sieve = [True] * 1000001 prev = 0 for i in range(N): if As[i] == prev: sieve[As[i]] = False continue else: prev = As[i] try: for j in range(2, 1000000 // prev + 1): sieve[prev * j] = Fals...
[ "call.arguments.change", "control_flow.loop.range.bounds.upper.change", "call.arguments.add" ]
362,277
362,278
u617384447
python
p02642
def main(): n = int(input()) A = list(map(int,input().split())) ans = n A.sort() table = [True]*(A[-1]+1) for k,a in enumerate(A): if table[a]: if k+1<n and table[k+1]==a: ans-=1 for i in range(a,A[-1]+1,a): table[i] = False ...
def main(): n = int(input()) A = list(map(int,input().split())) ans = n A.sort() table = [True]*(A[-1]+1) for k,a in enumerate(A): if table[a]: if k+1<n and A[k+1]==a: ans-=1 for i in range(a,A[-1]+1,a): table[i] = False e...
[ "identifier.change", "control_flow.branch.if.condition.change" ]
362,281
362,282
u474561976
python
p02642
n = int(input()) A = list(map(int,input().split())) A.sort() # print(A) multiple = [0]*(A[-1]+1) for i in range(n): now = A[i] while(now <= A[-1]): multiple[now] += 1 now += now ans = 0 for i in range(n): if(multiple[A[i]] == 1): ans += 1 # print(multiple) print(ans)
n = int(input()) A = list(map(int,input().split())) A.sort() # print(A) multiple = [0]*(A[-1]+1) for i in range(n): now = A[i] while(now <= A[-1]): multiple[now] += 1 now += A[i] ans = 0 for i in range(n): if(multiple[A[i]] == 1): ans += 1 # print(multiple) print(ans)
[]
362,300
362,301
u802234211
python
p02642
n = int(input()) A = list(map(int,input().split())) A.sort() # print(A) multiple = [0]*(A[-1]+1) for i in range(n): now = A[i] while(now <= A[-1]): multiple[now] += 1 now += now ans = 0 for i in range(N): if(multiple[A[i]] == 1): ans += 1 # print(multiple) print(ans)
n = int(input()) A = list(map(int,input().split())) A.sort() # print(A) multiple = [0]*(A[-1]+1) for i in range(n): now = A[i] while(now <= A[-1]): multiple[now] += 1 now += A[i] ans = 0 for i in range(n): if(multiple[A[i]] == 1): ans += 1 # print(multiple) print(ans)
[ "identifier.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
362,302
362,301
u802234211
python
p02642
from bisect import bisect from collections import Counter n=int(input()) b=sorted(list(map(int,input().split()))) a=Counter(b) mA=b[-1] acc=0 dp=[True]*(mA+1) for i,v in a.items(): if dp[i]==True and v==1: acc+=1 else:dp[i]=False if i!=1: for k in range(mA//i+1): dp[k*i]=False print(acc)
from bisect import bisect from collections import Counter n=int(input()) b=sorted(list(map(int,input().split()))) a=Counter(b) mA=b[-1] acc=0 dp=[True]*(mA+1) for i,v in a.items(): if dp[i]==True and v==1: acc+=1 else:dp[i]=False for k in range(mA//i+1): dp[k*i]=False print(acc)
[]
362,321
362,322
u201986772
python
p02642
import collections N = int(input()) A = [int(x) for x in input().split()] c = collections.Counter(A) A = list(set(A)) A.sort() total = 10 ** 6 + 1 X = [0] * total for a in A: for aa in range(a + a, total, a): X[aa] = 1 ans = 0 for i in range(1, total): if X[i] == 0 and c[i] == 1: ans += 1...
import collections N = int(input()) A = [int(x) for x in input().split()] c = collections.Counter(A) A = list(set(A)) A.sort() total = 10 ** 6 + 1 X = [0] * total for a in A: for aa in range(a + a, total, a): X[aa] = 1 ans = 0 for i in range(1, total): if X[i] == 0 and c[i] == 1: ans += 1...
[ "call.remove" ]
362,349
362,350
u098012509
python
p02642
n = int(input()) a = list(map(int, input().split())) a.sort() MAX = int(1e6) + 10 sieve = [0] * int(MAX) for i in a: sieve[i] += 1 ans = 0 for idx, val in enumerate(sieve): if val == 0: continue if val > 1: sieve[idx] = 0 continue ans += 1 for i in range(idx * 2, MAX, idx): ...
n = int(input()) a = list(map(int, input().split())) a.sort() MAX = int(1e6) + 10 sieve = [0] * int(MAX) for i in a: sieve[i] += 1 ans = 0 for idx, val in enumerate(sieve): if val == 0: continue elif val > 1: sieve[idx] = 0 else: ans += 1 for i in range(idx * 2, MAX, idx): ...
[ "control_flow.branch.if.replace.remove", "control_flow.branch.else_if.replace.add" ]
362,401
362,402
u136086822
python
p02642
N = int(input()) A = list(map(int, input().split())) S = set(A) M = max(S) A.sort() for a in A: if a == pre_a: S.discard(a) if a in S: j = a * 2 while j <= M: S.discard(j) j += a pre_a = a print(len(S))
N = int(input()) A = list(map(int, input().split())) S = set(A) M = max(S) A.sort() pre_a = 0 for a in A: if a == pre_a: S.discard(a) if a in S: j = a * 2 while j <= M: S.discard(j) j += a pre_a = a print(len(S))
[ "assignment.add" ]
362,409
362,410
u434609232
python
p02642
N = int(input()) intList = list(map(int, input().split())) intList.sort() cntList = [1] * (intList[-1] + 1) i = 0 j = 1 ans = 0 while i < (N - 1): base = intList[i] j = 1 num = base if cntList[num] == 1: while num < intList[-1]: if cntList[num] == 1: cntList[num] = 0 j += 1 num...
N = int(input()) intList = list(map(int, input().split())) intList.sort() cntList = [1] * (intList[-1] + 1) i = 0 j = 1 ans = 0 while i < (N - 1): base = intList[i] j = 1 num = base if cntList[num] == 1: while num <= intList[-1]: if cntList[num] == 1: cntList[num] = 0 j += 1 nu...
[ "expression.operator.compare.change", "control_flow.loop.condition.change", "literal.number.integer.change", "variable_access.subscript.index.change", "control_flow.branch.if.condition.change" ]
362,432
362,433
u147601652
python
p02642
from collections import Counter def main(): n = int(input()) a = sorted([int(i) for i in input().split()]) table = [True for i in range(max(a))] res = 0 amax = max(a) for i in a: if (amax ** 0.5) + 1 < i: break if table[i-1] is False: continue fo...
from collections import Counter def main(): n = int(input()) a = sorted([int(i) for i in input().split()]) table = [True for i in range(max(a))] res = 0 amax = max(a) for i in a: if (amax/2) + 1 < i: break if table[i-1] is False: continue for j i...
[ "control_flow.loop.for.condition.change" ]
362,440
362,441
u727057618
python
p02642
def main(): n=int(input()) a=sorted(map(int,input().split())) maxa=a[-1]+1 tf=[False]*maxa r=0 n-=1 for i in range(n): a_i=a[i] if tf[a_i] ==False: for j in range(a_i,maxa,a_i): print(j) tf[j]=True if a_i < a[i+1]: #print(a_i) r+=1 if tf[-1] ==False...
def main(): n=int(input()) a=sorted(map(int,input().split())) maxa=a[-1]+1 tf=[False]*maxa r=0 n-=1 for i in range(n): a_i=a[i] if tf[a_i] ==False: for j in range(a_i,maxa,a_i): tf[j]=True if a_i < a[i+1]: #print(a_i) r+=1 if tf[-1] ==False: r+=1 print(r...
[ "call.remove" ]
362,452
362,453
u809108154
python
p02642
import numpy as np def main(): N = int(input()) A = list(map(int,input().split())) A.sort() d = np.zeros(A[-1]+1, dtype=np.unit64) for i in range(N): a = A[i] a1 = A[i-1] if a != a1: d[a::a] += 1 else: d[a] += 1 print(np.count_nonzero(d[A] == 1)) print(main())
import numpy as np def main(): N = int(input()) A = list(map(int,input().split())) A.sort() d = np.zeros(A[-1]+1, dtype=np.uint64) for i in range(N): a = A[i] a1 = A[i-1] if a != a1: d[a::a] += 1 else: d[a] += 1 print(np.count_nonzero(d[A] == 1)) main()
[ "assignment.value.change", "identifier.change", "call.arguments.change", "call.remove" ]
362,457
362,458
u228303592
python
p02642
n=int(input()) a=list(map(int,input().split())) dp=[False]*(10**6+1) for i in a: dp[i]=True for i in range(10**6+1): if dp[i]: for j in range(2*i,10**6+1,i): dp[j]=False print(dp.count(1))
n=int(input()) a=list(map(int,input().split())) dp=[0]*(10**6+1) for i in a: dp[i]+=1 for i in range(1,10**6+1): if dp[i]: for j in range(2*i,10**6+1,i): dp[j]=0 print(dp.count(1))
[ "assignment.value.change", "expression.operation.binary.change", "call.arguments.add" ]
362,466
362,467
u366996583
python
p02642
n = int(input()) a = list(map(int, input().split())) M=max(a) ok = [0]*(M+1) a.sort() for i in range(n): ok[a[i]] += 1 for i in range(n): if ok[a[i]] == 1: for g in range(a[i], M+1, a[i]): if g != a[i]: ok[g] = 0 print(ok.count(1))
n = int(input()) a = list(map(int, input().split())) M = max(a) ok = [0]*(M+1) a.sort() for i in range(n): ok[a[i]] += 1 for i in range(n): if ok[a[i]] != 0: for g in range(a[i], M+1, a[i]): if g != a[i]: ok[g] = 0 print(ok.count(1))
[ "control_flow.loop.for.condition.change" ]
362,468
362,469
u877415670
python
p02642
N = int(input()) A = list(map(int, input().split())) A.sort() MAX = 10**6+1 cnt = [0]*MAX for x in A: if cnt[x] != 0: cnt[i] = 2 else: for i in range(x, MAX, x): cnt[i] += 1 ans = 0 for x in A: # 2回以上通った数字 (cnt[x]>1) は,その数字より小さい約数が存在する (割り切れる他の数が存在する)。 if cnt[x] == 1: ans += 1 print(...
N = int(input()) A = list(map(int, input().split())) A.sort() MAX = 10**6+1 cnt = [0]*MAX for x in A: if cnt[x] != 0: cnt[x] = 2 else: for i in range(x, MAX, x): cnt[i] += 1 ans = 0 for x in A: # 2回以上通った数字 (cnt[x]>1) は,その数字より小さい約数が存在する (割り切れる他の数が存在する)。 if cnt[x] == 1: ans += 1 print(...
[ "assignment.variable.change", "identifier.change", "variable_access.subscript.index.change" ]
362,489
362,490
u763550415
python
p02642
n = int(input()) a = list(map(int,input().split())) m = max(a) li = [0]*m for x in a: li[x] += 1 ans = 0 for i in range(1,m): if li[i]: if li[i]==1: ans += 1 for j in range(i,m,i): li[j] = 0 print(ans)
n = int(input()) a = list(map(int,input().split())) m = max(a) + 1 li = [0]*m for x in a: li[x] += 1 ans = 0 for i in range(1,m): if li[i]: if li[i]==1: ans += 1 for j in range(i,m,i): li[j] = 0 print(ans)
[ "assignment.change" ]
362,495
362,496
u744034042
python
p02642
n = int(input()) a = list(map(int,input().split())) m = max(a) li = [0]*m for x in a: li[x] += 1 ans = 0 for i in range(1,m): if li[i]: if li[i]==1: ans += 1 for j in range(i,m,i): li[j] = 0
n = int(input()) a = list(map(int,input().split())) m = max(a) + 1 li = [0]*m for x in a: li[x] += 1 ans = 0 for i in range(1,m): if li[i]: if li[i]==1: ans += 1 for j in range(i,m,i): li[j] = 0 print(ans)
[ "call.add" ]
362,497
362,496
u744034042
python
p02642
n = int(input()) a = list(map(int,input().split())) m = max(a) li = [0]*m for x in a: li[x] += 1 ans = 0 for i in range(1,m): if li[i]: if li[i]==1: ans += 1 for j in range(i,m,i): li[j] = 0 print(ans)
n = int(input()) a = list(map(int,input().split())) m = max(a) + 10 li = [0]*m for x in a: li[x] += 1 ans = 0 for i in range(1,m): if li[i]: if li[i]==1: ans += 1 for j in range(i,m,i): li[j] = 0 print(ans)
[ "assignment.change" ]
362,495
362,498
u744034042
python
p02642
n = int(input()) a = list(map(int,input().split())) cnt = [0] * 40 for x in a: if cnt[x] != 0: cnt[x] = 2 else: for i in range(x,40,x): cnt[i] += 1 ans = 0 for x in a: if cnt[x] == 1: ans += 1 print(ans)
n = int(input()) a = list(map(int,input().split())) cnt = [0] * 1000005 for x in a: if cnt[x] != 0: cnt[x] = 2 else: for i in range(x,1000005,x): cnt[i] += 1 ans = 0 for x in a: if cnt[x] == 1: ans += 1 print(ans)
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
362,499
362,500
u590057656
python
p02642
n = int(input()) a = list(map(int,input().split())) cnt = [0] * 40 for x in a: if cnt[x] != 0: cnt[x] = 2 else: for i in range(x,40,x): cnt[i] += 1 ans = 0 for x in a: if cnt[x] == 1: ans += 1 print(ans)
n = int(input()) a = list(map(int,input().split())) cnt = [0] * 1000005 for x in a: if cnt[x] != 0: cnt[x] = 2 else: for i in range(x,1000005,x): cnt[i] += 1 ans = 0 for x in a: if cnt[x] == 1: ans += 1 print(ans)
[ "literal.number.integer.change", "assignment.value.change", "expression.operation.binary.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
362,499
362,501
u590057656
python
p02642
n=int(input()) a=list(map(int,input().split())) a.sort() am=max(a) dp=[[True,0] for _ in range(am+1)] count=0 for i in a: if dp[i][0]==False: continue else: if dp[i][1]==1: dp[i][0]=False count-=1 else: dp[i][1]=1 count+=1 for j...
n=int(input()) a=list(map(int,input().split())) a.sort() am=max(a) dp=[[True,0] for _ in range(am+1)] count=0 for i in a: if dp[i][0]==False: continue else: if dp[i][1]==1: dp[i][0]=False count-=1 else: dp[i][1]=1 count+=1 for j...
[ "control_flow.loop.range.bounds.lower.change", "expression.operation.binary.add" ]
362,504
362,505
u910632349
python
p02642
n=int(input()) a=list(map(int,input().split())) a.sort() ans=0 x=[0]+[True]*10**6 for i in range(len(a)): cnt=a[i] if x[a[i]]==True and (i==0 or a[i]!=a[i-1]) and (i==(n-1) or a[i]!=a[i+1]): ans+=1 while cnt<=10**6: x[cnt]=False cnt+=a[i] elif x[a[i]]==True and (i!...
n=int(input()) a=list(map(int,input().split())) a.sort() ans=0 x=[0]+[True]*10**6 for i in range(len(a)): cnt=a[i] if x[a[i]]==True and (i==0 or a[i]!=a[i-1]) and (i==(n-1) or a[i]!=a[i+1]): ans+=1 while cnt<=10**6: x[cnt]=False cnt+=a[i] elif x[a[i]]==True and ((i...
[ "control_flow.branch.if.condition.change" ]
362,541
362,542
u350093546
python
p02642
n = int(input()) a = list(map(int,input().split())) a = sorted(a) aMax = a[-1] l = len(a) count = 0 k = 0 kSet = set() for i in range(n): value = a[i] if not(value in kSet): if a[i-1] == value: count -= 1 kSet.add(value) continue count += 1 j = 2 ...
n = int(input()) a = list(map(int,input().split())) a = sorted(a) aMax = a[-1] l = len(a) count = 0 k = 0 kSet = set() for i in range(n): value = a[i] if not(value in kSet): if i != 0 and a[i-1] == value: count -= 1 kSet.add(value) continue count += 1 ...
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
362,569
362,570
u002663801
python
p02642
n = int(input()) a = list(map(int,input().split())) a = sorted(a) aMax = a[-1] l = len(a) count = 0 k = 0 kSet = set() for i in range(n): value = a[i] if not(value in kSet): if a[i-1] == value: count -= 1 kSet.add(value) continue count += 1 j = 2 ...
n = int(input()) a = list(map(int,input().split())) a = sorted(a) aMax = a[-1] l = len(a) count = 0 k = 0 kSet = set() for i in range(n): value = a[i] if not(value in kSet): if i != 0 and a[i-1] == value: count -= 1 kSet.add(value) continue count += 1 ...
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
362,569
362,571
u002663801
python
p02642
n = int(input()) a = list(map(int,input().split())) m =max(a) arr = [0]*(m+1) for i in a: for j in range(i,m+1,i): arr[i]+=1 cnt = 0 for i in a: if arr[i] ==1: cnt += 1 print(cnt)
n = int(input()) a = list(map(int,input().split())) m =max(a) arr = [0]*(m+1) for i in a: for j in range(i,m+1,i): arr[j]+=1 cnt = 0 for i in a: if arr[i] ==1: cnt += 1 print(cnt)
[ "identifier.change", "variable_access.subscript.index.change" ]
362,593
362,594
u798260206
python
p02642
n=int(input()) a=list(map(int,input().split())) m=max(a) alsit=[0]*(m+1) for i in a: for j in range(i,m+1,i): alist[j]+=1 cnt=0 for i in a: if alist[i]==1: cnt+=1 print(cnt)
n=int(input()) a=list(map(int,input().split())) m=max(a) alist=[0]*(m+1) for i in a: for j in range(i,m+1,i): alist[j]+=1 cnt=0 for i in a: if alist[i]==1: cnt+=1 print(cnt)
[ "assignment.variable.change", "identifier.change" ]
362,595
362,596
u430726059
python
p02642
import itertools N = int(input()) A = list(map(int, input().split())) count = {} for a in A: if a not in count: count[a] = 0 count[a] += 1 def check(a): if count[a] > 1: return 0 if 1 in count: if a == 1 and count[1] == 1: return 1 return 0 #print(a) ok = True sqr_a = 1 + int(a**0...
import itertools N = int(input()) A = list(map(int, input().split())) count = {} for a in A: if a not in count: count[a] = 0 count[a] += 1 def check(a): if count[a] > 1: return 0 if 1 in count: if a == 1 and count[1] == 1: return 1 return 0 #print(a) ok = True sqr_a = 1 + int(a**0...
[ "identifier.change", "control_flow.loop.condition.change" ]
362,599
362,600
u693566873
python
p02642
n = int(input()) a = set(map(int, input().split())) xs = [0] * (max(a) + 1) for v in a: if xs[v] == 0: for j in range(v, len(xs), v): xs[j] += 1 else: xs[v] += 1 print(len(list(filter(lambda v: xs[v] == 1, a))))
n = int(input()) a = list(map(int, input().split())) xs = [0] * (max(a) + 1) for v in a: if xs[v] == 0: for j in range(v, len(xs), v): xs[j] += 1 else: xs[v] += 1 print(len(list(filter(lambda v: xs[v] == 1, a))))
[ "assignment.value.change", "identifier.change", "call.function.change" ]
362,644
362,645
u461993794
python
p02642
n=int(input()) A=list(map(int,input().split())) m=max(A) X=[True]*(m+1) A.sort() for i in range(n): for j in range(A[i]*2,m+1,A[i]): X[j]=False ans=0 for i in range(n): if X[A[i]]==True: ans+=1 print(ans)
n=int(input()) A=list(map(int,input().split())) m=max(A) X=[0]*(m+1) A.sort() for i in range(n): for j in range(A[i],m+1,A[i]): X[j]+=1 ans=0 for i in range(n): if X[A[i]]==1: ans+=1 print(ans)
[ "assignment.value.change", "expression.operation.binary.change", "expression.operation.binary.remove", "control_flow.branch.if.condition.change" ]
362,648
362,649
u210827208
python
p02642
n = int(input()) A = list(map(int, input().split())) MAX_N = max(A)+1 cnt = [0] * MAX_N for a in A: for i in range(a, MAX_N, a): if cnt[i] >= 2: break cnt[i] += 1 ans = 0 for a in A: if cnt[a] == 1: ans += 1 print(ans)
n = int(input()) A = list(map(int, input().split())) MAX_N = max(A)+ 1 cnt = [0] * MAX_N for a in A: for i in range(a, MAX_N, a): if cnt[i] <= 2: cnt[i] += 1 ans = 0 for a in A: if cnt[a] == 1: ans += 1 print(ans)
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change", "control_flow.break.remove" ]
362,655
362,656
u968404618
python
p02642
n = int(input()) A = list(map(int, input().split())) MAX_N = max(A)+1 cnt = [0] * MAX_N for a in A: for i in range(a, MAX_N, a): if cnt[i] >= 2: break cnt[i] += 1 ans = 0 for a in A: if cnt[a] == 1: ans += 1 print(ans)
n = int(input()) A = list(map(int, input().split())) MAX_N = max(A)+1 cnt = [0] * MAX_N for a in A: for i in range(a, MAX_N, a): if cnt[i] <= 2: cnt[i] += 1 ans = 0 for a in A: if cnt[a] == 1: ans += 1 print(ans)
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change", "control_flow.break.remove" ]
362,655
362,657
u968404618
python
p02642
n,*a=map(int,open(0).read().split()) a.sort() num=[True for i in range(a[-1]+1)] for i in range(n): if num[a[i]]: for j in range(a[-1]//a[i]): if j<2: continue num[a[i]*j]=False if i==n-1: pass elif a[i]==a[i+1]: num[a[i]]=False else: pass else: continue ans...
n,*a=map(int,open(0).read().split()) a.sort() num=[True for i in range(a[-1]+1)] for i in range(n): if num[a[i]]: for j in range(a[-1]//a[i]+1): if j<2: continue num[a[i]*j]=False if i==n-1: pass elif a[i]==a[i+1]: num[a[i]]=False else: pass else: continue a...
[ "control_flow.loop.range.bounds.upper.change", "expression.operation.binary.add" ]
362,691
362,692
u131638468
python
p02642
#!/usr/bin/env python3 import sys import math from bisect import bisect_right as br from bisect import bisect_left as bl sys.setrecursionlimit(2147483647) from heapq import heappush, heappop,heappushpop from collections import defaultdict from itertools import accumulate from collections import Counter from collection...
#!/usr/bin/env python3 import sys import math from bisect import bisect_right as br from bisect import bisect_left as bl sys.setrecursionlimit(2147483647) from heapq import heappush, heappop,heappushpop from collections import defaultdict from itertools import accumulate from collections import Counter from collection...
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change", "assignment.value.change" ]
362,697
362,698
u191874006
python
p02642
#import time def main(): N = int(input()) As = list(map(int, input().split())) As.sort() amax = max(As) + 1 lis = [True] * amax ans = 0 for i in range(N-1): if lis[As[i]]: for j in range(As[i], amax, As[i]): lis[j] = False if a[i] < a[i+1]: ...
#import time def main(): N = int(input()) As = list(map(int, input().split())) As.sort() amax = max(As) + 1 lis = [True] * amax ans = 0 for i in range(N-1): if lis[As[i]]: for j in range(As[i], amax, As[i]): lis[j] = False if As[i] < As[i+1]...
[ "identifier.change", "control_flow.branch.if.condition.change" ]
362,708
362,709
u756607246
python
p02642
counter = [0 for i in range(10**6+1)] n = int(input()) a = sorted(list(map(int,input().split()))) for i in a: counter[i] += 1 l = [0 for i in range(10**6+1)] cou = 0 for i in range(n): b = a[i] if l[b]==0: cou += 1 for j in range(b,10**6+1,b): l[j] = 1 if counter[j]>=2: cou -=1 print(cou)
counter = [0 for i in range(10**6+1)] n = int(input()) a = sorted(list(map(int,input().split()))) for i in a: counter[i] += 1 l = [0 for i in range(10**6+1)] cou = 0 for i in range(n): b = a[i] if l[b]==0: cou += 1 for j in range(b,10**6+1,b): l[j] = 1 if counter[b]>=2: cou -=1 print(cou)
[ "identifier.change", "variable_access.subscript.index.change", "control_flow.branch.if.condition.change" ]
362,751
362,752
u288430479
python
p02642
n = int(input()) *A, = map(int, input().split()) # C[a] = A内のaの個数 C = {a: 0 for a in A} for a in A: C[a] += 1 # D[a]=1: Aにaより小さいaの約数が存在する D = {a: 0 for a in A} for a in A: if C[a] > 0: tmp = 2 while a * tmp <= maxA: D[a * tmp] = 1 tmp += 1 ans = 0 for a in A: if C[a] ...
n = int(input()) *A, = map(int, input().split()) maxA = max(A) # C[a] = A内のaの個数 C = {a: 0 for a in A} for a in A: C[a] += 1 # D[a]=1: Aにaより小さいaの約数が存在する D = {a: 0 for a in A} for a in A: if C[a] > 0: tmp = 2 while a * tmp <= maxA: D[a * tmp] = 1 tmp += 1 ans = 0 for a in A...
[ "assignment.add" ]
362,761
362,762
u997641430
python
p02642
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines n = int(readline()) a = list(map(int,readline().split())) a.sort() if a[0] == a[-1]: if n > 1: print(0) else: print(1) exit() if a[0] == 1: if a[0] == a[1]: print(0) else: prin...
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines n = int(readline()) a = list(map(int,readline().split())) a.sort() if a[0] == a[-1]: if n > 1: print(0) else: print(1) exit() if a[0] == 1: if a[0] == a[1]: print(0) else: prin...
[ "control_flow.branch.if.condition.change" ]
362,827
362,828
u075595666
python
p02642
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines n = int(readline()) a = list(map(int,readline().split())) a.sort() if a[0] == a[-1]: if n > 1: print(0) else: print(1) exit() if a[0] == 1: if a[0] == a[1]: print(0) else: prin...
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines n = int(readline()) a = list(map(int,readline().split())) a.sort() if a[0] == a[-1]: if n > 1: print(0) else: print(1) exit() if a[0] == 1: if a[0] == a[1]: print(0) else: prin...
[ "call.remove", "control_flow.branch.if.condition.change" ]
362,829
362,828
u075595666
python
p02642
from collections import Counter import bisect n = int(input()) #リストの要素数 a = list(map(int, input().split())) #リストの要素 cnt = Counter(a) #aの要素数についての辞書 a.sort()#aを小さい順にソート ans = 0 mx = 10 ** 6 p = [0] * (mx + 1) for i in a: if p[a] == 0: for j in range(mx + 1): x = i * j if x > mx: ...
from collections import Counter import bisect n = int(input()) #リストの要素数 a = list(map(int, input().split())) #リストの要素 cnt = Counter(a) #aの要素数についての辞書 a.sort()#aを小さい順にソート ans = 0 mx = 10 ** 6 p = [0] * (mx + 1) for i in a: if p[i] == 0: for j in range(mx + 1): x = i * j if x > mx: ...
[ "identifier.change", "variable_access.subscript.index.change", "control_flow.branch.if.condition.change" ]
362,844
362,845
u440975163
python
p02642
n = int(input()) l = [int(x) for x in input().split()] set_l = set(l) set_l = sorted(set_l) limit = 10**6+1 mp = [0]*(limit) pre = None for i in range(n): num = l[i] if(pre==num): mp[num] += 1 pre = num for x in set_l: for y in range(x,limit,x): mp[y] += 1 cnt = 0 for num in ...
n = int(input()) l = [int(x) for x in input().split()] l.sort() set_l = set(l) set_l = sorted(set_l) limit = 10**6+1 mp = [0]*(limit) pre = None for i in range(n): num = l[i] if(pre==num): mp[num] += 1 pre = num for x in set_l: for y in range(x,limit,x): mp[y] += 1 cnt = 0 for...
[ "call.add" ]
362,854
362,855
u092387689
python
p02642
N = int(input()) A = list(map(int, input().split())) M = 10**6 + 2 cnt = [0 for _ in range(M)] A.sort() for i in A: if cnt[i] != 0: # cnt[i]がそれまでに出てきた数値で割り切れていたとき cnt[i] = 2 # cnt[i]の倍数はどうせすでに1か2になっているので考慮しなくていい continue j = i while j < M: cnt[j] += 1 j += i ans = 0 for i in...
N = int(input()) A = list(map(int, input().split())) M = 10**6 + 2 cnt = [0 for _ in range(M)] A.sort() for i in A: if cnt[i] != 0: # cnt[i]がそれまでに出てきた数値で割り切れていたとき cnt[i] = 2 # cnt[i]の倍数はどうせすでに1か2になっているので考慮しなくていい continue j = i while j < M: cnt[j] += 1 j += i ans = 0 for i in...
[ "identifier.change", "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
362,859
362,860
u226082503
python
p02642
import sys sys.setrecursionlimit(10 ** 7) input = sys.stdin.readline n = int(input()) a = list( map(int, input().split())) a.sort() from collections import Counter cnt = Counter(a) if a[0]==1: if n==1: print(1) else: print(0) exit() limit = a[-1] is_prime = [0] * (limit + 1) for aa in a...
import sys sys.setrecursionlimit(10 ** 7) input = sys.stdin.readline n = int(input()) a = list( map(int, input().split())) a.sort() from collections import Counter cnt = Counter(a) if a[0]==1: if cnt[1]==1: print(1) else: print(0) exit() limit = a[-1] is_prime = [0] * (limit + 1) for a...
[ "control_flow.branch.if.condition.change" ]
362,879
362,880
u952467214
python
p02642
def main(): N = int(input()) A = list(map(int, input().split())) A.sort() MAX = A[-1] dp = [1] * (MAX + 5) ANS = 0 for i in range(N): if dp[A[i]] == 0: continue for j in range(MAX): if A[i]*j > MAX: break dp[A[i]*j] = 0 ...
def main(): N = int(input()) A = list(map(int, input().split())) A.sort() MAX = A[-1] dp = [1] * (MAX + 5) ANS = 0 for i in range(N): if dp[A[i]] == 0: continue for j in range(MAX+1): if A[i]*j > MAX: break dp[A[i]*j] = 0 ...
[ "control_flow.loop.range.bounds.upper.change", "expression.operation.binary.add" ]
362,881
362,882
u531487260
python
p02642
N=int(input()) A=list(map(int,input().split())) A.sort(reverse=True) max_a=A[0] dp=[True]*(max_a+1) ans=0 for i in range(N): a=A[i] #print(a) if dp[a]==True: if i==N-1: ans+=1 elif a!=A[i+1]: ans+=1 k=a while k<=max_a: dp[k]=False k+=a print(ans)
N=int(input()) A=list(map(int,input().split())) A.sort() max_a=A[-1] dp=[True]*(max_a+1) ans=0 for i in range(N): a=A[i] #print(a) if dp[a]==True: if i==N-1: ans+=1 elif a!=A[i+1]: ans+=1 k=a while k<=max_a: dp[k]=False k+=a print(ans)
[ "assignment.value.change", "variable_access.subscript.index.change", "expression.operation.unary.add" ]
362,886
362,887
u919025034
python
p02642
N = int(input()) A = list(map(int, input().split())) MAX = max(A) dp = [True for _ in range(MAX+1)] for a in set(A): for k in range(2*a,MAX+1,a): dp[k] = False B = sorted(A) for i in range(len(B)-1): if B[i] == B[i+1]: dp[B[i]] = False print(sum(dp[a] for a in set(A))) print(dp)
N = int(input()) A = list(map(int, input().split())) MAX = max(A) dp = [True for _ in range(MAX+1)] for a in set(A): for k in range(2*a,MAX+1,a): dp[k] = False B = sorted(A) for i in range(len(B)-1): if B[i] == B[i+1]: dp[B[i]] = False print(sum(dp[a] for a in set(A)))
[ "call.remove" ]
362,897
362,898
u271469978
python
p02642
N = int(input()) A = list(map(int, input().split())) MAX = max(A) dp = [True for _ in range(MAX+1)] for a in set(A): for k in range(2*a,MAX+1,a): dp[k] = False B = sorted(A) for i in range(len(B)-1): if B[i] == B[i-1]: dp[B[i]] = False print(sum(dp[a] for a in set(A)))
N = int(input()) A = list(map(int, input().split())) MAX = max(A) dp = [True for _ in range(MAX+1)] for a in set(A): for k in range(2*a,MAX+1,a): dp[k] = False B = sorted(A) for i in range(len(B)-1): if B[i] == B[i+1]: dp[B[i]] = False print(sum(dp[a] for a in set(A)))
[ "misc.opposites", "expression.operator.arithmetic.change", "variable_access.subscript.index.change", "control_flow.branch.if.condition.change" ]
362,899
362,898
u271469978
python
p02642
n=int(input()) from collections import Counter as co l=co(list(map(int,input().split()))) ans=len(l) ng=set() for k in l: if l[k]>=2:ng.add(k);continue for i in range(2*k,2*10**5+1,k): if i in l: ng.add(i) print(ans-len(ng))
n=int(input()) from collections import Counter as co l=co(list(map(int,input().split()))) ans=len(l) ng=set() for k in l: if l[k]>=2:ng.add(k) for i in range(2*k,10**6+1,k): if i in l: ng.add(i) print(ans-len(ng))
[ "expression.operation.binary.remove", "literal.number.integer.change", "call.arguments.change", "expression.operation.binary.change", "control_flow.loop.range.bounds.step.change" ]
362,905
362,908
u896741788
python
p02642
n = int(input(())) a = list(map(int,input().split())) dp = [0]*(10**6 + 1) ans = 0 for i in a: if dp[i] == 0: for j in range(1,10**6+1): if i * j > 10**6: break dp[i*j] += 1 elif dp[i] == 1: dp[i] += 1 for i in a: if dp[i] == 1: ans += 1 p...
n = int(input()) a = list(map(int,input().split())) dp = [0]*(10**6 + 1) ans = 0 for i in a: if dp[i] == 0: for j in range(1,10**6+1): if i * j > 10**6: break dp[i*j] += 1 elif dp[i] == 1: dp[i] += 1 for i in a: if dp[i] == 1: ans += 1 pri...
[]
362,925
362,926
u854061980
python
p02642
N=int(input()) A=list(map(int,input().split())) M=max(A) check=[0]*(M+1) for i in range(N): a=A[i] if check[a]>0: continue while a<=M: check[a]+=1 a+=A[i] ans=0 for i in range(N): if check[A[i]]==1: ans+=1 print(ans)
N=int(input()) A=list(map(int,input().split())) M=max(A) check=[0]*(M+1) #A.sort() for i in range(N): a=A[i] if check[a]>1: continue while a<=M: check[a]+=1 a+=A[i] ans=0 for i in range(N): if check[A[i]]==1: ans+=1 print(ans)
[ "literal.number.integer.change", "control_flow.branch.if.condition.change" ]
362,937
362,938
u173148629
python
p02642
n = int(input()) A = sorted(list(map(int, input().split()))) M = 10**6 + 1 L = [0]*M ans = 0 for a in A: L[a] += 1 if L[a] == 1: # k>=2として k*aは全て不適 for i in range(2*a, M+1, a): L[i] += 2 # flagの数が答え print(L.count(1))
n = int(input()) A = sorted(list(map(int, input().split()))) M = 10**6 + 1 L = [0]*M for a in A: L[a] += 1 if L[a] == 1: # k>=2として k*aは全て不適 for i in range(2*a, M, a): L[i] += 2 # flagの数が答え print(L.count(1))
[ "expression.operation.binary.remove" ]
362,941
362,942
u393253137
python
p02642
def func(n, a): mx = max(a) x = [0] * (mx + 1) # len(x) for i in a: x[i] += 1 for i in range(1, mx + 1): if x[i] != 0: for j in range(2 * i, mx + 1, i): x[j] = 0 if x[i] > 1: x[i] = 0 return sum(x) # 31401 n = int(input()) a = list(map...
def func(n, a): mx = max(a) x = [0] * (mx + 1) # len(x) for i in a: x[i] += 1 for i in range(1, mx + 1): if x[i] != 0: for j in range(2 * i, mx + 1, i): x[j] = 0 if x[i] > 1: x[i] = 0 print(sum(x)) # 31401 n = int(input()) a = list(map...
[ "function.return_value.change", "call.arguments.change", "identifier.change", "call.function.change" ]
362,960
362,961
u437215432
python
p02642
import sys input = sys.stdin.readline n=int(input()) L=list(map(int,input().split())) L.sort() hb = L[-1] dp = [-1 for i in range(hb+1)] print(L) for i in L: if dp[i]!=0: if dp[i]==1: dp[i]=0 continue dp[i]=1 for j in range(2*i,hb+1,i): dp[j]=0 ans=0 for...
import sys input = sys.stdin.readline n=int(input()) L=list(map(int,input().split())) L.sort() hb = L[-1] dp = [-1 for i in range(hb+1)] for i in L: if dp[i]!=0: if dp[i]==1: dp[i]=0 continue dp[i]=1 for j in range(2*i,hb+1,i): dp[j]=0 ans=0 for i in L: ...
[ "call.remove" ]
362,970
362,971
u505564549
python
p02642
n = int(input()) a = [int(i) for i in input().split()] maxa = max(a) l = [0] * (maxa+1) for i in a: c = 1 while True: if i*c >= maxa: break l[i*c - 1] += 1 c += 1 ans = 0 for i in set(a): if l[i-1] == 1: ans += 1 print(ans)
n = int(input()) a = [int(i) for i in input().split()] maxa = max(a) l = [0] * (maxa+1) for i in a: c = 1 while True: if i*c >= maxa+1: break l[i*c - 1] += 1 c += 1 ans = 0 for i in set(a): if l[i-1] == 1: ans += 1 print(ans)
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change", "misc.off_by_one" ]
362,988
362,989
u966542724
python
p02641
x, n = map(int, input().split()) if(n == 0): print(x) exit() p = set(map(int, input().split())) a = set([i for i in range(101)]) np = a-p ans = 0 dist = 1000000 for i in np: if(abs(x-i) < dist): dist = abs(x-i) ans = i elif(abs(x-i) == dist): ans = min(i, ans) else: pass print(ans)
x, n = map(int, input().split()) if(n == 0): print(x) exit() p = set(map(int, input().split())) a = set([i for i in range(105)]) np = a-p ans = 0 dist = 1000000 for i in np: if(abs(x-i) < dist): dist = abs(x-i) ans = i elif(abs(x-i) == dist): ans = min(i, ans) else: pass print(ans)
[ "literal.number.integer.change", "assignment.value.change", "call.arguments.change", "control_flow.loop.range.bounds.upper.change" ]
363,006
363,007
u406379114
python