problem_id
stringlengths
6
6
user_id
stringlengths
10
10
time_limit
float64
1k
8k
memory_limit
float64
262k
1.05M
problem_description
stringlengths
48
1.55k
codes
stringlengths
35
98.9k
status
stringlengths
28
1.7k
submission_ids
stringlengths
28
1.41k
memories
stringlengths
13
808
cpu_times
stringlengths
11
610
code_sizes
stringlengths
7
505
p02642
u455809703
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['import sys\n\nN = int(input())\n\nA = list(map(int, input().split()))\nA = [x for x in set(A) if A.count(x) == 1]\nif len(A) <= 1:\n print(len(A))\n sys.exit()\n\nA = np.array(sorted(A))\nB = np.array([A[0]])\n \nfor i in range(len(A)-1):\n if np.all(A[i+1] % B != 0):\n B = np.append(B, A[i+1])\nprint(len(B))', "N = int(input())\nA = sorted(list(map(int, input().split()))) + [0]\n \nmemo = ['Y'] * (10**6+1)\nmx = max(A) + 1 \ncount = 0\n \nfor i in range(N):\n if memo[A[i]] == 'N':\n continue\n for j in range(A[i], mx, A[i]):\n memo[j] = 'N'\n if A[i] == A[i+1]:\n continue\n \n count += 1\n \nprint(count)"]
['Runtime Error', 'Accepted']
['s867487686', 's669377594']
[32236.0, 32172.0]
[2206.0, 364.0]
[310, 317]
p02642
u457901067
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['\nimport sys\n#import numpy as np\n#from numba import njit\n \nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\n\n\n\ndef solve(A):\n \n \n count = np.zeros(10**6 + 10, np.int32)\n for x in A:\n if count[x] > 1:\n continue\n count[::x] += 1\n ret = 0\n for x in A:\n ret += count[x] == 1\n return ret\n\ndef solve2(A):\n count = [0] * (10**6 + 10)\n for x in A:\n if count[x] > 1:\n continue\n for a in range(0,len(count),x):\n count[a] += 1\n ret = 0\n for x in A:\n ret += 1 if count[x] == 1 else 0\n return ret\n \n#A = np.array(read().split(), np.int32)[1:]\nA = list(map(int, input().split()))\nprint(solve2(A))', '\nimport sys\n#import numpy as np\n#from numba import njit\n \nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\n\n\n\ndef solve(A):\n \n \n count = np.zeros(10**6 + 10, np.int32)\n for x in A:\n if count[x] > 1:\n continue\n count[::x] += 1\n ret = 0\n for x in A:\n ret += count[x] == 1\n return ret\n\ndef solve2(A):\n count = [0 for _ in range(10**6 + 10)]\n for x in A:\n if count[x] > 1:\n continue\n for a in range(0,len(count),x):\n count[a] += 1\n ret = 0\n for x in A:\n ret += (1 if count[x] == 1 else 0)\n #print(count[:24])\n return ret\n \n\n#A = np.array(read().split(), np.int32)[1:]\nN = int(input())\nA = list(map(int, input().split()))\n\nprint(solve2(sorted(A)))\n']
['Wrong Answer', 'Accepted']
['s140521466', 's788542553']
[16704.0, 33052.0]
[96.0, 438.0]
[1096, 1336]
p02642
u459150945
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['import numpy as np\nfrom numba import njit\n@njit\ndef main():\n N = int(input())\n An = list(map(int, input().split()))\n ans = 0\n ng = set()\n a_An = np.array(An)\n for i, a in enumerate(An):\n temp = a_An / a\n temp[i] = 0.1\n check = np.where(temp % 1 == 0)\n check = check[0]\n # check = np.delete(check, np.where(check == i))\n \n if len(check) > 0:\n ng = ng | set(check)\n print(N-len(ng))\n\nif __name__ == "__main__":\n main()', 'import numpy as np\nN = int(input())\nAn = list(map(int, input().split()))\nans = 0\nng = set()\na_An = np.array(An)\nfor i, a in enumerate(An):\n temp = a_An / a\n temp[i] = 0.1\n check = np.where(temp % 1 == 0)\n check = np.delete(check, np.where(check == i))\n \n print(check)\n if len(check) > 0:\n ng = ng | set(check)\nprint(N-len(ng))\n', 'import numpy as np\n\nN = int(input())\nAn = list(map(int, input().split()))\nok = [False] * N\nng = set()\na_An = np.array(An)\nfor i, a in enumerate(An):\n temp = a_An / a\n temp[i] = 0.1\n check = (temp % 1 == 0)\n ok = ok | check\n print(ok)\n # check = np.delete(check, np.where(check == i))\n \n # if len(check) > 0:\n # ng = ng | set(check)\nok = list(ok)\nprint(ok.count(0))\n', 'N = int(input())\nAn = list(map(int, input().split()))\nAn.sort()\nmax_n = max(An)\ndp = [0] * (max_n + 1)\nfor i in range(N):\n if dp[An[i]] != 0:\n dp[An[i]] = 2\n continue\n for j in range(1, max_n//An[i] + 1):\n dp[An[i]*j] += 1\nans = 0\nfor a in An:\n if dp[a] == 1:\n ans += 1\nprint(ans)\n']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s252060962', 's888688004', 's949587643', 's590378402']
[106440.0, 113416.0, 51568.0, 32200.0]
[498.0, 2210.0, 2207.0, 595.0]
[527, 382, 423, 318]
p02642
u460399356
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\n \nA_list = [int(n) for n in input().split()]\n \nimport numpy as np\n \nA_array = np.array(A_list)\nsort_A = np.sort(A_array)\n\nn_array = np.zeros(10**6)\n \nfor a in sort_A:\n \n if n_array[a - 1] >= 2:\n continue\n \n a_times = np.array(range(a, 10**6+1, a))\n \n n_array[(a_times -1).astype(int)] += 1\n\n(n_array[sort_A - 1] == 1).sum()', 'N = int(input())\n \nA_list = [int(n) for n in input().split()]\n \nimport numpy as np\n \nA_array = np.array(A_list)\nsort_A = np.sort(A_array)\n\nn_array = np.zeros(10**6)\n \nfor a in sort_A:\n \n if n_array[a - 1] >= 2:\n continue\n \n a_times = np.array(range(a, 10**6+1, a))\n \n n_array[(a_times -1).astype(int)] += 1\n\nprint((n_array[sort_A - 1] == 1).sum())']
['Wrong Answer', 'Accepted']
['s476657708', 's187139640']
[99172.0, 99224.0]
[2207.0, 1756.0]
[370, 377]
p02642
u461463382
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['#import numpy as np\nN = int(input())\nA = list(map(int, input().split()))\nA = sorted(A)\nremove_list = []\n\nkouho = [x for x in set(A) if A.count(x) == 1]\n\n\nif kouho != []:\n maxA = max(kouho)\n\nfor i in range(len(A)):\n if kouho == []:\n break\n maxN = int(maxA/A[i])\n for n in range(2,maxN+1):\n buf = A[i]*n\n remove_list.append(buf)\n #print(A[i]*n)\n\n\nprint(len(kouho))', '#import numpy as np\n\nN = int(input())\nA = list(map(int, input().split()))\nA = sorted(A)\n\nkouho = [x for x in set(A) if A.count(x) == 1]\n\nmaxA = max(kouho)\n\nfor i in range(len(A)):\n if kouho == []:\n break\n maxN = int(maxA/A[i])\n for n in range(2,maxN):\n buf = A[i]*n\n if buf in kouho:\n kouho.remove(buf)\n #print(A[i]*n)\n\n\nprint(len(kouho))', '#import numpy as np\n\nN = int(input())\nA = list(map(int, input().split()))\nA.sort()\n\n#kouho = sorted([x for x in set(A) if A.count(x) == 1])\n#maxA = 10**5\n\n\nmaxA = A[-1]\nwork=[0]*(A[-1]+1)\n\nfor i in range(len(A)):\n maxN = int(maxA/A[i])\n for n in range(1,maxN+1):\n buf = A[i]*n\n \n work[buf]+=1\n #print(A[i]*n)\n\n\n\nsm=0\nfor s in A:\n if work[s]==1: sm+=1\nprint(sm)\n\n']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s587836928', 's672311380', 's798799980']
[50520.0, 32432.0, 33280.0]
[2206.0, 2206.0, 677.0]
[499, 439, 538]
p02642
u469254913
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['import numpy as np\n# import math\n# import copy\n# from collections import deque\nimport sys\ninput = sys.stdin.readline\n\nfrom numba import njit,i8\n\n\n@njit(i8[:](i8,i8,i8[:]))\ndef sieve(N,A,dp):\n for i in range(N):\n now = A[i]\n M = A[-1] // now\n for j in range(2,M+1):\n dp[now*j-1] = False\n return dp\n\n\n@njit(i8(i8,i8,i8[:]))\ndef cnt(N,A,dp):\n skip = 0\n res = 0\n for i in range(N):\n now = A[i]\n if skip == now:\n continue\n if i != N - 1:\n if now == A[i+1]:\n skip = now\n continue\n if dp[now-1]:\n res += 1\n return res\n\n\ndef main():\n N = int(input())\n A = list(map(int,input().split()))\n\n A = sorted(A)\n A = np.array(A)\n\n dp = np.array([True for i in range(A[-1])])\n # print(dp)\n dp = sieve(N,A,dp)\n # print(dp)\n\n res = cnt(N,A,dp)\n\n print(res)\n\n\n\nmain()\n', 'import numpy as np\n# import math\n# import copy\n# from collections import deque\nimport sys\ninput = sys.stdin.readline\n\nfrom numba import njit,i8,b1\n\n\n\n@njit\ndef sieve(N,A,dp):\n for i in range(N):\n now = A[i]\n M = A[-1] // now\n for j in range(2,M+1):\n dp[now*j-1] = False\n return dp\n\n\n\n@njit\ndef cnt(N,A,dp):\n skip = 0\n res = 0\n for i in range(N):\n now = A[i]\n if skip == now:\n continue\n if i != N - 1:\n if now == A[i+1]:\n skip = now\n continue\n if dp[now-1]:\n res += 1\n return res\n\n\ndef main():\n N = int(input())\n A = list(map(int,input().split()))\n\n A = sorted(A)\n A = np.array(A)\n\n dp = np.array([True for i in range(A[-1])])\n # print(dp)\n dp = sieve(N,A,dp)\n # print(dp)\n\n res = cnt(N,A,dp)\n\n print(res)\n\n\n\nmain()\n']
['Runtime Error', 'Accepted']
['s260877064', 's261081581']
[106724.0, 113564.0]
[493.0, 847.0]
[948, 967]
p02642
u470560351
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['from collections import deque\nN = int(input())\nA = sorted(list(map(int, input().split())))\n\nans = 0\n \nwhile True:\n d = A.pop(0)\n if A[0] == d:\n d = A.pop(0)\n else:\n A = list(reversed([ a for a in A[::-1] if a % d != 0]))\n ans += 1\n if A:\n True\n else:\n break\n \nprint(ans)', 'from numba import njit\nimport numpy as np\n\nN = int(input())\nA = list(map(int, input().split()))\n\n@njit\ndef main(A):\n count = np.zeros(10**6 + 10, np.int32)\n \n for i in range(N):\n a = A[i]\n if count[a] > 1:\n continue\n count[::a] += 1\n \n ans = 0\n for i in range(N):\n ans += count[A[i]] == 1\n \n #print(count[:100])\n return ans\n \nprint(main(np.array(A, np.int32)))']
['Runtime Error', 'Accepted']
['s111013988', 's393352878']
[33940.0, 129028.0]
[2206.0, 1984.0]
[292, 391]
p02642
u470717435
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input())\na = [int(i) for i in input().split()]\n\na.sort(reverse=True)\n\ncount = 0\nfor i in range(n-1):\n if all([a[i] % a[j] != 0 for j in range(i + 1, n)]):\n count += 1\nprint(count)', 'n = int(input())\na = [int(i) for i in input().split()]\n\na.sort()\nMax = a[-1]\nmemo = [1] * (Max+1)\ncount = 0\n\n# i<n-1\nfor i in range(n-1):\n t = a[i]\n if memo[t] == 1:\n if a[i] != a[i+1]:\n count += 1\n for j in [t*k for k in range(1, Max//t+1)]:\n memo[j] = 0\n# i=n-1\nif memo[a[n-1]] == 1:\n count += 1\n\nprint(count)\n\n""" #Time over\na.sort(reverse=True)\n\ncount = 0\n# i<n-1\nfor i in range(n-1):\n if a[i] != a[i+1] and a[i] != a[i-1]:\n for j in range(n-1, i, -1):\n if a[i] % a[j] == 0:\n break\n if j == i+1:\n count += 1\n\n# i==n-1\nif a[n-2] != a[n-1]:\n count += 1\n\nif n != 1:\n print(count)\nelif n == 1:\n print(1)\n"""']
['Wrong Answer', 'Accepted']
['s364350279', 's225473810']
[32088.0, 65872.0]
[2206.0, 583.0]
[197, 723]
p02642
u474423089
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
["N = int(input())\nA = sorted(list(map(int,input().split(' '))))\nans = 0\nL = [1]*(10**6+1)\nfor i in A:\n if not L[i]:\n continue\n ans += L[i]\n for j in (i,A[-1],i):\n L[j] = 0\nprint(ans) ", "from collections import Counter\nN = int(input())\nA = Counter(list(map(int,input().split(' '))))\nans = 0\nL = [1]*(10**6+1)\nfor i in sorted(A.keys()):\n if A[i] > 1:\n continue\n ans += L[i]\n for j in (i,A[-1],i):\n L[j] = 0\nprint(ans)", "from collections import Counter\nN = int(input())\nA = Counter(list(map(int,input().split(' '))))\nans = 0\nL = [1]*(10**6+1)\nfor i in sorted(A.keys()):\n if A[i] > 1:\n continue\n ans += L[i]\n for j in (i,10**6+1,i):\n L[j] = 0\nprint(ans)", 'from collections import Counter\nN = int(input())\nA = Counter([i for i in range(1,10**6+1)])\nans = 0\npre= 10**6+1\nfor i in sorted(A.keys(),reverse=True):\n flg = True\n if A[i] > 1:\n continue\n for j in range(1,min(int(pow(i,0.5))+2,pre)):\n if not i%j:\n if A[j] and i != j:\n flg = False\n break\n if j != i//j and A[i//j] and i//j != i:\n flg = False\n break\n if flg:\n ans += 1\n pre = i\nprint(ans)', "from collections import Counter\nN = int(input())\nA = Counter(list(map(int,input().split(' '))))\nans = 0\nm = max(A.keys())\nL = [1]*(10**6+1)\nfor i in sorted(A.keys()):\n if not L[i]:\n continue\n if A[i] == 1:\n ans += 1\n for j in range(i,m+1,i):\n L[j] = 0\nprint(ans)"]
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s156270433', 's300033714', 's350285459', 's643609148', 's712823942']
[32188.0, 38788.0, 38852.0, 110464.0, 38692.0]
[224.0, 262.0, 127.0, 1290.0, 401.0]
[212, 252, 254, 515, 292]
p02642
u476124554
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input())\na = list(map(int,input().split()))\na = sorted(a)\ns = set()\nsame_s = set()\nans = 0\nfor i in a:\n if i in s:\n same_s.add(i)\n if i not in s:\n same_s.add(i)\n ans +=1\n for j in range(10**6 // i + 1):\n s.add(j*i)\nprint(ans - len(same_s))', 'n = int(input())\na = list(map(int,input().split()))\na = sorted(a)\ns = set()\ns1 = set()\nsame_s = set()\nans = 0\nfor i in a:\n if i in s1:\n same_s.add(i)\n if i not in s:\n s1.add(i)\n ans +=1\n for j in range(10**6 // i + 1):\n s.add(j*i)\nprint(ans - len(same_s))']
['Wrong Answer', 'Accepted']
['s135695825', 's988357070']
[96304.0, 88560.0]
[751.0, 728.0]
[292, 300]
p02642
u477691921
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input()) \n*A, = map(int, input().split())\nmaxA = max(A)\nprint(A)\nprint(maxA)\n\n\n\n# C[a : count]\nC = {a : 0 for a in A}\n\n\n\nfor a in A:\n C[a] += 1\nprint(C)\n\n\nD = {a : 0 for a in A}\n\nfor a in A:\n if C[a] > 0:\n t = 2\n while a*t <=maxA:\n \n \n D[a*t] = 1\n t += 1\nprint(D)\n\nans = 0\nfor a in A:\n \n if C[a] == 1 and D[a] == 0:\n ans += 1\nprint(ans)\n', 'n = int(input()) \n*A, = map(int, input().split())\nmaxA = max(A)\n\n\n# C[a : count]\nC = {a : 0 for a in A}\n\n\n\nfor a in A:\n C[a] += 1\n\n\nD = {a : 0 for a in A}\n\nfor a in A:\n if C[a] > 0:\n t = 2\n while a*t <=maxA:\n \n \n D[a*t] = 1\n t += 1\n\nans = 0\nfor a in A:\n \n if C[a] == 1 and D[a] == 0:\n ans += 1\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s213250039', 's718708549']
[117812.0, 104148.0]
[1430.0, 1227.0]
[811, 771]
p02642
u482157295
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input())\na_li = list(map(int,input().split()))\ndum = [0]*10**6\nfor i in a_li:\n for j in range(i*2,10**6,i):\n dum[j-1] = 1\nprint(dum)', 'n = int(input())\na_li = list(map(int,input().split()))\ncnt = [0]*(10**6+1)\n\n\nfor i in a_li:\n cnt[i] += 1\nunique = []\nfor i in range(10**6+1):\n if cnt[i] == 1:\n unique.append(i)\n\n\na_li = set(a_li)\n\ncnt = [0]*(10**6+1)\n\nfor i in a_li:\n for j in range(i * 2, 10 ** 6 + 1, i):\n cnt[j] = 1\n\nans = 0\nfor i in unique:\n if cnt[i] == 0:\n ans += 1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s231428893', 's455030401']
[32784.0, 49624.0]
[2206.0, 1291.0]
[150, 395]
p02642
u488884575
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
["n = int(input())\nA = list(map(int, input().split()))\nfrom collections import Counter\nc = Counter(A)\nsorted_key = sorted(c.keys(),reverse=True)\nres = [0]*len(sorted_key)\nans = n\n\n#for i,key in enumerate(sorted_key):\nfor key in sorted_key:\n if c[key]>1:\n ans -= c[key]\n continue\n for j in range(len(sorted_key)-1, i, -1):\n \n if (key/sorted_key[j]>=1) and (key%sorted_key[j])==0:\n #res[i] = 1\n ans -= c[key]\n #print('===========',)\n break\n\n#print('res', res)\n#print(c)\n'''ans = 0\nfor i,v in enumerate(sorted_key):\n if res[i]:\n ans += c[sorted_key[i]]\n else:\n if c[v] >1:\n ans += c[sorted_key[i]]'''\nprint(ans)", "n = int(input())\nA = sorted(list(map(int, input().split())))\nfrom collections import Counter\nc = Counter(A)\n\ndp = [1]*(max(A)+1)\n#print(dp)\nfor i in c.keys():\n j = i*2\n while j<len(dp):\n dp[j] = 0\n j += i\n #print(j, end=',')\nans = 0\nfor i in c.keys():\n if c[i] == 1:\n if dp[i] == 1:\n ans += 1\nprint(ans)\n"]
['Runtime Error', 'Accepted']
['s213432853', 's948452178']
[36136.0, 38288.0]
[138.0, 765.0]
[762, 352]
p02642
u494058663
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input())\nA = [int(i) for i in input().split()]\nMax = max(A)\ncnt_dict = collections.Counter(A)\n\nDict = {a:True for a in A}\nfor a in A:\n times = 2\n while a*times<=Max:\n Dict[a*times]=False\n times +=1\nans = 0\nfor a in A:\n if cnt_dict[a]==1 and Dict[a]:\n ans +=1\nprint(ans)\n', 'from collections import deque\nimport collections\nimport math\n\n\n\nn = int(input())\nA = [int(i) for i in input().split()]\nA.sort()\nMax = max(A)\ncnt_dict = collections.Counter(A)\n\nDict = {a:True for a in A}\nfor a in A:\n times = 2\n while a*times<=Max:\n Dict[a*times]=False\n times +=1\nans = 0\nfor a in A:\n if cnt_dict[a]==1 and Dict[a]:\n ans +=1\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s894518637', 's943660969']
[32044.0, 105056.0]
[77.0, 1152.0]
[367, 879]
p02642
u497046426
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\n*A, = map(int, input().split())\nA = sorted(A)\nchecked = [True] * N\nans = 0\nfor i, a in enumerate(A):\n if not checked[i]: continue\n flag = True\n for j in range(i+1, N):\n if A[j] % a == 0: checked[j] = False; flag = False\n if flag: ans += 1 \nprint(ans)', 'from collections import Counter\n\nN = int(input())\n*A, = map(int, input().split())\nA = sorted(A)\nmax_A = A[-1]\ncnt = Counter(A)\nadmissible = [True] * (max_A + 1)\nchecked = [False] * (max_A + 1)\nans = 0\nfor a in A:\n if not admissible[a] or checked[a]: continue\n ans += 1\n i = 2\n while a * i <= max_A:\n admissible[a * i] = False\n i += 1\n checked[a] = True\n if cnt[a] > 1: ans -= 1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s727603962', 's751213395']
[32176.0, 46308.0]
[2206.0, 613.0]
[286, 420]
p02642
u497592162
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
["N = int(input())\nA = sorted(list(map(int, input().split(' '))))\nA_max = A[-1]\ndp = [True]*(A_max+1)\nans = 0\nfor i in range(N-1):\n p = A[i]\n if dp[i] == True:\n for q in range(A_max//p+1):\n dp[p*q] = False\n if A[i] != A[i+1]:\n ans += 1\nif dp[-1] != True:\n ans += 1 \nprint(ans)", "N = int(input())\nA = sorted(list(map(int, input().split(' '))))\n# print(A)\na_max = A[-1]\ndp = [True]*(a_max+1)\nans = 0\nfor i in range(N-1):\n p = A[i]\n if dp[p] == True:\n # print(math.sqrt(p))\n for q in range(a_max//p+1):\n # print(p*q)\n dp[p*q] = False\n if A[i] != A[i+1]:\n ans += 1\nif dp[A[-1]]:\n ans += 1\nprint(ans)\n"]
['Runtime Error', 'Accepted']
['s616289089', 's638345161']
[32372.0, 32196.0]
[364.0, 444.0]
[319, 380]
p02642
u500376440
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['from collections import Counter\nteisuu1=10**6\nN=int(input())\nA=list(map(int,input().split()))\ncount_A=Counter(A)\nprint(count_A)\ndp=[True]*(teisuu1+1)\ns=list(set(A))\nfor i in s:\n temp=i*2\n while temp<=teisuu1:\n dp[temp]=False\n temp+=i\nans=0\nfor i in A:\n if count_A[i]==1 and dp[i]==True:\n ans+=1\nprint(ans)\n', 'N=int(input())\nA=list(map(int,input().split()))\ndp=[0]*(10**6+1)\nans=0\nfor i in A:\n if dp[i]==0:\n for j in range(i,10**6+1,i):\n dp[j]+=1\n else:\n dp[i]+=1\nfor i in A:\n if dp[i]==1:\n ans+=1\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s996482731', 's402384907']
[57164.0, 32228.0]
[2048.0, 641.0]
[318, 216]
p02642
u505564549
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['import sys\ninput = sys.stdin.readline\n\nn=int(input())\nL=list(map(int,input().split()))\nL.sort()\nhb = L[-1]\ndp = [-1 for i in range(hb+1)] \nprint(L)\nfor i in L:\n if dp[i]!=0:\n if dp[i]==1:\n dp[i]=0\n continue\n dp[i]=1\n for j in range(2*i,hb+1,i):\n dp[j]=0\nans=0\nfor i in L:\n if dp[i]==1:\n ans+=1\nprint(ans)\n\n\n', 'import sys\ninput = sys.stdin.readline\n\nn=int(input())\nL=list(map(int,input().split()))\nL.sort()\nhb = L[-1]\ndp = [-1 for i in range(hb+1)] \nfor i in L:\n if dp[i]!=0:\n if dp[i]==1:\n dp[i]=0\n continue\n dp[i]=1\n for j in range(2*i,hb+1,i):\n dp[j]=0\nans=0\nfor i in L:\n if dp[i]==1:\n ans+=1\nprint(ans)\n\n\n']
['Wrong Answer', 'Accepted']
['s240449281', 's644062985']
[31620.0, 31520.0]
[364.0, 338.0]
[374, 365]
p02642
u509739538
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['import math\nfrom collections import deque\nfrom collections import defaultdict\nimport itertools as it\n\n\ndef readInt():\n\treturn int(input())\ndef readInts():\n\treturn list(map(int, input().split()))\ndef readChar():\n\treturn input()\ndef readChars():\n\treturn input().split()\ndef factorization(n):\n\tres = []\n\tif n%2==0:\n\t\tres.append(2)\n\tfor i in range(3,math.floor(n//2)+1,2):\n\t\tif n%i==0:\n\t\t\tc = 0\n\t\t\tfor j in res:\n\t\t\t\tif i%j==0:\n\t\t\t\t\tc=1\n\t\t\tif c==0:\n\t\t\t\tres.append(i)\n\tif len(res)==0:\n\t\tres = [n]\n\treturn res\ndef fact2(n):\n\tp = factorization(n)\n\tres = []\n\tfor i in p:\n\t\tc=0\n\t\tz=n\n\t\twhile 1:\n\t\t\tif z%i==0:\n\t\t\t\tc+=1\n\t\t\t\tz/=i\n\t\t\telse:\n\t\t\t\tbreak\n\t\tres.append([i,c])\n\treturn res\ndef fact(n):\n\tans = 1\n\tm=n\n\tfor _i in range(n-1):\n\t\tans*=m\n\t\tm-=1\n\treturn ans\ndef comb(n,r):\n\tif n<r:\n\t\treturn 0\n\tl = min(r,n-r)\n\tm=n\n\tu=1\n\tfor _i in range(l):\n\t\tu*=m\n\t\tm-=1\n\treturn u//fact(l)\ndef combmod(n,r,mod):\n\treturn (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod\ndef printQueue(q):\n\tr=copyQueue(q)\n\tans=[0]*r.qsize()\n\tfor i in range(r.qsize()-1,-1,-1):\n\t\tans[i] = r.get()\n\tprint(ans)\nclass UnionFind():\n\tdef __init__(self, n):\n\t\tself.n = n\n\t\tself.parents = [-1]*n\n\n\tdef find(self, x): # root\n\t\tif self.parents[x]<0:\n\t\t\treturn x\n\t\telse:\n\t\t\tself.parents[x] = self.find(self.parents[x])\n\t\t\treturn self.parents[x]\n\n\tdef union(self,x,y):\n\t\tx = self.find(x)\n\t\ty = self.find(y)\n\n\t\tif x==y:\n\t\t\treturn\n\n\t\tif self.parents[x]>self.parents[y]:\n\t\t\tx,y = y,x\n\n\t\tself.parents[x]+=self.parents[y]\n\t\tself.parents[y]=x\n\n\tdef size(self,x):\n\t\treturn -1*self.parents[self.find(x)]\n\n\tdef same(self,x,y):\n\t\treturn self.find(x)==self.find(y)\n\n\tdef members(self,x): # much time\n\t\troot = self.find(x)\n\t\treturn [i for i in range(self.n) if self.find(i)==root]\n\n\tdef roots(self):\n\t\treturn [i for i,x in enumerate(self.parents) if x<0]\n\n\tdef group_count(self):\n\t\treturn len(self.roots())\n\n\tdef all_group_members(self):\n\t\treturn {r: self.members(r) for r in self.roots()} # 1~n\ndef bitArr(n):\n\tx = 1\n\tzero = "0"*n\n\tans = []\n\tans.append([0]*n)\n\tfor i in range(2**n-1):\n\t\tans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))\n\t\tx+=1\n\treturn ans;\ndef arrsSum(a1,a2):\n\tfor i in range(len(a1)):\n\t\ta1[i]+=a2[i]\n\treturn a1\ndef maxValue(a,b,v):\n\tv2 = v\n\tfor i in range(v2,-1,-1):\n\t\tfor j in range(v2//a+1): \n\t\t\tk = i-a*j\n\t\t\tif k%b==0:\n\t\t\t\treturn i\n\treturn -1\ndef copyQueue(q):\n\tnq = queue.Queue()\n\tn = q.qsize()\n\tfor i in range(n):\n\t\tx = q.get()\n\t\tq.put(x)\n\t\tnq.put(x)\n\treturn nq\ndef get_sieve_of_eratosthenes(n):\n\tdata = [2]\n\t#data = [0,0,0]\n\tfor i in range(3,n+1,2):\n\t\tdata.append(i)\n\t\tdata.append(0)\n\tfor i in range(len(data)):\n\t\tinterval = data[i]\n\t\tif interval!=0:\n\t\t\tfor j in range(i+interval,n-1,interval):\n\t\t\t\tdata[j] = 0\n\tans = [x for x in data if x!=0]\n\t\n\treturn ans\n\nn = readInt()\na = readInts()\n\nd = defaultdict(int)\n\nfor i in a:\n\td[i]+=1\n\narr = []\nfor i in d:\n\tif d[i]==1:\n\t\tarr.append(i)\narr.sort()\n\nif len(arr)==0:\n\tprint(0)\n\texit()\n\nmaxa = max(arr)\n\nans = [0]*(maxa+1)\nfor i in arr:\n\tans[i]=1\n\nfor i in arr:\n\tfor j in range(i*2,len(arr),i):\n\t\tans[j]=0\n\nprint(ans.count(1))', 'n,a = int(input()),map(int,input().split())\na.sort()\n\nmax_a = a[-1]\nans = [0]*(max_a+1)\n\nfor i in a:\n\tans[i]+=1\nfor i in set(a):\n\tif ans[i]:\n\t\tfor j in range(i*2,len(ans),i):\n\t\t\tans[j]=0\n\nprint(ans.count(1))', 'import math\nfrom collections import deque\nfrom collections import defaultdict\nimport itertools as it\n\n\ndef readInt():\n\treturn int(input())\ndef readInts():\n\treturn list(map(int, input().split()))\ndef readChar():\n\treturn input()\ndef readChars():\n\treturn input().split()\ndef factorization(n):\n\tres = []\n\tif n%2==0:\n\t\tres.append(2)\n\tfor i in range(3,math.floor(n//2)+1,2):\n\t\tif n%i==0:\n\t\t\tc = 0\n\t\t\tfor j in res:\n\t\t\t\tif i%j==0:\n\t\t\t\t\tc=1\n\t\t\tif c==0:\n\t\t\t\tres.append(i)\n\tif len(res)==0:\n\t\tres = [n]\n\treturn res\ndef fact2(n):\n\tp = factorization(n)\n\tres = []\n\tfor i in p:\n\t\tc=0\n\t\tz=n\n\t\twhile 1:\n\t\t\tif z%i==0:\n\t\t\t\tc+=1\n\t\t\t\tz/=i\n\t\t\telse:\n\t\t\t\tbreak\n\t\tres.append([i,c])\n\treturn res\ndef fact(n):\n\tans = 1\n\tm=n\n\tfor _i in range(n-1):\n\t\tans*=m\n\t\tm-=1\n\treturn ans\ndef comb(n,r):\n\tif n<r:\n\t\treturn 0\n\tl = min(r,n-r)\n\tm=n\n\tu=1\n\tfor _i in range(l):\n\t\tu*=m\n\t\tm-=1\n\treturn u//fact(l)\ndef combmod(n,r,mod):\n\treturn (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod\ndef printQueue(q):\n\tr=copyQueue(q)\n\tans=[0]*r.qsize()\n\tfor i in range(r.qsize()-1,-1,-1):\n\t\tans[i] = r.get()\n\tprint(ans)\nclass UnionFind():\n\tdef __init__(self, n):\n\t\tself.n = n\n\t\tself.parents = [-1]*n\n\n\tdef find(self, x): # root\n\t\tif self.parents[x]<0:\n\t\t\treturn x\n\t\telse:\n\t\t\tself.parents[x] = self.find(self.parents[x])\n\t\t\treturn self.parents[x]\n\n\tdef union(self,x,y):\n\t\tx = self.find(x)\n\t\ty = self.find(y)\n\n\t\tif x==y:\n\t\t\treturn\n\n\t\tif self.parents[x]>self.parents[y]:\n\t\t\tx,y = y,x\n\n\t\tself.parents[x]+=self.parents[y]\n\t\tself.parents[y]=x\n\n\tdef size(self,x):\n\t\treturn -1*self.parents[self.find(x)]\n\n\tdef same(self,x,y):\n\t\treturn self.find(x)==self.find(y)\n\n\tdef members(self,x): # much time\n\t\troot = self.find(x)\n\t\treturn [i for i in range(self.n) if self.find(i)==root]\n\n\tdef roots(self):\n\t\treturn [i for i,x in enumerate(self.parents) if x<0]\n\n\tdef group_count(self):\n\t\treturn len(self.roots())\n\n\tdef all_group_members(self):\n\t\treturn {r: self.members(r) for r in self.roots()} # 1~n\ndef bitArr(n):\n\tx = 1\n\tzero = "0"*n\n\tans = []\n\tans.append([0]*n)\n\tfor i in range(2**n-1):\n\t\tans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))\n\t\tx+=1\n\treturn ans;\ndef arrsSum(a1,a2):\n\tfor i in range(len(a1)):\n\t\ta1[i]+=a2[i]\n\treturn a1\ndef maxValue(a,b,v):\n\tv2 = v\n\tfor i in range(v2,-1,-1):\n\t\tfor j in range(v2//a+1): \n\t\t\tk = i-a*j\n\t\t\tif k%b==0:\n\t\t\t\treturn i\n\treturn -1\ndef copyQueue(q):\n\tnq = queue.Queue()\n\tn = q.qsize()\n\tfor i in range(n):\n\t\tx = q.get()\n\t\tq.put(x)\n\t\tnq.put(x)\n\treturn nq\ndef get_sieve_of_eratosthenes(n):\n\tdata = [2]\n\t#data = [0,0,0]\n\tfor i in range(3,n+1,2):\n\t\tdata.append(i)\n\t\tdata.append(0)\n\tfor i in range(len(data)):\n\t\tinterval = data[i]\n\t\tif interval!=0:\n\t\t\tfor j in range(i+interval,n-1,interval):\n\t\t\t\tdata[j] = 0\n\tans = [x for x in data if x!=0]\n\t\n\treturn ans\n\nn = readInt()\na = readInts()\n\na.sort()\nmaxa = max(a)+1\nd = defaultdict(int)\nfor i in a:\n\td[i]+=1\ntmp = []\nfor i in d:\n\tif d[i]==1:\n\t\ttmp.append(i)\na = tmp[:]\n\nprint(a)\n\n\nans = [0]*maxa\nfor i in a:\n\tans[i] = 1\n\n\n\nfor j in a:\n\tif ans[j]==0:\n\t\tpass\n\tfor i in range(j*2,10**7+1,j):\n\t\tif i>maxa-1:\n\t\t\tbreak\n\t\tans[i] = 0\n\nprint(ans.count(1))', 'import math\nfrom collections import deque\nfrom collections import defaultdict\nimport itertools as it\n\n\ndef readInt():\n\treturn int(input())\ndef readInts():\n\treturn list(map(int, input().split()))\ndef readChar():\n\treturn input()\ndef readChars():\n\treturn input().split()\ndef factorization(n):\n\tres = []\n\tif n%2==0:\n\t\tres.append(2)\n\tfor i in range(3,math.floor(n//2)+1,2):\n\t\tif n%i==0:\n\t\t\tc = 0\n\t\t\tfor j in res:\n\t\t\t\tif i%j==0:\n\t\t\t\t\tc=1\n\t\t\tif c==0:\n\t\t\t\tres.append(i)\n\tif len(res)==0:\n\t\tres = [n]\n\treturn res\ndef fact2(n):\n\tp = factorization(n)\n\tres = []\n\tfor i in p:\n\t\tc=0\n\t\tz=n\n\t\twhile 1:\n\t\t\tif z%i==0:\n\t\t\t\tc+=1\n\t\t\t\tz/=i\n\t\t\telse:\n\t\t\t\tbreak\n\t\tres.append([i,c])\n\treturn res\ndef fact(n):\n\tans = 1\n\tm=n\n\tfor _i in range(n-1):\n\t\tans*=m\n\t\tm-=1\n\treturn ans\ndef comb(n,r):\n\tif n<r:\n\t\treturn 0\n\tl = min(r,n-r)\n\tm=n\n\tu=1\n\tfor _i in range(l):\n\t\tu*=m\n\t\tm-=1\n\treturn u//fact(l)\ndef combmod(n,r,mod):\n\treturn (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod\ndef printQueue(q):\n\tr=copyQueue(q)\n\tans=[0]*r.qsize()\n\tfor i in range(r.qsize()-1,-1,-1):\n\t\tans[i] = r.get()\n\tprint(ans)\nclass UnionFind():\n\tdef __init__(self, n):\n\t\tself.n = n\n\t\tself.parents = [-1]*n\n\n\tdef find(self, x): # root\n\t\tif self.parents[x]<0:\n\t\t\treturn x\n\t\telse:\n\t\t\tself.parents[x] = self.find(self.parents[x])\n\t\t\treturn self.parents[x]\n\n\tdef union(self,x,y):\n\t\tx = self.find(x)\n\t\ty = self.find(y)\n\n\t\tif x==y:\n\t\t\treturn\n\n\t\tif self.parents[x]>self.parents[y]:\n\t\t\tx,y = y,x\n\n\t\tself.parents[x]+=self.parents[y]\n\t\tself.parents[y]=x\n\n\tdef size(self,x):\n\t\treturn -1*self.parents[self.find(x)]\n\n\tdef same(self,x,y):\n\t\treturn self.find(x)==self.find(y)\n\n\tdef members(self,x): # much time\n\t\troot = self.find(x)\n\t\treturn [i for i in range(self.n) if self.find(i)==root]\n\n\tdef roots(self):\n\t\treturn [i for i,x in enumerate(self.parents) if x<0]\n\n\tdef group_count(self):\n\t\treturn len(self.roots())\n\n\tdef all_group_members(self):\n\t\treturn {r: self.members(r) for r in self.roots()} # 1~n\ndef bitArr(n):\n\tx = 1\n\tzero = "0"*n\n\tans = []\n\tans.append([0]*n)\n\tfor i in range(2**n-1):\n\t\tans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))\n\t\tx+=1\n\treturn ans;\ndef arrsSum(a1,a2):\n\tfor i in range(len(a1)):\n\t\ta1[i]+=a2[i]\n\treturn a1\ndef maxValue(a,b,v):\n\tv2 = v\n\tfor i in range(v2,-1,-1):\n\t\tfor j in range(v2//a+1): \n\t\t\tk = i-a*j\n\t\t\tif k%b==0:\n\t\t\t\treturn i\n\treturn -1\ndef copyQueue(q):\n\tnq = queue.Queue()\n\tn = q.qsize()\n\tfor i in range(n):\n\t\tx = q.get()\n\t\tq.put(x)\n\t\tnq.put(x)\n\treturn nq\ndef get_sieve_of_eratosthenes(n):\n\tdata = [2]\n\t#data = [0,0,0]\n\tfor i in range(3,n+1,2):\n\t\tdata.append(i)\n\t\tdata.append(0)\n\tfor i in range(len(data)):\n\t\tinterval = data[i]\n\t\tif interval!=0:\n\t\t\tfor j in range(i+interval,n-1,interval):\n\t\t\t\tdata[j] = 0\n\tans = [x for x in data if x!=0]\n\t\n\treturn ans\n\nn = readInt()\na = readInts()\na.sort()\n\n#max_a = 10**6\nmax_a = a[-1]\nans = [0]*(max_a+1)\n\nfor i in a:\n\tif ans[i]!=2:\n\t\tans[i]+=1\nfor i in set(a):\n\tif ans[i]<=2:\n\t\tfor j in range(i*2,len(ans),i):\n\t\t\tans[j]+=1\n\nprint(ans.count(1))', 'import math\nfrom collections import deque\nfrom collections import defaultdict\nimport itertools as it\n\n\ndef readInt():\n\treturn int(input())\ndef readInts():\n\treturn list(map(int, input().split()))\ndef readChar():\n\treturn input()\ndef readChars():\n\treturn input().split()\ndef factorization(n):\n\tres = []\n\tif n%2==0:\n\t\tres.append(2)\n\tfor i in range(3,math.floor(n//2)+1,2):\n\t\tif n%i==0:\n\t\t\tc = 0\n\t\t\tfor j in res:\n\t\t\t\tif i%j==0:\n\t\t\t\t\tc=1\n\t\t\tif c==0:\n\t\t\t\tres.append(i)\n\tif len(res)==0:\n\t\tres = [n]\n\treturn res\ndef fact2(n):\n\tp = factorization(n)\n\tres = []\n\tfor i in p:\n\t\tc=0\n\t\tz=n\n\t\twhile 1:\n\t\t\tif z%i==0:\n\t\t\t\tc+=1\n\t\t\t\tz/=i\n\t\t\telse:\n\t\t\t\tbreak\n\t\tres.append([i,c])\n\treturn res\ndef fact(n):\n\tans = 1\n\tm=n\n\tfor _i in range(n-1):\n\t\tans*=m\n\t\tm-=1\n\treturn ans\ndef comb(n,r):\n\tif n<r:\n\t\treturn 0\n\tl = min(r,n-r)\n\tm=n\n\tu=1\n\tfor _i in range(l):\n\t\tu*=m\n\t\tm-=1\n\treturn u//fact(l)\ndef combmod(n,r,mod):\n\treturn (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod\ndef printQueue(q):\n\tr=copyQueue(q)\n\tans=[0]*r.qsize()\n\tfor i in range(r.qsize()-1,-1,-1):\n\t\tans[i] = r.get()\n\tprint(ans)\nclass UnionFind():\n\tdef __init__(self, n):\n\t\tself.n = n\n\t\tself.parents = [-1]*n\n\n\tdef find(self, x): # root\n\t\tif self.parents[x]<0:\n\t\t\treturn x\n\t\telse:\n\t\t\tself.parents[x] = self.find(self.parents[x])\n\t\t\treturn self.parents[x]\n\n\tdef union(self,x,y):\n\t\tx = self.find(x)\n\t\ty = self.find(y)\n\n\t\tif x==y:\n\t\t\treturn\n\n\t\tif self.parents[x]>self.parents[y]:\n\t\t\tx,y = y,x\n\n\t\tself.parents[x]+=self.parents[y]\n\t\tself.parents[y]=x\n\n\tdef size(self,x):\n\t\treturn -1*self.parents[self.find(x)]\n\n\tdef same(self,x,y):\n\t\treturn self.find(x)==self.find(y)\n\n\tdef members(self,x): # much time\n\t\troot = self.find(x)\n\t\treturn [i for i in range(self.n) if self.find(i)==root]\n\n\tdef roots(self):\n\t\treturn [i for i,x in enumerate(self.parents) if x<0]\n\n\tdef group_count(self):\n\t\treturn len(self.roots())\n\n\tdef all_group_members(self):\n\t\treturn {r: self.members(r) for r in self.roots()} # 1~n\ndef bitArr(n):\n\tx = 1\n\tzero = "0"*n\n\tans = []\n\tans.append([0]*n)\n\tfor i in range(2**n-1):\n\t\tans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))\n\t\tx+=1\n\treturn ans;\ndef arrsSum(a1,a2):\n\tfor i in range(len(a1)):\n\t\ta1[i]+=a2[i]\n\treturn a1\ndef maxValue(a,b,v):\n\tv2 = v\n\tfor i in range(v2,-1,-1):\n\t\tfor j in range(v2//a+1): \n\t\t\tk = i-a*j\n\t\t\tif k%b==0:\n\t\t\t\treturn i\n\treturn -1\ndef copyQueue(q):\n\tnq = queue.Queue()\n\tn = q.qsize()\n\tfor i in range(n):\n\t\tx = q.get()\n\t\tq.put(x)\n\t\tnq.put(x)\n\treturn nq\ndef get_sieve_of_eratosthenes(n):\n\tdata = [2]\n\t#data = [0,0,0]\n\tfor i in range(3,n+1,2):\n\t\tdata.append(i)\n\t\tdata.append(0)\n\tfor i in range(len(data)):\n\t\tinterval = data[i]\n\t\tif interval!=0:\n\t\t\tfor j in range(i+interval,n-1,interval):\n\t\t\t\tdata[j] = 0\n\tans = [x for x in data if x!=0]\n\t\n\treturn ans\n\nn = readInt()\na = readInts().sort()\n\nmax_a = a[-1]\nans = [0]*(max_a+1)\n\nfor i in a:\n\tans[i]+=1\nfor i in set(a):\n\tif ans[i]:\n\t\tfor j in range(i*2,len(ans),i):\n\t\t\tans[j]=0\n\nprint(ans.count(1))', 'import math\nfrom collections import deque\nfrom collections import defaultdict\nimport itertools as it\n\n\ndef readInt():\n\treturn int(input())\ndef readInts():\n\treturn list(map(int, input().split()))\ndef readChar():\n\treturn input()\ndef readChars():\n\treturn input().split()\ndef factorization(n):\n\tres = []\n\tif n%2==0:\n\t\tres.append(2)\n\tfor i in range(3,math.floor(n//2)+1,2):\n\t\tif n%i==0:\n\t\t\tc = 0\n\t\t\tfor j in res:\n\t\t\t\tif i%j==0:\n\t\t\t\t\tc=1\n\t\t\tif c==0:\n\t\t\t\tres.append(i)\n\tif len(res)==0:\n\t\tres = [n]\n\treturn res\ndef fact2(n):\n\tp = factorization(n)\n\tres = []\n\tfor i in p:\n\t\tc=0\n\t\tz=n\n\t\twhile 1:\n\t\t\tif z%i==0:\n\t\t\t\tc+=1\n\t\t\t\tz/=i\n\t\t\telse:\n\t\t\t\tbreak\n\t\tres.append([i,c])\n\treturn res\ndef fact(n):\n\tans = 1\n\tm=n\n\tfor _i in range(n-1):\n\t\tans*=m\n\t\tm-=1\n\treturn ans\ndef comb(n,r):\n\tif n<r:\n\t\treturn 0\n\tl = min(r,n-r)\n\tm=n\n\tu=1\n\tfor _i in range(l):\n\t\tu*=m\n\t\tm-=1\n\treturn u//fact(l)\ndef combmod(n,r,mod):\n\treturn (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod\ndef printQueue(q):\n\tr=copyQueue(q)\n\tans=[0]*r.qsize()\n\tfor i in range(r.qsize()-1,-1,-1):\n\t\tans[i] = r.get()\n\tprint(ans)\nclass UnionFind():\n\tdef __init__(self, n):\n\t\tself.n = n\n\t\tself.parents = [-1]*n\n\n\tdef find(self, x): # root\n\t\tif self.parents[x]<0:\n\t\t\treturn x\n\t\telse:\n\t\t\tself.parents[x] = self.find(self.parents[x])\n\t\t\treturn self.parents[x]\n\n\tdef union(self,x,y):\n\t\tx = self.find(x)\n\t\ty = self.find(y)\n\n\t\tif x==y:\n\t\t\treturn\n\n\t\tif self.parents[x]>self.parents[y]:\n\t\t\tx,y = y,x\n\n\t\tself.parents[x]+=self.parents[y]\n\t\tself.parents[y]=x\n\n\tdef size(self,x):\n\t\treturn -1*self.parents[self.find(x)]\n\n\tdef same(self,x,y):\n\t\treturn self.find(x)==self.find(y)\n\n\tdef members(self,x): # much time\n\t\troot = self.find(x)\n\t\treturn [i for i in range(self.n) if self.find(i)==root]\n\n\tdef roots(self):\n\t\treturn [i for i,x in enumerate(self.parents) if x<0]\n\n\tdef group_count(self):\n\t\treturn len(self.roots())\n\n\tdef all_group_members(self):\n\t\treturn {r: self.members(r) for r in self.roots()} # 1~n\ndef bitArr(n):\n\tx = 1\n\tzero = "0"*n\n\tans = []\n\tans.append([0]*n)\n\tfor i in range(2**n-1):\n\t\tans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))\n\t\tx+=1\n\treturn ans;\ndef arrsSum(a1,a2):\n\tfor i in range(len(a1)):\n\t\ta1[i]+=a2[i]\n\treturn a1\ndef maxValue(a,b,v):\n\tv2 = v\n\tfor i in range(v2,-1,-1):\n\t\tfor j in range(v2//a+1): \n\t\t\tk = i-a*j\n\t\t\tif k%b==0:\n\t\t\t\treturn i\n\treturn -1\ndef copyQueue(q):\n\tnq = queue.Queue()\n\tn = q.qsize()\n\tfor i in range(n):\n\t\tx = q.get()\n\t\tq.put(x)\n\t\tnq.put(x)\n\treturn nq\ndef get_sieve_of_eratosthenes(n):\n\tdata = [2]\n\t#data = [0,0,0]\n\tfor i in range(3,n+1,2):\n\t\tdata.append(i)\n\t\tdata.append(0)\n\tfor i in range(len(data)):\n\t\tinterval = data[i]\n\t\tif interval!=0:\n\t\t\tfor j in range(i+interval,n-1,interval):\n\t\t\t\tdata[j] = 0\n\tans = [x for x in data if x!=0]\n\t\n\treturn ans\n\nn = readInt()\na = readInts()\na.sort()\n\nmax_a = 10**6\nans = [[0,0]*(max_a+1)]\n\nfor i in a:\n\tans[i][0]+=1\n\tans[i][1]+=1\nfor i in set(a):\n\tif ans[i][1]>0:\n\t\tfor j in range(i*2,len(ans),i):\n\t\t\tans[j][0]+=2\n\ncount = 0\nfor i in ans:\n\tif i[1]>0 and i[0]==1:\n\t\tcount+=1\n\nprint(count)', 'n,a=int(input()),sorted(list(map(int,input().split())))\nm=a[-1]+1\ns=[0]*m\nfor i in a:s[i]+=1\nfor i in set(a):\n\tif s[i]:\n\t\tfor j in range(i*2,m,i):s[j]=0\nprint(s.count(1))']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s007266630', 's187000824', 's670440312', 's756561710', 's908109149', 's943477589', 's316003031']
[38316.0, 24584.0, 41544.0, 40668.0, 33824.0, 37556.0, 40236.0]
[439.0, 42.0, 727.0, 428.0, 111.0, 142.0, 344.0]
[3154, 207, 3160, 3052, 3015, 3100, 170]
p02642
u514118270
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['from collections import Counter\nM=10**7\n_,*l=map(int,open(0).read().split())\nd=[1]*(sorted(M))\nC=Counter(l)\ns=0\nfor a,b in C.items():\n if b != 1:d[a]=0\n elif d[a]:s+=1\n for j in range(a,M,a):d[j]=0\nprint(s)\n', 'from collections import Counter\nM=10**7\n_,*l=map(int,open(0).read().split())\nd=[1]*(M)\nC=Counter(sorted(l)\ns=0\nfor a,b in C.items():\n if b != 1:d[a]=0\n elif d[a]:s+=1\n for j in range(a,M,a):d[j]=0\nprint(s)\n', 'M=10**6+1\n_,*l=map(int,open(0).read().split())\na=[0]*M\nfor i in sorted(l):\n a[i]+=1\n if a[i]==1:\n for j in range(2*i,M,i):a[j]+=9\nprint(a.count(1))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s227269664', 's402076825', 's503585475']
[33264.0, 9036.0, 33268.0]
[65.0, 21.0, 414.0]
[216, 215, 152]
p02642
u514401521
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['import sys\n\nN = int(input())\nA = list(map(int, sys.stdin.readline()[:-1]))\n\nA.sort()\nif len(A) == 1:\n print(1)\n sys.exit(0)\nelif A[0] == A[-1]:\n print(0)\n sys.exit(0)\nelif A[0] == 1:\n print(1)\n sys.exit(0)\n\n\nd =[]\n\nfor i in range(len(A)):\n flag = True\n for j in d:\n if A[i] % j == 0:\n flag = False\n break\n if flag:\n d.append(A[i])\n\nprint(len(d))\n', 'N = int(input())\nA = list(map(int, input().split()))\n\nl = [0] *(10**6+1)\n\nfor i in range(N):\n num = A[i]\n if l[num] != 0:\n l[num] = 2\n continue\n for j in range(num, 10**6+1, num):\n l[j] += 1\nans = 0\nfor i in range(N):\n num = A[i]\n if l[num] == 1:\n ans += 1\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s362778006', 's922549169']
[11940.0, 32156.0]
[31.0, 568.0]
[409, 311]
p02642
u522945737
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['for i in range(1e6):\n i**2\n ', 'for i in range(int(1e6)):\n i**2', 'for i in range(1000000):\n i**2', 'N = int(input())\nA = list(map(int, input().split()))\n\nmina = min(A)\nmaxa = max(A)\nAA = [0]*(maxa-mina+1)\n\nfor i in range(N):\n maxj = maxa//A[i]\n for j in range(1,maxj+1):\n AA[j*A[i]-mina]+=1\n\nans = 0\n\nfor i in range(N):\n if AA[A[i]-mina] == 1:\n ans += 1\n \nprint(ans)']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s506954491', 's977802553', 's988040343', 's498248181']
[9044.0, 8904.0, 9012.0, 32228.0]
[25.0, 254.0, 252.0, 682.0]
[30, 34, 33, 296]
p02642
u524534026
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n=int(input())\na=list(map(int,input().split()))\nmaxa=max(a)\ncnt=[0]*((10**6)+1)\n\nfor elem in a:\n cnt[elem]+=1\n\nunique=[]\n\nfor i in range((10**6)+1):\n if cnt[i]==1:\n unique.append(i)\n\ncnt=[0]*((10**6)+1)\n\nfor elem in unique:\n for i in range(elem*2,maxa,elem):\n cnt[i]=1\n\nans=0\n\nfor elem in unique:\n if cnt[elem]==0:\n ans+=1\n\nprint(ans)\n', 'n=int(input())\na=list(map(int,input().split()))\n\ncnt=[0]*((10**6)+1)\n\nfor elem in a:\n cnt[elem]+=1\n\nunique=[]\n\nfor i in range((10**6)+1):\n if cnt[i]==1:\n unique.append(i)\n\ncnt=[0]*((10**6)+1)\n\nfor elem in unique:\n for i in range(elem*2,max(a),elem):\n cnt[i]=1\n\nans=0\n\nfor elem in unique:\n if cnt[elem]==0:\n ans+=1\n\nprint(ans)\n', 'import sys\nn=int(input())\nA=list(map(int,input().split()))\nans=0\nfor i in A:\n for j in A:\n if i>j and i != j:\n if i%j==0:\n ans+=1\n break\nprint(ans)\n \n', 'n=int(input())\na=list(map(int,input().split()))\n\ncnt=[0]*((10**6)+1)\n\nfor elem in a:\n cnt[elem]+=1\n\nunique=[]\n\nfor i in range((10**6)+1):\n if cnt[i]==1:\n unique.append(i)\n\ncnt=[0]*((10**6)+1)\n\na=list(set(a))\n\nfor elem in a:\n for i in range(elem*2,(10**6)+1,elem):\n cnt[i]+=1\n\nans=0\nfor elem in unique:\n if cnt[elem]==0:\n ans+=1\n\nprint(ans)\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s055390877', 's074262464', 's572983758', 's238813268']
[40288.0, 40356.0, 32300.0, 47380.0]
[417.0, 2206.0, 2206.0, 1682.0]
[368, 359, 213, 373]
p02642
u527454768
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['def d170(n,a):\n sa=sorted(a)\n dp=[0 for i in range(max(a)+1)]\n if sa[0]==1:\n if sa[1]==1:\n return 0\n else:\n return 1\n else:\n for x in sa:\n if dp[x]==0:\n for j in range(x,n):\n if j%x==0:\n dp[j]+1\n return dp.count(1)\n \nn=int(input())\na=list(map(int, input().split())) \nprint(d170(n,a))\n ', 'def d170(n,a):\n sa=sorted(a)\n dp=[0 for i in range(max(a)+1)]\n if sa[0]==1:\n if sa[1]==1:\n return 0\n else:\n return 1\n else:\n for x in sa:\n if dp[x]==0:\n for j in range(x,n):\n if j%x==0:\n dp[j]+=1\n return dp.count(1)\n \nn=int(input())\na=list(map(int, input().split())) \nprint(d170(n,a))\n ', 'def d170(n,a):\n count=0\n sa=sorted(a)\n dp=[True for i in range(n)]\n return dp.count(True)\n \nn=int(input())\na= list(map(int, input().split())) \nprint(d170(n,a))\n ', 'n=int(input())\na= list(map(int, input().split())) \nt=set([x for x in set(a) if a.count(x)>1])\nprint(0)\n ', 'def d170(n,a):\n count=0\n dp=[0 for i in range(max(a)+1)]\n if sa[0]==1:\n if sa[1]==1:\n return 0\n else:\n return 1\n else:\n for x in a:\n if dp[x]!=0:\n dp[x]=2\n else:\n for j in range(x,max(a)+1,x):\n dp[j]+=1\n for x in sa:\n if dp[x]==1:\n count+=1\n return count\n \nn=int(input())\na=list(map(int, input().split())) \nprint(d170(n,a))\n ', 'def d170(n,a):\n count=0\n sa=sorted(list(set(a)))\n if sa[0]==1:\n if 1 in t:\n return 0\n else:\n return 1\n else:\n for i in range(sa) :\n if i>=len(sa):\n break\n else:\n p=sa[i]\n k=[]\n for j in range(i+1,len(sa)):\n if sa[j]%p==0:\n k.append(sa[j])\n sa=sorted(list(set(sa)-set(k)))\n return len(set(sa))\n \nn=int(input())\na= list(map(int, input().split())) \nprint(d170(n,a))\n ', 'def d170(n,a):\n count=0\n sa=sorted(list(set(a)))\n print(sa)\n t=set([x for x in set(a) if a.count(x)>1])\n if sa[0]==1:\n if 1 in t:\n return 0\n else:\n return 1\n else:\n for i in range(len(sa)) :\n if i>=len(sa):\n break\n else:\n p=sa[i]\n k=[]\n for j in range(i+1,len(sa)):\n if sa[j]%p==0:\n k.append(sa[j])\n sa=sorted(list(set(sa)-set(k)))\n print(sa)\n return len(set(sa)-t)\n \nn=int(input())\na= list(map(int, input().split())) \nprint(d170(n,a))\n ', 'def d170(n,a):\n count=0\n sa=sorted(a)\n dp=[True for i in range(n)]\n return dp.count(True)\n \nn=int(input())\na= list(map(int, input().split())) \nprint(d170(n,a))\n ', 'def d170(n,a):\n k=max(a)+1\n count=0\n dp=[0 for i in range(k)]\n for x in a:\n if dp[x]!=0:\n dp[x]=2\n \n else:\n for j in range(x,k,x):\n dp[j]+=1\n for x in a:\n if dp[x]==1:\n count+=1\n return count\n \nn=int(input())\na=list(map(int, input().split())) \nprint(d170(n,a))\n ']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s187346957', 's194631065', 's395042460', 's508963650', 's559661426', 's694052264', 's797979052', 's914742042', 's928792752']
[32096.0, 32164.0, 32188.0, 32304.0, 32384.0, 32176.0, 36756.0, 8908.0, 32304.0]
[2206.0, 2206.0, 105.0, 2206.0, 103.0, 99.0, 2207.0, 24.0, 341.0]
[436, 437, 190, 110, 512, 583, 669, 194, 390]
p02642
u529737989
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input())\nA = list(map(int,input().split()))\n\nC = 0\n\nfor i in range(n):\n for j in range(n):\n if A[i] % A[j] == 0 and i != j:\n C = C+1\n break\n\nprint(C)', 'n = int(input())\n*A, = map(int, input().split())\n# n = 10\n# A = [33, 18, 33, 28, 8, 19, 89, 86, 2, 4]\n\nC = {a:0 for a in A}\n\nfor a in A:\n C[a] = C[a]+1\n\nmaxA = max(A)\n\nD = {a:0 for a in A}\n\nfor a in A:\n t = 2\n while a*t <= maxA:\n D[a*t] += D[a*t]+1\n t = t+1\n\ncounter = 0\nfor a in A:\n if C[a] == 1 and D[a] == 0:\n counter = counter+1\n \nprint(counter)', 'n = int(input())\n*A, = map(int, input().split())\n\nC = {a:0 for a in A}\n\nfor a in A:\n C[a] = C[a]+1\n\nmaxA = max(A)\n\nD = {a:0 for a in A}\n\nfor a in A:\n t = 2\n while a*t <= maxA:\n D[a*t] = D[a*t]+1\n t = t+1\n\ncounter = 0\nfor a in A:\n if C[a] == 1 and D[a] == 0:\n counter = counter+1\n \nprint(counter)', 'n = int(input())\nA = list(map(int,input().split()))\n# n = 10\n# A = [33, 18, 45, 28, 8, 19, 89, 86, 2, 4]\n\nC = 0\n\nfor i in range(n):\n for j in range(n):\n print(A[i] % A[j])\n if A[i] % A[j] == 0 and i != j:\n C = C+1\n break\n\n', 'n = int(input())\n*A, = map(int, input().split())\n\nC = {a:0 for a in A}\n\nfor a in A:\n C[a] = C[a]+1\n\nmaxA = max(A)\n\nD = {a:0 for a in A}\n\nfor a in A:\n t = 2\n while a*t <= maxA:\n D[a*t] += 1\n t = t+1\n\ncounter = 0\nfor a in A:\n if C[a] == 1 and D[a] == 0:\n counter = counter+1\n \nprint(counter)', 'n = int(input())\n*A, = map(int, input().split())\n\nC = {a:0 for a in A}\n\nfor a in A:\n C[a] += 1\n\nmaxA = max(A)\n\nD = {a:0 for a in A}\n\nfor a in A:\n t = 2\n while a*t <= maxA:\n D[a*t] = 1\n t = t+1\n\ncounter = 0\nfor a in A:\n if C[a] == 1 and D[a] == 0:\n counter += 1\n \nprint(counter)']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s398473501', 's578289855', 's594161430', 's684231104', 's823945821', 's395112239']
[32184.0, 50332.0, 49408.0, 42236.0, 49480.0, 104200.0]
[2206.0, 1414.0, 1159.0, 2246.0, 918.0, 1084.0]
[189, 389, 335, 261, 329, 317]
p02642
u531487260
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['import copy\nN = int(input())\nA = list(map(int,input().split()))\nA.sort()\nB = copy.copy(A)\ncnt = 0\nfor i in range(N):\n if A.count(A[i])> 1:\n continue\n for j in range(len(B)):\n if 2 * B[j] > A[i]:\n cnt += 1\n break\n if A[i] % B[j] == 0:\n B.remove(A[i])\n break\n if j\nprint(cnt)', 'import copy\nN = int(input())\nA = list(map(int,input().split()))\nA.sort()\nB = copy.copy(A)\ncnt = 0\nfor i in range(N):\n if A.count(A[i])> 1:\n continue\n for j in range(len(B)):\n if 2 * B[j] > A[i]:\n cnt += 1\n break\n if A[i] % B[j] == 0:\n break\n if j\nprint(cnt)', 'N = int(input())\nA = list(map(int,input().split()))\nA.sort()\ncnt = 0\nfor i in range(N):\n if A.count(A[i])> 1:\n continue\n for j in range(N):\n if 2 * A[j] > A[i]:\n break\n if A[i] % A[j] == 0:\n cnt += 1\n break\nprint(cnt)', "def main():\n N = int(input())\n A = list(map(int, input().split()))\n A.sort()\n MAX = A[-1]\n dp = [1] * (MAX + 5)\n ANS = 0\n for i in range(N):\n if dp[A[i]] == 0:\n continue\n for j in range(MAX+1):\n if A[i]*j > MAX:\n break\n dp[A[i]*j] = 0\n dp[A[i]] = 0\n if i < N-1 and A[i] == A[i+1]:\n continue\n ANS += 1\n print(ANS)\n\nif __name__ == '__main__':\n main()"]
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s302539151', 's419766579', 's557493680', 's562749607']
[9052.0, 9076.0, 32240.0, 32372.0]
[22.0, 23.0, 2206.0, 483.0]
[351, 324, 277, 469]
p02642
u533084327
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
["from sys import stdin\n\nimport numpy as np\n\nU = 10 ** 6 + 10\n\n\ndef main():\n _, primes = prime_table(U)\n readline = stdin.readline\n N = int(readline())\n a = list(map(int, readline().split()))\n mat = np.zeros(U + 1, np.int64)\n ret = 0\n for x in a:\n mat[x] += 1\n for p in primes:\n for i in range(U // p + 1):\n mat[p * i] += mat[i]\n for x in a:\n ret += mat[x] == 1\n print(ret)\n '''\n N = int(readline())\n a = list(map(int, readline().split()))\n a = np.sort(a)\n count = 0\n idxes = np.arange(len(a))\n while len(idxes):\n idx = idxes[0]\n idxes = np.delete(idxes, 0)\n var = a[idx]\n if len(np.where(a[idxes] == var)[0]) == 0:\n count += 1\n idxes = idxes[np.where(a[idxes] % var != 0)[0]]\n print(count)\n '''\n\n\ndef prime_table(N):\n is_prime = np.zeros(N, np.int64)\n is_prime[2] = 1\n is_prime[3::2] = 1\n for p in range(3, N, 2):\n if p * p >= N:\n break\n if is_prime[p]:\n is_prime[p * p::p + p] = 0\n return is_prime, np.where(is_prime)[0]\n\n\nmain()\n", 'from sys import stdin\n\nimport numpy as np\n\nU = 10 ** 6 + 10\n\n\ndef main():\n readline = stdin.readline\n N = int(readline())\n a = list(map(int, readline().split()))\n ret = 0\n exist_counts = [0] * U\n for x in a:\n if exist_counts[x]:\n exist_counts[x] = 2\n continue\n idx = x\n while idx < U:\n exist_counts[idx] += 1\n idx += x\n for x in a:\n ret += exist_counts[x] == 1\n print(ret)\nmain()']
['Time Limit Exceeded', 'Accepted']
['s600534474', 's453604515']
[59556.0, 51384.0]
[2207.0, 623.0]
[1116, 475]
p02642
u537142137
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\nA = list(map(int, input().split()))\n\nif N == 1:\n print(1)\n exit(0)\n#\nA = list(set(A))\nN = len(A)\nif N == 1:\n print(0)\n exit(0)\n#\nA.sort()\nans = 0\n\nfor i in range(1,N):\n for j in range(i):\n if A[i] % A[j] == 0:\n break\n else:\n ans += 1\n#\n\nprint(ans)\n', 'N = int(input())\nA = list(map(int, input().split()))\n\ncnt = [0] * 1000001\n\nfor i in A:\n if cnt[i] == 1:\n continue \n if cnt[i] == 2:\n cnt[i] = 1\n continue\n cnt[i] = 2\n for j in range( (i+i),1000001,i):\n cnt[j] = 1\n#\nans = 0\nfor i in range(1000001):\n if cnt[i] == 2:\n ans += 1\n#\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s402823843', 's493006416']
[32212.0, 32040.0]
[2206.0, 484.0]
[282, 308]
p02642
u539692012
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['d=[0]*8**7\nfor i in[*open(0)][1].split():d[int(i)]+=1\ni=r=0\nwhile i<1e6:\n i+=1;r+=d[i]==1;j=i\n while j<1e6:j+=i;d[j]&=d[i]<1\nprint(r)', 'd=[i:=0]*8**7\nfor j in[*open(0)][1].split():d[int(j)]+=1\nwhile i<1e6:\n i+=1;j=i\n while j<1e6:j+=i;d[j]*=d[i]<1\nprint(d.count(1))', 'd = [0] * (10**6 + 1)\nn = int(input())\nfor a in map(int, input().split()):\n d[a] += 1\nans = 0\nfor i in range(1, 10**6 + 1):\n if d[i] == 1:\n ans += 1\n if d[i] > 0:\n for j in range(i, 10**6 + 1, i):\n d[j] = 0\nprint(ans)\n']
['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s140480090', 's323320128', 's014562188']
[40824.0, 40948.0, 32396.0]
[2206.0, 2206.0, 519.0]
[133, 128, 252]
p02642
u539969758
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['from collections import deque\n\nN = int(input())\nA = list(map(int,input().split()))\n\nA.sort()\nd = deque()\nfor i in range(N-1):\n if A[i] != A[i+1]:\n d.append(A[i])\nif A[N-1] != A[N-2]:\n d.append(A[N-1])\n\nans = 0\nmax_A = max(A)\nban = [0]*max_A\nwhile len(d):\n num = d.popleft()\n if ban[num] != 1:\n ans += 1\n ban_num = num\n while ban_num <= max_A:\n ban[ban_num] = 1\n ban_num += num\n\nprint(ans)', 'from collections import deque\n\nN = int(input())\nA = list(map(int,input().split()))\n\nA.sort()\n\nans = 0\nmax_A = max(A)\nban = [0]*(max_A+1)\nagain = list()\n\nlast = 0\nfor i in range(N-1):\n if A[i] == A[i+1] and A[i] != last:\n again.append(A[i])\n last = A[i]\nif N > 1 and A[N-1] == A[N-2] and A[N-1] != last:\n again.append(A[N-1])\n\nfor num in again:\n ban_num = num\n while ban_num <= max_A:\n ban[ban_num] = 1\n ban_num += num\n \nfor num in A:\n if ban[num] != 1:\n ans += 1\n ban_num = num\n while ban_num <= max_A:\n ban[ban_num] = 1\n ban_num += num\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s525663585', 's420341766']
[33944.0, 33948.0]
[496.0, 527.0]
[450, 634]
p02642
u551058317
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input().strip())\nA = [int(v) for v in input().strip().split(" ")]\n\nexist_in_input = [0 for _ in range(10**6 + 1)]\nif_can_divide = [0 for _ in range(10**6 + 1)]\n\ncounter = 0\nfor i in range(1, 10**6+1):\n if exist_in_input[i] == 0:\n continue\n\n if if_can_divide[i] == 1:\n continue\n else:\n counter += 1\n\n for j in range((10**6+1) // (i + 1)):\n if_can_divide[j*i] = 1\n\nprint(counter)', 'N = int(input().strip())\nA = [int(v) for v in input().strip().split(" ")]\n\nexist_in_input = [0 for _ in range(10**6 + 1)]\nif_can_divide = [0 for _ in range(10**6 + 1)]\n\nfor a in A:\n exist_in_input[a] += 1\n\ncounter = 0\nfor i in range(1, 10**6+1):\n if if_can_divide[i] == 1 or exist_in_input[i] == 0:\n continue\n\n if exist_in_input[i] == 1:\n counter += 1\n\n for j in range(0, 10**6+1, i):\n if_can_divide[j] = 1\n\nprint(counter)']
['Wrong Answer', 'Accepted']
['s351797402', 's753758363']
[36576.0, 36888.0]
[219.0, 550.0]
[425, 455]
p02642
u552176911
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input())\naL = list(map(int, input().split(" ")))\naL2 = sorted(list(set(aL)))\n\ndp = [False for _ in range(1000001)]\n\nans = 0\nfor a in aL:\n if not dp[a]:\n ans += 1\n else:\n continue\n c = 1\n while a * c <= 1000000:\n dp[a * c] = True\n c += 1\n\nprint(ans - (len(aL) - len(aL2)))\n', 'n = int(input())\naL = sorted(list(map(int, input().split(" "))))\n\n\ndp = [False for _ in range(1000001)]\n\nd = {}\nfor a in aL:\n if a in d:\n d[a] += 1\n else:\n d[a] = 1\n\nans = 0\nfor a in aL:\n if dp[a]:\n continue\n if d[a] > 1:\n c = 1\n while a * c <= 1000000:\n dp[a * c] = True\n c += 1\n continue\n ans += 1\n\n c = 1\n while a * c <= 1000000:\n dp[a * c] = True\n c += 1\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s837838858', 's451111089']
[32068.0, 44620.0]
[855.0, 625.0]
[320, 499]
p02642
u563453679
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input())\nnun_list = list(map(int, input().split()))\ncount=0\nhoge = len(nun_list) - 1\nfor i in range(1,n+1):\n if is_prime(nun_list[i-1]):\n count+=1\n continue\n tmp = 0\n for j in range(1,n+1):\n if i != j:\n if nun_list[i-1] % nun_list[j-1] == 0:\n break\n else :\n tmp+=1\n if tmp == hoge:\n count+=1\nprint(count)\n\ndef is_prime(n):\n for i in range(2, n + 1):\n if i * i > n:\n break\n if n % i == 0:\n return False\n return n != 1', 'from collections import Counter\nN = int(input())\nA = list(map(int, input().split()))\ncnt = Counter(A)\nA.sort()\nans = 0\nP = [0] * (10 ** 6 + 1)\nprint(cnt)\nfor a in A:\n if P[a] == 0:\n for i in range(10 ** 7):\n x = a * i\n if x > 10 ** 6:\n break\n P[x] = 1\n if cnt[a] == 1:\n ans += 1\nprint(ans)', 'from collections import Counter\nN = int(input())\nA = list(map(int, input().split()))\ncnt = Counter(A)\nA.sort()\nans = 0\nP = [0] * (10 ** 6 + 1)\nfor a in A:\n if P[a] == 0:\n for i in range(10 ** 7):\n x = a * i\n if x > 10 ** 6:\n break\n P[x] = 1\n if cnt[a] == 1:\n ans += 1\nprint(ans)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s758596490', 's886000552', 's767721724']
[32244.0, 65120.0, 38824.0]
[64.0, 594.0, 671.0]
[559, 365, 354]
p02642
u571281863
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N=input()\nA=sorted(map(int,input().split()))\nM=A[-1]+1\nB=[0]*M\nfor i in A:\n for j in range(i,M,i):\n B[j]+=1\nprint(B.count(1))', 'def main()\n N=input()\n A=sorted(map(int,input().split()))\n M=A[-1]+1\n B=[0]*M\n for i in A:\n B[i]+=1\n if B[i]==1:\n for j in range(i*2,M,i):\n B[j]=2\n print(B.count(1))\nmain()', 'def m()\n N=input()\n A=sorted(map(int,input().split()))\n M=A[-1]+1\n B=[0]*M\n for i in A:\n B[i]+=1\n if B[i]==1:\n for j in range(i*2,M,i):\n B[j]=2\n print(B.count(1))\nm()', 'def main():\n N=input()\n A=sorted(map(int,input().split()))\n M=A[-1]+1\n B=[0]*M\n for i in A:\n B[i]+=1\n if B[i]==1:\n for j in range(i*2,M,i):\n B[j]=2\n print(B.count(1))\nmain()']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s215215426', 's691012838', 's902627846', 's136881602']
[32036.0, 8864.0, 8896.0, 32332.0]
[481.0, 28.0, 28.0, 223.0]
[129, 196, 190, 197]
p02642
u576432509
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['from numba import jit\n\na=[]\n\n@jit\ndef dp(a):\n aaset=set()\n while True:\n aaset.add(a[0])\n a2=[]\n for i,ai in enumerate(a,1):\n if ai%a[0]!=0:\n a2.append(ai)\n a=a2.copy()\n if len(a2)==0:\n break\n return aaset\n\nn=int(input())\na=list(map(int,input().split()))\n\na.sort()\n\nimport collections\nc = collections.Counter(a)\n\nd=[]\nfor ck,cv in c.items():\n if cv>=2:\n d.append(ck) \ndset=set(d)\n \naaset=dp(a)\naaset=aaset-dset \nprint(len(aaset))\n', 'from numba import jit\n\nn=int(input())\na=list(map(int,input().split()))\n\na.sort()\n\nimport collections\nc = collections.Counter(a)\n\nd=[]\nfor ck,cv in c.items():\n if cv>=2:\n d.append(ck) \ndset=set(d)\n \naaset=set()\n\n@jit\ndef dp():\n while True:\n aaset.add(a[0])\n a2=[]\n for i,ai in enumerate(a,1):\n if ai%a[0]!=0:\n a2.append(ai)\n a=a2.copy()\n if len(a2)==0:\n break\n return True\n\nyn=dp()\naaset=aaset-dset \nprint(len(aaset))\n', 'n=int(input())\na=list(map(int,input().split()))\n\na.sort()\namax=max(a)\ndp=[True]*(amax+1)\n\nimport collections\nc = collections.Counter(a)\n\nd=[]\nfor ck,cv in c.items():\n if cv>=2:\n d.append(ck) \ndset=set(d)\n \naa=set()\nfor ai in a:\n if dp[ai]:\n aa.add(ai)\n for aj in range(ai*2,amax+1,ai):\n dp[aj]=False\n\naa=aa-dset \nprint(len(aa))\n']
['Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s501938072', 's841798872', 's142516866']
[139688.0, 124396.0, 59776.0]
[2209.0, 639.0, 451.0]
[523, 508, 371]
p02642
u583285098
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\nA = list(map(int, input().split()))\nA.sort()\n\nB = [0]*(max(A)+1)\n\nfor i in A:\n B[i]+=1\n if B[i] == 1:\n for j in range(i*2, max(A), i):\n B[j]+=100\nprint(B.count(1))', 'import numpy as np\n\nN = int(input())\nA = list(map(int, input().split()))\n# A.sort()\n\nsosu = []\ncount = 0\n\ndef loop(target, A):\n global count\n B = []\n flg = True\n for i in range(len(A)):\n if A[i] % target != 0:\n B.append(A[i])\n if target == A[i]:\n flg = False\n if flg:\n count+=1\n if len(B) == 1:\n count+=1\n return\n if len(B) == 0:\n return\n target = B.pop(0)\n loop(target, B)\n\ntarget = A.pop(0)\nloop(target, A)\nprint(count)', 'N = int(input())\nA = list(map(int, input().split()))\nA.sort()\n\nm_a = max(A)+1\nB = [0]*(m_a)\n\nfor i in A:\n B[i]+=1\n if B[i] == 1:\n for j in range(i*2, m_a, i):\n B[j]+=100\nprint(B.count(1))']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s215022230', 's603586882', 's398533977']
[37280.0, 147580.0, 40556.0]
[2207.0, 2211.0, 611.0]
[190, 458, 197]
p02642
u584520370
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input())\na = list(map(int, input().split()))\n\na = sorted(set(a))\nw = 0\nh = 0\nwhile True:\n h = 1\n while True:\n if w + h == len(a):\n print(a)\n break\n if a[w+h] % a[w] == 0:\n print(h)\n del a[w+h]\n else:\n print(a[w+h], h, w, a)\n h += 1\n w += 1\n if w == len(a):\n print(len(a))\n exit()', 'from collections import Counter\nn = int(input())\na = list(map(int, input().split()))\nc = Counter(a)\nprime = [True] * (10 ** 6 + 10)\n\nb = sorted(set(a))\n\nfor i in b:\n num = i * 2\n while True:\n if num >= 10 ** 6 + 1:\n break\n prime[num] = False\n num += i\n\nans = 0\nfor s in a:\n if prime[s] == True and c[s] == 1:\n ans += 1\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s960980371', 's274437598']
[140368.0, 52564.0]
[2480.0, 1896.0]
[400, 378]
p02642
u586639900
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\nA = set(map(int, input().split()))\n\ndef make_divisors(n):\n lower_divisors , upper_divisors = [], []\n i = 1\n while i*i <= n:\n if n % i == 0:\n lower_divisors.append(i)\n if i != n // i:\n upper_divisors.append(n//i)\n i += 1\n return lower_divisors + upper_divisors[::-1]\n\ncount = 0\nfor i in A:\n others = A - {i}\n divs = set(make_divisors(i))\n if len(others & divs) > 0:\n count += 1\n \nprint(count)', '#!/usr/bin/env python3\n\nimport sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nsys.setrecursionlimit(10 ** 7)\n\nN = int(input())\nA = list(map(int, input().split()))\n\nAmax = max(A)\ndp = [True] * Amax\nseen = set()\n\nfor a in A:\n if a in seen:\n dp[a-1] = False\n continue\n i = 2\n while i * a <= Amax:\n dp[i*a-1] = False\n i += 1\n seen.add(a)\n\n\nB = [dp[a-1] for a in A]\nprint(sum(B))\n\n\n']
['Wrong Answer', 'Accepted']
['s682971588', 's620629232']
[47892.0, 38248.0]
[2207.0, 761.0]
[480, 479]
p02642
u589913372
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['import heapq as hp\nn = int(input())\na = list(map(int, input().split()))\nhp.heapify(a)\nans = 0\nwhile len(a) > 0:\n b = a[0]\n if b in a:\n ans += -1\n a = [i for i in a if i % b != 0]\n ans += 1\nprint(ans)\n', 'import heapq as hp\nn = int(input())\na = list(map(int, input().split()))\nhp.heapify(a)\nans = 0\nwhile len(a) > 0:\n b = hp[0]\n if b in a:\n ans += -1\n a = [i for i in a if i % b != 0]\n ans += 1\nprint(ans)\n', 'import heapq as hp\nn = int(input())\na = list(map(int, input().split()))\nhp.heapify(a)\nb = a[-1]\nche,re = [0 for i in range(b)],[]\nfor i in a:\n che[i-1] = 1\nfor i in a:\n if i in re:\n che[i-1] = 0\n else:\n re.append(i)\n c = b // i\n for j in range(2,c+1):\n che[i*j-1] = 0\nprint(che.count(1))\n', 'n = int(input())\na = list(map(int, input().split()))\nb = max(a)\nche = [1 for i in range(b)]\nfor i in a:\n if che[i-1] == 1:\n c = b // i\n for j in range(2,c+1):\n che[i*j-1] = 0\n che[i-1] = 2\n elif che[i-1] == 2:\n che[i-1] = 0\nans = 0\nfor i in a:\n if che[i-1] == 2:\n ans += 1\nprint(ans)\n']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s071788743', 's259803849', 's832677285', 's243600629']
[32088.0, 32080.0, 32196.0, 32248.0]
[2206.0, 77.0, 150.0, 464.0]
[220, 221, 336, 339]
p02642
u591143370
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
["N = int(input())\nL = list(map(int, input().split()))\n#N=10\n#L=[33,18,45,28,8,19,89,86,2,4]\n#N=5\n#L=[3,8,11,16,24]\n\nList=list(set(L))\n#print(List)\nList.sort()\n#print(List)\n#N=2\n#List=[3,3,11,16,24]\n#List=[5,5,5,5]\n#List=[2,5]\na=0\n#ns=List[N-1]/2\n#print(ns)\nfor i in range(len(List)):\n #if i>ns:\n # break\n \n for u in range(i):\n # print(i,u,List[i],List[u])\n if List[i]%List[u]==0:\n a+=1\n print('#',i,u)\n break\n#print(a)\nif len(List)==1:\n print(0)\nelse:\n print(N-a)", 'N = int(input())\nL = list(map(int, input().split()))\n\na=[0]*((10**6)+1)\nfor i in L:\n a[i]+=1\n\nuni=[]\nfor i in range((10**6)+1):\n if a[i]==1:\n uni.append(i)\na=[0]*((10**6)+1)\nL=list(set(L))\nfor i in L:\n for m in range(i*2,(10**6)+1,i):\n a[m]=1\nans=0\nfor i in uni:\n if a[i]==0:\n ans+=1 \nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s644035633', 's847314048']
[32168.0, 47360.0]
[2206.0, 1500.0]
[529, 329]
p02642
u591182368
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['import sys\n\ninput = sys.stdin.readline\n\ndef main():\n n = int(input().rstrip())\n a = sorted(list(map(int, input().rstrip().split())))\n count = 0\n b = []\n for i in range(n):\n flag = True\n for x in b:\n if a[i] % x == 0:\n flag = False\n break\n if flag:\n for k in range(n):\n if i != k and a[i] % k ==0;\n flag = False\n break\n if flag:\n count += 1\n b.append(a[i])\n print(count)\n \nif __name__ == "__main__":\n main()', 'from collections import Counter\nimport sys\nn=int(input())\na=sorted(list(map(int,input().split())))\n \nc=[1 for i in range(10**6+1)]\nd = Counter(a)\ns = list(set(a))\ncount = 0\nif d[1] == 1:\n print(1)\n sys.exit()\nelif d[1] >=2:\n print(0)\n sys.exit()\nfor x in s:\n t = x * 2\n while t <= 10 ** 6:\n c[t] = 0\n t += x\n \nfor x in a:\n if d[x] == 1 and c[x] == 1:\n count += 1\nprint(count)']
['Runtime Error', 'Accepted']
['s438527220', 's593457532']
[9012.0, 52924.0]
[25.0, 617.0]
[525, 391]
p02642
u594803920
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['from numba import jit\nn = int(input())\nli = list(map(int, input().split()))\nli.sort()\ninf = (10**6)+1\nisprime = [False]*(inf+1)\nfor i in li:\n isprime[i] = True\ntemp = 0\n@jit\nfor i in li:\n if i == temp:\n isprime[i] = False\n if not isprime[i]:\n continue\n for k in range(i*2, inf+1, i):\n isprime[k] = False\n temp = i\nprime_list = []\n@jit\nfor i in range(len(li)):\n if i+1<len(li):\n if li[i] == li[i+1]:\n isprime[li[i]] = False\nfor i in range(1, inf+1):\n if isprime[i]:\n prime_list.append(i)\nprint(len(prime_list))\n', 'n = int(input())\nli = list(map(int, input().split()))\nli.sort()\ninf = (10**6)+1\nisprime = [False]*(inf+1)\nfor i in li:\n isprime[i] = True\ntemp = 0\nfor i in li:\n if i == temp:\n isprime[i] = False\n if not isprime[i]:\n continue\n for k in range(i*2, inf+1, i):\n isprime[k] = False\n temp = i\nprime_list = []\nfor i in range(len(li)):\n if i+1<len(li):\n if li[i] == li[i+1]:\n isprime[li[i]] = False\nfor i in range(1, inf+1):\n if isprime[i]:\n prime_list.append(i)\nprint(len(prime_list))\n']
['Runtime Error', 'Accepted']
['s597670121', 's276812264']
[9044.0, 32404.0]
[22.0, 442.0]
[587, 555]
p02642
u597455618
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['from sys import stdin\nn = int(input())\na = list(map(int, stdin.readline().split()))\namax = max(a)\ne = [0]*(amax+1)\nans = 0\n\nfor i in range(n):\n e[a[i]] += 1\n if e[a[i]] == 1:\n for j in range(2*a[i], amax, a[i]):\n e[i] += 2\n\nprint(e.count(i))', 'def main():\n from sys import stdin\n n = int(input())\n a = list(map(int, stdin.readline().split()))\n a.sort()\n amax = max(a)+1\n e = [True]*amax\n Alice = set()\n Bob = set()\n ans = 0\n \n for i in range(n):\n if e[a[i]] == True:\n Alice.add(a[i])\n for j in range(a[i], amax, a[i]):\n e[j] = False\n else:\n if a[i] in Alice:\n Bob.add(a[i])\n \n print(len(Alice - Bob))\nif __name__ == "__main__":\n main()']
['Runtime Error', 'Accepted']
['s514000470', 's584853059']
[31548.0, 42956.0]
[374.0, 250.0]
[265, 510]
p02642
u597553490
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['import sys\n\n\ndef Sieve(N, AList):\n AList.sort()\n N_NotDivisible = 0\n while( len(AList) > 0 ):\n if(len(AList) > 1):\n if(AList[0]!= AList[1]):\n N_NotDivisible+= 1\n value = AList[0]\n pops = [0]\n for i in range(1, N):\n if(AList[i]%value==0):\n pops.append(i)\n AList.pop(pops)\n else:\n index = 2\n while(index < len(AList) and AList[index-1] == AList[index]):\n index += 1\n for i in range(index):\n AList.pop(0)\n\n else:\n N_NotDivisible+= 1\n break\n #print(Mins)\n return N_NotDivisible\n\nif(__name__ == "__main__"):\n\n N = int( input().strip() )\n AList_str = input().strip().split()\n\n AList = [0] * N\n for i in range(N):\n AList[i] = int(AList_str[i])\n N_NotDivisible= Sieve(N, AList)\n print(N_NotDivisible)\n', 'import sys\n\n\ndef Sieve(N, AList):\n AList.sort()\n N_NotDivisible = 0\n while( len(AList) > 0 ):\n if(len(AList) > 1):\n if(AList[0]!= AList[1]):\n N_NotDivisible+= 1\n value = AList[0]\n pops = [0]\n for i in range(1, len(AList)):\n if(AList[i]%value==0):\n pops.append(i)\n AList.pop(pops)\n else:\n index = 2\n while(index < len(AList) and AList[index-1] == AList[index]):\n index += 1\n for i in range(index):\n AList.pop(0)\n\n else:\n N_NotDivisible+= 1\n break\n #print(Mins)\n return N_NotDivisible\n\nif(__name__ == "__main__"):\n\n N = int( input().strip() )\n AList_str = input().strip().split()\n\n AList = [0] * N\n for i in range(N):\n AList[i] = int(AList_str[i])\n N_NotDivisible= Sieve(N, AList)\n print(N_NotDivisible)\n', 'import sys\n\ndef Sieve2(N, AList, Bools, Max_A):\n N_NotDivisible = 0\n value = 0\n for i in range(N):\n if(AList[i]>value):\n value = AList[i]\n if(Bools[value]==True):\n N_NotDivisible += 1\n\n for j in range(2, Max_A//value+1, 1 ):\n Bools[j*value] = False\n #print(Mins)\n return N_NotDivisible\n\n\nif(__name__ == "__main__"):\n\n N = int( input().strip() )\n AList_str = input().strip().split()\n Max = 0\n AList = [0] * N\n for i in range(N):\n AList[i] = int(AList_str[i])\n Max = max(AList[i], Max)\n Bools = [False] * (Max+1)\n AList.sort()\n Dups = []\n for Num in range(N):\n value = AList[Num]\n Bools[value] = True\n if(Num < N-1 and AList[Num] == AList[Num+1]):\n Dups.append(value)\n for Num in range(len(Dups)):\n value = Dups[Num]\n Bools[value] = False\n\n\n N_NotDivisible= Sieve2(N, AList, Bools, Max)\n print(N_NotDivisible)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s129849101', 's611200474', 's695116915']
[39608.0, 38896.0, 41040.0]
[2206.0, 2206.0, 576.0]
[991, 1000, 989]
p02642
u606878291
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
["import numpy as np\nimport sys\n\nN = int(sys.stdin.readline())\nA = np.array(sorted(map(int, sys.stdin.readline().split(' '))))\n\ndp = np.ones(N, dtype=np.bool)\n\nfor i in range(N - 1):\n if not dp[i]:\n continue\n dp[i + 1:] &= (A[i + 1:] % A[i] != 0)\n dp[i] &= (A[i] != A[i + 1])\n\nprint(np.count_nonzero(dp))\n", "import numpy as np\nimport sys\n\nN = int(sys.stdin.readline())\nA = np.array(sorted(map(int, sys.stdin.readline().split(' '))))\n\ndp = np.ones(N, dtype=np.bool)\n\nfor i in range(N - 1):\n if not dp[i]:\n continue\n if not np.any(dp[i:]):\n break\n dp[i + 1:] &= (A[i + 1:] % A[i] != 0)\n dp[i] &= (A[i] != A[i + 1])\n\nprint(np.count_nonzero(dp))\n", "from collections import Counter\nimport numpy as np\n\nA_MAX = 10 ** 6 + 1\n\nN = int(input())\nA = Counter(list(map(int, input().split(' '))))\n\ndp = np.zeros(shape=A_MAX, dtype=np.int64)\n\nif A[1] == 1:\n print(1)\nelif A[1] > 1:\n print(0)\nelse:\n for a in A.keys():\n multiples = np.arange(a, A_MAX, a)\n np.add.at(dp, multiples, 1)\n\n ans = 0\n for a, count in A.items():\n if count > 1:\n continue\n if dp[a] == 1:\n ans += 1\n\n print(ans)\n"]
['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s309999623', 's481267014', 's155204339']
[51164.0, 51308.0, 53692.0]
[2206.0, 2207.0, 851.0]
[319, 360, 493]
p02642
u608007704
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N=int(input())\nA=list(map(int,input().split()))\nA.sort()\n\ndp=[False]*(10**6)\nans=0\nfor i in A:\n if dp[i]:continue\n tmp=i\n ans+=1\n while tmp>10**6:\n dp[tmp]=True\n tmp+=i\nprint(ans)', 'N=int(input())\nA=list(map(int,input().split()))\n\nA.sort()\n\ndp=[False]*(10**6*2)\nans=0\nfor idx,i in enumerate(A):\n if dp[i]:continue\n tmp=i\n ans+=1\n while tmp<10**6*2-1:\n dp[tmp]=True\n tmp+=i\n if idx!=len(A)-1 and A[idx+1]==i:\n ans-=1\nprint(ans)']
['Runtime Error', 'Accepted']
['s458133618', 's707821118']
[32164.0, 35492.0]
[155.0, 975.0]
[189, 258]
p02642
u608080019
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\nA = list(map(int, input.split()))\n\nO = A.copy()\n\nfor i in A:\n for j in A:\n if i != j:\n if (i%j == 0):\n if i in O:\n O.remove(i)\n\nans = len(O)\n\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\n\nO = A.copy()\n\nfor i in A:\n for j in A:\n if i != j:\n if (i%j == 0):\n if i in O:\n O.remove(i)\n if i == j:\n if i in O:\n O.remove(i)\n\nans = len(O)\n\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\n\n\nmx = max(A)\nx = [0] * (mx + 1) # len(x)\nfor i in A:\n x[i] += 1\nfor i in range(1, mx + 1):\n if x[i] != 0:\n for j in range(2 * i, mx + 1, i):\n x[j] = 0\n if x[i] > 1:\n x[i] = 0\nprint(sum(x))']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s131258067', 's620754956', 's149960556']
[9136.0, 32240.0, 31992.0]
[24.0, 2206.0, 413.0]
[224, 296, 276]
p02642
u618251217
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\nA = list(map(int, input().split()))\nA.sort()\nINF = 10**6+1\nlis = [1]*INF\nexist = [0]*INF\nfor i in range(N):\n a = A[i]\n exist[a] += 1\n if lis[a] and exist[a] < 1:\n q = 2\n while a*q < INF:\n lis[a*q] = 0\n q += 1\ncnt = 0\nfor a in A:\n if lis[a] and exist[a] == 1:\n cnt += 1\nprint(cnt)', 'N = int(input())\nA = list(map(int, input().split()))\nA.sort()\nINF = 10**6+1\nlis = [1]*INF\nexist = [0]*INF\nfor i in range(N):\n a = A[i]\n if lis[a] and exist[a] < 1:\n q = 2\n while a*q < INF:\n lis[a*q] = 0\n q += 1\n exist[a] += 1\ncnt = 0\nfor a in A:\n if lis[a] and exist[a] == 1:\n cnt += 1\nprint(cnt)']
['Wrong Answer', 'Accepted']
['s458493375', 's712645341']
[35404.0, 35260.0]
[221.0, 672.0]
[351, 351]
p02642
u619144316
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['from collections import defaultdict\nimport numpy as np\n\ndef main():\n MOD = 10**9+7\n n = int(input())\n A = list(map(int,input().split()))\n\n A.sort()\n T = A[-1]+1\n\n dp = [True] * T\n\n d = defaultdict(int)\n\n for a in A:\n d[a] += 1\n if dp[a]:\n for j in range(2*a,T,a):\n dp[j] = False\n\n ans = 0\n \n for a in A:\n if d[a] == 1 and dp[a] == True:\n ans += 1\n\n print(ans)', 'from collections import defaultdict\n\ndef main():\n MOD = 10**9+7\n n = int(input())\n A = list(map(int,input().split()))\n\n A.sort()\n T = A[-1]+1\n\n dp = [True] * T\n\n d = defaultdict(int)\n\n for a in A:\n d[a] += 1\n if dp[a]:\n for j in range(2*a,T,a):\n dp[j] = False\n\n ans = 0\n \n for a in A:\n if d[a] == 1 and dp[a] == True:\n ans += 1\n\n print(ans)\n\nmain()']
['Wrong Answer', 'Accepted']
['s134531713', 's679280841']
[27172.0, 43328.0]
[116.0, 260.0]
[453, 442]
p02642
u621345513
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['from collections import Counter\n\ninput()\na_list = list(map(int, input().split()))\n\nc = Counter(a_list)\ndivisible = [True] * (10**6+1)\nfor el, count in c.items():\n if count!=1:\n divisible[el] = False\n continue\n else:\n for i in range(el*2, 10**6+1, el):\n divisible[i] = False\na_list = list(set(a_list))\nans = len(\n [1 for isDivisible in divisible if isDivisible]\n) \nprint(ans)', 'from collections import Counter\n\ninput()\na_list = list(map(int, input().split()))\n\nc = Counter(a_list)\ndivisible = [True] * (10**6+1)\nfor el, count in c.items():\n if count!=1:\n divisible[el] = False\n for i in range(el*2, 10**6+1, el):\n divisible[i] = False\na_list = list(set(a_list))\nans = len(\n [1 for a in a_list if divisible[a]]\n) \nprint(ans)']
['Wrong Answer', 'Accepted']
['s753393781', 's463481391']
[53084.0, 52980.0]
[1137.0, 1435.0]
[418, 371]
p02642
u626881915
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['\nn = int(input())\na = list(map(int, input().split()))\nd = {}\nfor i in range(n):\n d[a[i]] = d.get(a[i], 0) + 1\ndata = sorted(list(set(a)))\nprime_bool = [True]*(max(a)+1)\nprime_bool[0] = False\ncount = 0\nfor i in range(len(data)):\n p = data[i]\n if prime_bool[p]:\n if c[p] == 1:\n count += 1\n #print(p)\n for j in range(2*p, max(a)+1, p):\n prime_bool[j] = False\n\nprint(count)\n\n', 'import collections\n\nn = int(input())\na = list(map(int, input().split()))\na = sorted(a)\nc = collections.Counter(a)\ndata = list(set(a))\nprime_bool = [True]*(max(a)+1)\nprime_bool[0] = False\nold_idx = 0\nfor i in range(len(data)):\n p = data[i]\n if prime_bool[p]:\n for j in range(old_idx+1, i):\n prime_bool[j] = False\n old_idx = i\n k = 2\n while k*p <= max(a):\n prime_bool[k*p] = False\n k += 1\n\ncount = 0\nfor i in range(len(prime_bool)):\n if prime_bool[i]:\n if c[i] > 1:\n count += 1\nprint(prime_bool.count(True) - count)\n', 'import collections\n\nn = int(input())\na = list(map(int, input().split()))\na = sorted(a)\nc = collections.Counter(a)\ndata = sorted(list(set(a)))\nprime_bool = [True]*(max(a)+1)\nprime_bool[0] = False\n\nfor i in range(len(data)):\n p = data[i]\n if prime_bool[p]:\n #print(p)\n k = 2\n while k*p <= max(a):\n prime_bool[k*p] = False\n k += 1\n\ncount = 0\nfor i in range(len(prime_bool)):\n if prime_bool[i]:\n if c[i] == 1:\n count += 1\nprint(count)\nprint(prime_bool)\n', '\n\nn = int(input())\na = list(map(int, input().split()))\nd = {}\nfor i in range(n):\n d.get(a[i], 0) += 1\ndata = sorted(list(set(a)))\nprime_bool = [True]*(max(a)+1)\nprime_bool[0] = False\ncount = 0\nfor i in range(len(data)):\n p = data[i]\n if prime_bool[p]:\n if c[p] == 1:\n count += 1\n #print(p)\n for j in range(2*p, max(a)+1, p):\n prime_bool[j] = False\n\nprint(count)\n\n', 'import collections\n\nn = int(input())\na = list(map(int, input().split()))\nc = collections.Counter(a)\ndata = sorted(list(set(a)))\nprime_bool = [True]*(max(a)+1)\nprime_bool[0] = False\ncount = 0\nfor i in range(len(data)):\n p = data[i]\n if prime_bool[p]:\n if c[i] == 1:\n count += 1\n #print(p)\n for j in range(2*p, max(a)+1, p):\n prime_bool[j] = False\n\n\n\nprint(count)\n\n', 'import collections\n\nn = int(input())\na = list(map(int, input().split()))\na = sorted(a)\nc = collections.Counter(a)\ndata = sorted(list(set(a)))\nmax_ = max(a)+1\nprime_bool = [True]*max_\nprime_bool[0] = False\n\nfor i in range(len(data)):\n p = data[i]\n if prime_bool[p]:\n #print(p)\n k = 2\n while k*p < max_:\n prime_bool[k*p] = False\n k += 1\n\ncount = 0\nfor i in range(len(prime_bool)):\n if prime_bool[i]:\n if c[i] == 1:\n count += 1\nprint(count)\n\n']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s083653577', 's116690164', 's171595563', 's476146371', 's692923839', 's271871093']
[44520.0, 45096.0, 44604.0, 8792.0, 44956.0, 44544.0]
[179.0, 2207.0, 2206.0, 26.0, 2207.0, 787.0]
[393, 552, 479, 385, 384, 487]
p02642
u627600101
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\nA = list(map(int, input().split()))\ncount = 0\nA.sort()\nc=0\nfor k in range(len(A)-1):\n if A[k] == A[k+1]:\n del A[k]\n A.insert(0,0)\n c+=1\n if k <len(A)-2:\n if A[k+1] != A[k+2]:\n del A[k+1]\n A.insert(0,0)\n c+=1\n else:\n del A[k+1]\n A.insert(0,0)\n c+=1\ndel A[:c]\nif len(A)>0:\n saidai = A[-1]\nelse:\n saidai=0\nprint(A)\nfoo = [0 for k in range(saidai+1)]\nfor k in range(len(A)):\n if foo[A[k]] == 1:\n continue\n else:\n count+=1\n for j in range(A[k], saidai+1, A[k]):\n foo[j] = 1\nprint(count) ', 'N = int(input())\nA = list(map(int, input().split()))\ncount = 0\nA.sort()\nc=0\n\nsaidai = A[-1]\nfoo = [0 for k in range(saidai+1)]\nfor k in range(len(A)):\n if foo[A[k]] == 1:\n continue\n else:\n for j in range(A[k], saidai+1, A[k]):\n foo[j] = 1\n if k < len(A)-1:\n if A[k] == A[k+1]:\n continue\n if 0 < k < len(A):\n if A[k] == A[k-1]:\n continue\n count+=1\nprint(count) ']
['Wrong Answer', 'Accepted']
['s827875306', 's188761160']
[32140.0, 32284.0]
[2206.0, 365.0]
[670, 858]
p02642
u645487439
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input())\na_list = list(map(int, input().split()))\na_list.sort()\nans = 0\n\nif len(a_list) == 1:\n print(0)\nelse:\n if a_list[0] != a_list[1]:\n ans += 1\n for i in range(1, n):\n for j in range(i):\n if a_list[j] > a_list[i] / 2:\n break\n if a_list[i] % a_list[j] == 0:\n break;\n if j == i - 1:\n ans += 1\n\nprint(ans)\n', 'n = int(input())\na_list = list(map(int, input().split()))\na_list.sort()\nans = 0\n\nif len(a_list) == 1:\n print(0)\nelse:\n if a_list[0] != a_list[1]:\n ans += 1\n for i in range(1, n):\n for j in range(i):\n if a_list[i] % a_list[j] == 0:\n break\n if a_list[j] > a_list[i] / 2:\n ans += 1\n break\n\nprint(ans)\n', 'n = int(input())\na_list = list(map(int, input().split()))\na_list.sort()\nans_list = [0] * (a_list[n - 1] + 1)\nans = 0\n\nfor a in a_list:\n if ans_list[a] >= 1:\n ans_list[a] += 1\n continue\n for j in range(2 * a, a_list[n - 1] + 1, a):\n ans_list[j] += 1\n ans_list[a] = 1\n\nfor a in a_list:\n if ans_list[a] == 1:\n ans += 1\nprint(ans)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s065181896', 's358033592', 's666701680']
[32192.0, 32196.0, 32300.0]
[2206.0, 2206.0, 353.0]
[416, 388, 367]
p02642
u648881683
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['find / -name pip', "import sys\ninput = lambda: sys.stdin.readline().rstrip() \nsys.setrecursionlimit(10**7)\nINF = 10**20\ndef I(): return int(input())\ndef F(): return float(input())\ndef S(): return input()\ndef LI(): return [int(x) for x in input().split()]\ndef LI_(): return [int(x)-1 for x in input().split()]\ndef LF(): return [float(x) for x in input().split()]\ndef LS(): return input().split()\n\ndef resolve():\n N = I()\n A = LI()\n\n A.sort()\n divisible = set(list(range(1, 10**6+1)))\n\n for i in A:\n j = 1\n while i*j <= 10**6:\n if i*j in divisible:\n\t\t divisible.remove(i*j)\n j += 1\n\n ans = 0\n for i in A:\n if j in divisible:\n ans += 1\n \n print(ans)\n\nif __name__ == '__main__':\n resolve()", "import sys\ninput = lambda: sys.stdin.readline().rstrip() \nsys.setrecursionlimit(10**7)\nINF = 10**20\ndef I(): return int(input())\ndef F(): return float(input())\ndef S(): return input()\ndef LI(): return [int(x) for x in input().split()]\ndef LI_(): return [int(x)-1 for x in input().split()]\ndef LF(): return [float(x) for x in input().split()]\ndef LS(): return input().split()\n\ndef resolve():\n N = I()\n A = LI()\n\n A.sort()\n divisible = set(list(range(1, 10**6+1)))\n\n for i in A:\n j = 1\n while i*j <= 10**6:\n if i*j in divisible:\n\t\t divisible.remove(i*j)\n j += 1\n\n ans = 0\n for i in A:\n if j in divisible:\n ans += 1\n \n print(ans)\n\nif __name__ == '__main__':\n resolve()", "import sys, collections\ninput = lambda: sys.stdin.readline().rstrip() \nsys.setrecursionlimit(10**7)\nINF = 10**20\ndef I(): return int(input())\ndef F(): return float(input())\ndef S(): return input()\ndef LI(): return [int(x) for x in input().split()]\ndef LI_(): return [int(x)-1 for x in input().split()]\ndef LF(): return [float(x) for x in input().split()]\ndef LS(): return input().split()\n\ndef resolve():\n N = I()\n A = LI()\n\n cnt = collections.Counter(A)\n A = list(set(A))\n A.sort()\n A_max = A[-1]\n divisible = [False] * (A_max + 1)\n\n for i in A:\n for j in range(2 * i, A_max+1, i):\n divisible[j] = True\n\n ans = 0\n for i in A:\n if not divisible[i] and cnt[i] == 1:\n ans += 1\n \n print(ans)\n\nif __name__ == '__main__':\n resolve()"]
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s309509799', 's472343574', 's530347775', 's326889347']
[9088.0, 9080.0, 9084.0, 45304.0]
[22.0, 24.0, 24.0, 304.0]
[16, 764, 764, 805]
p02642
u657994700
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
["\ndef make_divisors(n):\n lower_divisors , upper_divisors = [], []\n i = 1\n while i*i <= n:\n if n % i == 0:\n lower_divisors.append(i)\n if i != n // i:\n upper_divisors.append(n//i)\n i += 1\n return lower_divisors[1:] + upper_divisors[::-1]\n\n# print('input >>')\nN = int(input())\nAs = list(map(int,(input().split())))\n\nAs.sort()\nprint(As)\n\nwarusu = set()\nans = 0\n\n# for x in range(len(As)):\n # print(As)\n\nfor A1 in As:\n for A2 in sorted(As, reverse=True):\n if A2 % A1 == 0:\n As.remove(A1)\n\n# print('-----output-----')\nprint(len(As))", "\ndef make_divisors(n):\n lower_divisors , upper_divisors = [], []\n i = 1\n while i*i <= n:\n if n % i == 0:\n lower_divisors.append(i)\n if i != n // i:\n upper_divisors.append(n//i)\n i += 1\n return lower_divisors[1:] + upper_divisors[::-1]\n\n# print('input >>')\nN = int(input())\nAs = list(map(int,(input().split())))\n\nAs.sort()\nprint(As)\n\nwarusu = set()\nans = 0\n\n# for x in range(len(As)):\n # print(As)\n\nfor A1 in As:\n for A2 in sorted(As, reverse=True):\n if A2 % A1 == 0\n As.remove(A1)\n\n# print('-----output-----')\nprint(len(As))", "# print('input >>')\nN = int(input())\nAs = list(map(int,(input().split())))\n\nAs.sort()\n# print(As)\n\nall_nums = [0] * (As[-1] + 1)\n\nfor A in As:\n all_nums[A] += 1\n\ndup = 0\n\nfor i, num in enumerate(all_nums):\n if num == 0:\n continue\n if num > 1:\n dup += num\n j = 2\n while i * j <= As[-1]:\n all_nums[i*j] = 0\n j += 1\n # print(all_nums)\n\nprint(sum(all_nums)-dup)"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s061811424', 's766417136', 's872338880']
[32380.0, 9068.0, 32168.0]
[2206.0, 25.0, 746.0]
[612, 611, 403]
p02642
u674343825
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input())\na = list(map(int,input().split()))\ncount = 0\nfor i in range(n):\n for j in range(n):\n if a != j and a[i]%a[j] == 0:\n break\n if j == n-1:\n count +=1\nprint(count)', '#D-Not Divisible\n\nn = int(input())\na = list(map(int,input().split()))\na = sorted(a)\nmaxi = a[-1]\nboo = [True]*(maxi+1)\n\nfor i in range(n):\n k = a[i]\n if not boo[k]:\n continue\n if i != n-1 and k == a[i+1]:\n boo[k] = False\n for j in range(2,maxi//k+1):\n boo[k*j] = False\n \ncount = 0\nfor k in a:\n if boo[k] == True:\n count += 1\n\nprint(count)']
['Wrong Answer', 'Accepted']
['s695415259', 's648199254']
[32300.0, 32056.0]
[2206.0, 465.0]
[215, 394]
p02642
u686036872
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['from collections import Counter\n\nN = int(input())\nA = list(map(int, input().split()))\n\ncou = Counter(A) \n\nA = list(set(A))\nA.sort()\n\nC = [0]*(10**6+1)\nfor a in A:\n if C[a] == 0 and C[a] == 0:\n ans += 1\n\n i = 1\n while True:\n if a*i > 10**6+1:\n break\n C[a*i] = 1\n i += 1\n\nprint(ans)', 'from collections import Counter\n\nN = int(input())\nA = list(map(int, input().split()))\n\ncnt = Counter(A) \n\nA = list(set(A))\nA.sort()\n\n\nC = [0]*(10**6+1)\nans = 0\n\nfor a in A:\n if C[a] == 0:\n i = 1\n while True:\n if a*i > 10**6:\n break\n C[a*i] = 1\n i += 1\n if cnt[a] == 1:\n ans += 1\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s791817360', 's134624652']
[44988.0, 45308.0]
[127.0, 645.0]
[328, 373]
p02642
u686230543
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input())\n\nmultiple = [False] * 1_000_001\nonce = set()\ntwice = set()\ncount = 0\n\nfor a in sorted(map(int, input().split())):\n if a in once:\n if a in twice:\n continue\n else:\n count -= 1\n twice.add(a)\n elif multiple[a]:\n continue\n else:\n count += 1\n once.add(a)\nprint(count)', 'n = int(input())\n\nmultiple = [False] * 1_000_001\nonce = set()\ntwice = set()\ncount = 0\n\nfor a in sorted(map(int, input().split())):\n if a in once:\n if a in twice:\n continue\n else:\n count -= 1\n twice.add(a)\n elif multiple[a]:\n continue\n else:\n count += 1\n once.add(a)\n for x in range(a, 1_000_001, a):\n multiple[x] = True\nprint(count)']
['Wrong Answer', 'Accepted']
['s673243869', 's981802744']
[40104.0, 39880.0]
[192.0, 303.0]
[311, 373]
p02642
u687044304
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['# -*- coding:utf-8 -*-\n\ndef solve():\n N = int(input())\n As = list(map(int, input().split()))\n\n setA = set(As)\n\n def divisor(n):\n i = 1\n ans = []\n while i*i <= n:\n if n%i == 0:\n ans.append(i)\n if i != n//i:\n ans.append(n//i)\n i += 1\n return ans\n\n dic = {}\n duplicates = set()\n for a in As:\n if not a in dic:\n dic[a] = 0\n else:\n duplicates.add(a)\n dic[a] += 1\n\n\n ans = 0\n for a in As:\n is_ok = True\n for d in divisor(a):\n if d in setA:\n is_ok = False\n break\n\n if is_ok:\n ans += 1\n\n for x in duplicates:\n ans -= dic[x]\n\n print(ans)\n\n\nif __name__ == "__main__":\n solve()\n', '# -*- coding:utf-8 -*-\n\ndef solve():\n N = int(input())\n As = list(map(int, input().split()))\n\n As.sort()\n\n setA = set(As)\n setDel = set()\n\n cands = []\n\n for a in As:\n if a in setDel:\n continue\n\n i = 1\n while a*i <= As[-1]:\n if a*i in setA:\n setDel.add(a*i)\n i += 1\n\n cands.append(a)\n\n \n dic = {}\n for a in As:\n if not a in dic:\n dic[a] = 0\n dic[a] += 1\n\n ans = 0\n for x in cands:\n if dic[x] > 1:\n continue\n ans += 1\n\n print(ans)\n\n\nif __name__ == "__main__":\n solve()\n']
['Wrong Answer', 'Accepted']
['s873284825', 's657120597']
[47524.0, 61752.0]
[2207.0, 535.0]
[825, 667]
p02642
u692453235
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['import math\n\nN = int(input())\nA = list(map(int, input().split()))\nA.sort()\nans = 0\n\nAM = A[-1]\ndp = [0]*(AM)\n\nfor x in A:\n if dp[x-1] == 0:\n temp = 2 * x\n while temp <= AM:\n dp[temp-1] += 1\n temp += x\n\nfor x in A:\n if dp[x-1] == 1:\n ans += 1\n\nprint(ans)', '\nimport math\nfrom collections import defaultdict\n\nN = int(input())\nA = list(map(int, input().split()))\nA.sort()\n\nD = defaultdict(int)\n\nAM = A[-1]\ndp = [True]*(AM)\n\nfor x in A:\n if dp[x-1]:\n temp = 2 * x\n while temp <= AM:\n dp[temp-1] = False\n temp += x\n\nfor x in A:\n if dp[x-1]:\n D[x] += 1\n\nans = len([i for i in D if D[i] == 1])\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s841651061', 's212466740']
[32260.0, 43488.0]
[552.0, 545.0]
[274, 362]
p02642
u693173434
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['import sys\nn=int(input())\na=list(map(int,input().split()))\n\nif n==1:\n print(1)\n sys.exit()\n\ndef fsort(a,max):\n n=len(a)\n f=[0]*(max+1)\n b=[0]*n\n\n for i in range(n):\n f[a[i]]+=1\n for i in range(1, max(+1)):\n f[i]+=f[i-1]\n for i in range(n-1,-1,-1):\n f[a[i]]-=1; b[f[a[i]]]=a[i]\n for i in range(n):\n a[i]=b[i]\n\nfsort(a, 10**6)\n\nif a[0]==1:\n if a[1]==1:\n print(0)\n sys.exit()\n else:\n print(1)\n sys.exit()\n\nif a[0]==a[1]:\n count=0\nelse:\n count=1\n\nfor i in range(n-2):\n if a[i+2]==a[i+1]:\n continue\n if a[i+1]==a[i]:\n continue\n for l in range(i+1):\n if a[i+1]%a[l]==0:\n break\n if i==l:\n count+=1\n\nif a[n-1]!=a[n-2]:\n for i in range(n):\n if a[n-1]%a[i]==0:\n break\n if i==n-2:\n count+=1\n\nprint(count)', 'n=int(input())\na=list(map(int,input().split()))\n\na.sort()\namx=max(a)+1\nl=[True]*amx\nans=0\n\nfor i in range(n-1):\n if l[a[i]]:\n for j in range(a[i],amx,a[i]):\n l[j]=False\n if a[i]<a[i+1]:\n ans+=1\n\nif l[-1]:\n ans+=1\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s075702087', 's767061088']
[32420.0, 32368.0]
[98.0, 321.0]
[1945, 266]
p02642
u698919163
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\nA = list(map(int,input().split()))\n\nMAX = 2*10**5+7\nA.sort()\n\nnum_tmp = [0]*MAX\n\nfor a in A:\n if num_tmp[a] == 1:\n num_tmp[a] = 2\n continue\n tmp = a\n while tmp <= MAX:\n num_tmp[tmp] = 1\n tmp += a\n\nans = 0\nfor a in A:\n if num_tmp[a] == 1:\n ans += 1\n \nprint(ans)', 'N = int(input())\nA = list(map(int,input().split()))\nA.sort()\nMAX = max(A)+1#A[-1]+1\nnum_tmp = [0]*MAX\n\nfor a in A:\n num_tmp[a] += 1\n if num_tmp[a] == 1:\n for i in range(2*a,MAX,a):\n num_tmp[i] = 2\n\nprint(num_tmp.count(1))']
['Runtime Error', 'Accepted']
['s155759323', 's475919275']
[32348.0, 32212.0]
[137.0, 316.0]
[331, 245]
p02642
u702686470
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['from collections import defaultdict\nmp = defaultdict(int)\nseen = defaultdict(int)\nn = int(input())\na = list(map(int,input().split()))\na.sort()\ndub = 0\nres = 0\nfor k in a:\n if mp[k]:\n dub+=1\n mp[k] += 1\nfor i in range(n):\n for j in range(i+1,n):\n if seen[a[j]]:\n continue\n if a[j]%a[i]==0:\n seen[a[j]] +=1\n res += 1\nprint(res,dub)\nprint(n-res-dub)\n\n', 'from collections import Counter\nn = int(input())\na = list(map(int,input().split()))\na.sort()\nct = Counter(a)\nst = set()\nans = 0\nx = max(a)\nfor i in range(n):\n if a[i] in st:\n continue\n if ct[a[i]]>1:\n st.add(a[i])\n for j in range(2,x//a[i]+1):\n st.add(a[i]*j)\nfor i in range(n):\n if not a[i] in st:\n ans += 1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s280402122', 's165565670']
[50448.0, 92936.0]
[2207.0, 762.0]
[411, 359]
p02642
u706330549
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['import sys\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\n\n\ndef f(a):\n for i in range(n-1):\n b[i] = a[i] % a[i+1]\n return b\n\n\nn, *a = map(int, read().split())\n\nb = [0] * n\n\na = sorted(a, reverse=True)\nz = 0\n\nwhile a[len(a)] == 0:\n a = f(a)\n z += 1\n\nprint(z-1)\n', 'import sys\nimport numpy as np\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\n\nn = int(readline())\na = np.array(read().split(), np.int32)\n\nb = np.zeros(10**6 + 10, np.int32)\ncnt = 0\n\nfor x in a:\n if b[x] > 1:\n continue\n b[::x] += 1\n\nfor x in a:\n if b[x] == 1:\n cnt += 1\n\nprint(cnt)\n']
['Runtime Error', 'Accepted']
['s478340369', 's181734080']
[27896.0, 39620.0]
[105.0, 1167.0]
[299, 324]
p02642
u711238850
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['from collections import Counter \n\ndef divisors(n):#without itselfs\n divisors = [1]\n for i in range(2, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n\n return divisors\n\ndef main():\n n = int(input())\n\n a = list([int(t)for t in input().split()])\n a_set = set(a)\n c = Counter(a)\n\n ans = 0\n\n for a_i in a:\n divs = set(divisors(a_i))\n for d in divs:\n if (not d in a_set) and c[a_i]==1:\n ans+=1\n break\n print(ans)\n \nif __name__ == "__main__":\n main()', 'from collections import Counter \n\ndef main():\n n = int(input())\n a = list([int(t)for t in input().split()])\n c = Counter(a)\n checker = [False]*(10**6+1)\n times = [False]*(10**6+1)\n\n for a_i in a:\n checker[a_i] = True\n ans = 0\n for i in range(1,10**6+1):\n if times[i]:\n continue\n if not checker[i]:\n continue\n if checker[i] and c[i]==1:\n ans+=1\n for j in range(i,10**6+1,i):\n times[j] = True\n \n print(ans)\n \nif __name__ == "__main__":\n main()\n']
['Wrong Answer', 'Accepted']
['s653182241', 's287758192']
[48148.0, 47860.0]
[2207.0, 334.0]
[631, 569]
p02642
u713492631
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input())\nA = list(map(int, input().split()))\n\nfor i in range(n):\n for j in range(n):\n if i == j:\n continue\n if A[i] % A[j] == 0:\n break\n else:\n ans += 1\n\nprint(ans)\n\n', 'n = int(input())\nA = list(map(int, input().split()))\n\ndp = [0] * (10**6+1)\n\nfor a in A:\n dp[a] += 1\n\nfor i in range(1, len(dp)):\n if dp[i]:\n for j in range(i+i, len(dp), i):\n dp[j] = 0\nprint(dp.count(1))\n']
['Runtime Error', 'Accepted']
['s350858500', 's035434203']
[32316.0, 32036.0]
[2206.0, 456.0]
[223, 228]
p02642
u713914478
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N=int(input())\n#5\nA=sorted(map(int,input().split()))\n#24 11 8 3 16\n\ndp = [1]*max(A)\nl = len(dp)\n\nfor a in A:\n\tif dp[a-1] == 1:\n\t\tdp[a-1] = 2\n\t\tfor i in range(2*a, l+1, a):\n\t\t\tdp[i-1] = 0\n\telif dp[a-1] == 2:\n\t\tdp[a-1] = 0\n\nsum([1 for a in A if dp[a-1] != 0])', 'N=int(input())\n#5\nA=sorted(map(int,input().split()))\n#24 11 8 3 16\n\ndp = [1]*max(A)\nl = len(dp)\n\nfor a in A:\n\tif dp[a-1] == 1:\n\t\tdp[a-1] = 2\n\t\tfor i in range(2*a, l+1, a):\n\t\t\tdp[i-1] = 0\n\telif dp[a-1] == 2:\n\t\tdp[a-1] = 0\n\nprint(sum([1 for a in A if dp[a-1] != 0]))\n\n']
['Wrong Answer', 'Accepted']
['s073837776', 's317102787']
[32244.0, 32276.0]
[398.0, 417.0]
[257, 266]
p02642
u714732628
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input())\na = list(map(int, input().split()))\na.sort()\nc = [0]*len(a)\ncnt = len(a)\nk = 1\nfor e in a:\n if c[k]==1:\n continue\n for i in range(k, len(a)):\n if a[i]%e!=0:\n continue\n else:\n c[i] = 1\n cnt -= 1\n k +=1\nif c[1]==1 and a[0]!=0:\n print(0)\nelse:\n print(cnt)', 'n = int(input())\na = list(map(int, input().split()))\na.sort()\nc = [0]*len(a)\ncnt = len(a)\nk = 1\nfor e in a:\n if c[i]==1:\n continue\n for i in range(len(a)):\n if a[i]%e!=0:\n continue\n else:\n c[i] = 1\n cnt -= 1\n k +=1\nif c[1]==1 and a[0]!=0:\n print(0)\nelse:\n print(cnt)', 'n = int(input())\na = list(map(int, input().split()))\na.sort()\ndp = [0]*(1000000+1)\ncnt = 0\nfor i in range(len(a)):\n if dp[a[i]]==1:\n continue\n while(a[i]*j<=a[-1]):\n dp[a[i]*j] = 1\n j += 1\n if i!=len(a)-1 and a[i+1]==a[i]:\n dp[a[i]] = 1\n continue\n cnt += 1\n dp[a[i]] = 1\n j = 2\nprint(cnt)', 'n = int(input())\na = list(map(int, input().split()))\na.sort()\ndp = [0]*(1000000+1)\ncnt = 0\nfor i in range(len(a)):\n if dp[a[i]]==1:\n continue\n j = 2\n while(a[i]*j<=a[-1]):\n dp[a[i]*j] = 1\n j += 1\n if i!=len(a)-1 and a[i+1]==a[i]:\n dp[a[i]] = 1\n continue\n cnt += 1\n dp[a[i]] = 1\nprint(cnt)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s244318675', 's599920854', 's607498169', 's117409452']
[32380.0, 32372.0, 33336.0, 33108.0]
[2206.0, 100.0, 109.0, 915.0]
[298, 295, 309, 309]
p02642
u727057618
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
["def main():\n n = int(input())\n a = sorted([int(i) for i in input().split()])\n table = [True for i in range(max(a))]\n res = 0\n amax = max(a)\n dup = 0\n\n for i in a:\n if table[i-1]:\n if i not in res:\n res.append(i)\n else:\n dup += 1 \n continue\n else:\n continue\n for j in range(i *2, amax, i):\n table[j-1] = False\n print(len(res) - dup)\n\nif __name__ == '__main__':\n main()\n\n", "def main():\n n = int(input())\n a = sorted([int(i) for i in input().split()])\n table = [True for i in range(max(a))]\n res = 0\n amax = max(a)\n dup = 0\n\n for i in a:\n if table[i-1]:\n if i not in res:\n res.append(i)\n else:\n dup += 1 \n continue\n else:\n continue\n for j in range(i *2, amax, i):\n table[j-1] = False\n print(len(res) - dup)\n\nif __name__ == '__main__':\n main()\n\n", "def main():\n n = int(input())\n a = sorted([int(i) for i in input().split()])\n table = [True for i in range(max(a))]\n res = []\n amax = max(a)\n dup = 0\n\n for i in a:\n if table[i-1]:\n if i not in res:\n res.append(i)\n else:\n dup += 1 \n continue\n else:\n continue\n for j in range(i *2, amax, i):\n table[j-1] = False\n print(len(res) - dup)\n\nif __name__ == '__main__':\n main()\n\n", "def main():\n n = int(input())\n a = sorted([int(i) for i in input().split()])\n table = [True for i in range(max(a))]\n res = []\n amax = max(a)\n dup = 0\n\n for i in a:\n if table[i-1]:\n if i not in res:\n res.append(i)\n else:\n dup += 1 \n continue\n else:\n continue\n for j in range(i *2, amax, i):\n table[j-1] = False\n print(len(res) - dup)\n\nif __name__ == '__main__':\n main()\n\n", "from collections import Counter\n\ndef main():\n n = int(input())\n a = sorted([int(i) for i in input().split()])\n table = [True for i in range(max(a))]\n res = 0\n amax = max(a)\n\n for i in a:\n if (amax ** 0.5) + 1 < i:\n break\n if table[i-1] is False:\n continue\n for j in range(i*2, amax+1, i):\n table[j-1] = False\n\n c = Counter(a)\n for i in set(a):\n if table[i-1]:\n if c[i] == 1:\n res += 1\n print(res)\n\nif __name__ == '__main__':\n main()\n\n", "def main():\n n = int(input())\n a = sorted([int(i) for i in input().split()])\n table = [True for i in range(max(a))]\n res = []\n amax = max(a)\n dup = 0\n\n for i in a:\n if table[i-1]:\n res.append(i)\n else:\n continue\n for j in range(i, amax+1, i):\n table[j-1] = False\n print(len(res) - dup)\n print(res)\n\nif __name__ == '__main__':\n main()\n\n", "from collections import Counter\n\ndef main():\n n = int(input())\n a = sorted([int(i) for i in input().split()])\n table = [True for i in range(max(a))]\n res = 0\n amax = max(a)\n\n for i in a:\n if table[i-1] is False:\n continue\n for j in range(i*2, amax+1, i):\n table[j-1] = False\n\n c = Counter(a)\n for i in set(a):\n if table[i-1]:\n if c[i] == 1:\n res += 1\n print(res)\n\nif __name__ == '__main__':\n main()\n\n"]
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s010948563', 's350189465', 's494487628', 's743321771', 's909784968', 's976422937', 's060702948']
[32160.0, 32088.0, 32188.0, 32124.0, 51332.0, 32204.0, 51248.0]
[154.0, 156.0, 2206.0, 2206.0, 291.0, 292.0, 359.0]
[507, 507, 508, 508, 551, 419, 499]
p02642
u729119068
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\nA = list(map(int, input().split()))\ncount = 0\nfor a in A:\n B = []\n for b in A:\n B.append(a%b)\n if B.count(0) == 1:\n count += 1\nprint(count)\n', 'from collections import Counter\nn = int(input())\na = list(map(int, input().split()))\na.sort()\nc = Counter(a)\nm = max(a) + 1\ndp = [False]*m\nans = 0\nfor ai in a:\n if dp[ai]:\n continue\n if c[ai] == 1:\n ans += 1\n for i in range(ai, m, ai):\n dp[i] = True\nprint(ans)']
['Wrong Answer', 'Accepted']
['s356211618', 's563335769']
[32172.0, 38460.0]
[2206.0, 347.0]
[170, 290]
p02642
u729133443
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['c=[0]*8**7\nfor a in[*open(i:=0)][1].split():c[int(a)]+=1\nwhile i<1e6:\n i+=1;j=i\n while j<1e6:j+=i;c[j]*=c[i]<1\nprint(c.count(1))', 'c=[0]*8**7\nfor a in[*open(0)][1].split():c[int(a)]+=1\ni=r=0\nfor t in c:\n if t:c[::i]=[0]*-(-8**7//i)\n i+=1;r+=t==1\nprint(r)']
['Time Limit Exceeded', 'Accepted']
['s966492870', 's499016001']
[41056.0, 60408.0]
[2206.0, 459.0]
[128, 123]
p02642
u729294108
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['import collections\n\nn = int(input())\nd = list(map(int, input().strip().split()))\n\n\ncounts = collections.Counter(d)\nd = []\nfor a, c in counts.items():\n if c == 0:\n d.append(a)\n\nd = sorted(d)\ncount = 0\n\nwhile True:\n if len(d) == 0:\n break\n\n divisor = d[0]\n d = d[1:]\n count += 1\n d1 = []\n for a in d:\n if a % divisor != 0:\n d1.append(a)\n\n d = d1\n\nprint(count)\n', 'import collections\n\nn = int(input())\nd = list(map(int, input().strip().split()))\n\ncounts = collections.Counter(d)\ndic = {a: True for a, c in counts.items()}\n\nkeys = sorted(dic.keys())\nlast = keys[-1]\n\nfor k in keys:\n if dic[k]:\n n = 2\n while k * n <= last:\n if k * n in dic:\n dic[k * n] = False\n n += 1\n \n if counts[k] > 1:\n dic[k] = False\n\ncount = len([True for v in dic.values() if v])\nprint(count)\n']
['Wrong Answer', 'Accepted']
['s436625936', 's276426987']
[36096.0, 50008.0]
[100.0, 646.0]
[449, 503]
p02642
u736470924
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['from numba import jit\n\n@jit\ndef resolve():\n n = int(input())\n A = list(map(int, input().split()))\n if len(set(A)) == 1:\n print(0)\n return\n A.sort()\n\n ans = 0\n while len(A) > 0:\n a = A.pop(0)\n ans += 1\n A = [i for i in A if i % a != 0]\n\n print(ans)\n\nresolve()\n', 'def resolve():\n N = int(input())\n A = list(map(int, input().split()))\n A.sort()\n pre_A = -1\n dp = [True for i in range(A[-1]+1)]\n for i in range(N):\n if pre_A != A[i]:\n for j in range(2, A[-1]+1):\n x = j*A[i]\n if x <= A[-1]:\n dp[x] = False\n else:\n break\n pre_A = A[i]\n else:\n dp[A[i]] = False\n\n count = 0\n for i in range(N):\n if dp[A[i]]:\n count += 1\n print(count)\n\nresolve()']
['Wrong Answer', 'Accepted']
['s163808079', 's459446464']
[135728.0, 32376.0]
[2210.0, 469.0]
[315, 550]
p02642
u750651325
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input())\na = list(map(int, input().split()))\ncnt = [0] * (10**6)\n\nfor elem in a:\n if elem not in cnt:\n cnt[elem] += 1\n\nunique = []\n\nfor i in range((10**6)+1):\n if cnt[i] == 1:\n unique.append(i)\n\ncnt = [0] * ((10**6)+1)\n\nfor elem in unique:\n for m in range(elem*2, (10**6)+1, elem):\n cnt[m] = 1\n\nans = 0\n\na = list(set(a))\n\nfor elem in a:\n if cnt[elem] == 0:\n ans+=1\n\nprint(ans)\n', 'n = int(input())\na = list(map(int, input().split()))\ncnt = [0] * ((10**6)+1)\n\nfor elem in a:\n cnt[elem] += 1\n\nunique = []\n\nfor i in range((10**6)+1):\n if cnt[i] == 1:\n unique.append(i)\n\ncnt = [0] * ((10**6)+1)\n\na = list(set(a))\n\nfor elem in a:\n for m in range(elem*2, (10**6)+1, elem):\n cnt[m] = 1\n\nans = 0\n\nfor elem in unique:\n if cnt[elem] == 0:\n ans+=1\n\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s129116397', 's955771173']
[32396.0, 47416.0]
[2206.0, 1221.0]
[425, 401]
p02642
u751277549
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\nA = list(map(int, input().split())) + [10**7]\n\nA.sort()\ne = np.zeros(10**6 + 1)\nans = 0\nfor i in range(N):\n if e[A[i]] == 0:\n e[::A[i]] = 1 \n \n if A[i] != A[i+1]:\n ans += 1\nprint(ans)', 'import numpy as np\n\n\nN = int(input())\nA = list(map(int, input().split())) + [10**7]\n\nA.sort()\ne = np.zeros(10**6 + 1)\nans = 0\nfor i in range(N):\n if e[A[i]] == 0:\n e[::A[i]] = 1 \n \n if A[i] != A[i+1]:\n ans += 1\nprint(ans)']
['Runtime Error', 'Accepted']
['s332181350', 's192203782']
[32180.0, 51568.0]
[106.0, 412.0]
[349, 370]
p02642
u751717561
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input())\na = list(map(int, input().split())) \n\nans = [1]*n\n\nfor i in range(n):\n for j in range(n):\n if a[i] % a[j] == 0:\n if i == j:\n continue\n else:\n ans[i] = 0\n\nprint(ans)', 'n = int(input())\na = list(map(int, input().split())) \n\nans = [1]*n\n\nif sum(a)/n == a[0] and sum(a)/n == a[-1]:\n print(0)\n exit()\n\na.sort()\n\nfor i in range(n-1):\n if ans[i] == 1:\n for j in range(i+1, n):\n if a[j]%a[i] == 0:\n print(j)\n ans[j] = 0\n\nprint(sum(ans))', 'n = int(input())\na = list(map(int, input().split())) \n\na.sort()\n\nc = [0]*a[-1]\n\nfor ai in a:\n if c[ai-1] >= 1:\n c[ai-1] += 1\n continue\n i = ai\n while i <= a[-1]:\n c[i-1] += 1\n i += ai\nprint(sum(c[ai-1] == 1 for ai in a))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s038692488', 's456607990', 's928917144']
[32064.0, 32232.0, 33340.0]
[2206.0, 2206.0, 640.0]
[243, 318, 257]
p02642
u756464404
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input())\narr = list(map(int, input().split()))\narr = sorted(arr)\nm = arr[-1]\ntf = [True] * (m+1)\ncnt = 0\n \nfor i in range(n):\n ai = arr[i]\n if tf[ai] == True:\n cnt += 1\n for j in range(ai, m, ai):\n tf[j] = False\n if ai in arr[i+1:]:\n cnt -= 1\n \n\nprint(cnt)', 'n = int(input())\narr = list(map(int, input().split()))\narr = sorted(arr)\nm = arr[-1]\nli = [0]*(m+1)\ncnt = 0\n \nfor i in arr:\n for j in range(i, m+1, i):\n li[j] += 1\n\nfor i in arr:\n if li[i] == 1:\n cnt += 1\n\nprint(cnt)']
['Wrong Answer', 'Accepted']
['s722223928', 's039831739']
[32064.0, 32300.0]
[2206.0, 451.0]
[295, 231]
p02642
u756607246
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
["\n\ndef main():\n N = int(input())\n As = list(map(int, input().split()))\n\n As.sort()\n amax = max(As) + 1\n lis = [True] * amax\n ans = 0\n\n for i in range(N-1):\n if lis[As[i]]:\n for j in range(As[i], amax, As[i]):\n lis[j] = False\n if a[i] < a[i+1]:\n ans += 1\n if lis[-1]:\n ans += 1\n\n return ans\n\nif __name__ == '__main__':\n #start = time.time()\n print(main())\n #elapsed_time = time.time() - start\n ", "\n\ndef main():\n N = int(input())\n As = list(map(int, input().split()))\n\n As.sort()\n amax = max(As) + 1\n lis = [True] * amax\n ans = 0\n\n for i in range(N-1):\n if lis[As[i]]:\n for j in range(As[i], amax, As[i]):\n lis[j] = False\n if As[i] < As[i+1]:\n ans += 1\n if lis[-1]:\n ans += 1\n\n return ans\n\nif __name__ == '__main__':\n #start = time.time()\n print(main())\n #elapsed_time = time.time() - start\n "]
['Runtime Error', 'Accepted']
['s851732341', 's187495044']
[32380.0, 32216.0]
[132.0, 217.0]
[573, 575]
p02642
u757424147
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input())\nnums = list(map(int,input().split()))\nnums.sort()\nans = []\nfor i in range(len(nums)):\n flag = 0\n for j in range(i-1,len(nums)):\n if i==j:\n continue\n if nums[i]%nums[j] == 0:\n flag = 1\n break\n if flag ==0:\n ans.append(nums[i])\nprint(len(ans))\n', 'n = int(input())\nnums = list(map(int,input().split()))\nnums.sort()\nans = 0\ncnt = {}\nflag = [0]*1000005\nfor i in range(1,len(nums)):\n cnt[i] = cnt.get(i,0) + 1\n\n \nfor i in nums:\n if flag[i] == 0 and cnt[i] == 1:\n ans += 1\n for j in range(i*2,1000000,i):\n flag[j] = 1\n\nprint(ans)', 'n = int(input())\nnums = list(map(int,input().split()))\nnums.sort()\nans = 0\ncnt = {}\nflag = [0]*1000005\nfor i in nums:\n cnt[i] = cnt.get(i,0) + 1\n\nfor i in nums:\n if flag[i] == 0 and cnt[i] == 1:\n ans += 1\n if flag[i] == 1:\n continue\n for j in range(i,1000001,i):\n flag[j] = 1\n\nprint(ans)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s680198111', 's788886888', 's434545282']
[32356.0, 48712.0, 43588.0]
[2206.0, 2207.0, 346.0]
[286, 289, 300]
p02642
u759412327
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\nA = sorted(list(map(int,input().split())))\nB = (10**6+1)*[0]\n\nfor a in A:\n B[a]+=1\n if B[a]==1:\n for n in range(2*a,10**6+1,a):\n B[n]+=1\n\nprint(B.count(1))', 'N = int(input())\nA = sorted(list(map(int,input().split())))\nB = (10**6+1)*[0]\n\nfor a in A:\n B[a]+=1\n if B[a]==1:\n for n in range(2*a,10**6+1,a):\n B[n]+=2\n\nprint(B.count(1))']
['Wrong Answer', 'Accepted']
['s178754778', 's311049768']
[32236.0, 32192.0]
[466.0, 418.0]
[182, 182]
p02642
u763534217
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input())\na = list(map(int, input().split()))\na.sort()\nmaxa = max(a)\n\ndp = {i: 0 for i in range(1, dp+1)}\n\nans = 0\nfor i in range(n):\n if dp[a[i]] == 1:\n continue\n\n if i == n - 1 or a[i] != a[i+1]:\n ans += 1\n\n prime += a[i]\n while prime <= maxa:\n dp[prime] = 1\n prime += a[i]\n \nprint(ans)', 'import math\n\n\ndef dellist(items, indexes): return [\n item for index, item in enumerate(items) if index not in indexes]\n\n\nn = int(input())\nli = list(map(int, input().split()))\n\nli.sort()\n\n# maxval = 10 ** 6\n\n# li2 = list(set(li))\n\ncnt = [0 for i in range(10**6)]\nfor i in range(n):\n cnt[li[i]-1] += 1\n# print(cnt)\n\nunique = list(set(li))\nunique.sort()\n\n\n\ni = 0\nwhile 1:\n \n # break\n to_be_dropped = []\n for j in range(i+1, len(unique)):\n if unique[j] % unique[i] == 0:\n \n to_be_dropped.append(j)\n unique = dellist(unique, to_be_dropped)\n i += 1\n if i >= len(unique):\n break\nprint(unique)\n\nc = 0\nfor i in range(len(unique)):\n if cnt[unique[i]-1]>=2:\n c += 1\nprint(len(unique) - c)\n', 'n = int(input())\nA = map(int, input().split())\nmaxA = max(A)\n\nC = {a: 0 for a in A}\nfor a in A:\n C[a] += 1\n\nD = {a: 0 for a in A}\nfor a in A:\n if C[a] > 0:\n t = 2\n while a * t <= maxA:\n D[a * t] = 1\n t += 1\nans = 0\nfor a in A:\n if C[a] == 1 and D[a] == 0:\n ans += 1\nprint(ans)\n', 'n = int(input())\nA, = map(int, input().split())\nmaxA = max(A)\n\nC = {a: 0 for a in A}\nfor a in A:\n C[a] += 1\n\nD = {a: 0 for a in A}\nfor a in A:\n if C[a] > 0:\n t = 2\n while a * t <= maxA:\n D[a * t] = 1\n t += 1\nans = 0\nfor a in A:\n if C[a] == 1 and D[a] == 0:\n ans += 1\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\na.sort()\nmaxa = max(a)\n\ndp = {i: 0 for i in range(1, maxa+1)}\n\nans = 0\nfor i in range(n):\n if dp[a[i]] == 1:\n continue\n\n if i == n - 1 or a[i] != a[i+1]:\n ans += 1\n\n t = 1\n while a[i]*t <= maxa:\n dp[a[i]*t] = 1\n t += 1\n\nprint(ans)']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s123466222', 's545369815', 's583825990', 's787455863', 's015170331']
[32228.0, 41036.0, 25076.0, 25212.0, 103684.0]
[105.0, 2207.0, 55.0, 37.0, 1327.0]
[338, 844, 410, 410, 323]
p02642
u763550415
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\nA = list(map(int, input().split()))\nA.sort()\nMAX = 10**6+1\ncnt = [0]*MAX\n\nfor x in A:\n if cnt[x] != 0:\n \tcnt[i] = 2\n else:\n for i in range(x, MAX, x):\n cnt[i] += 1\n \nans = 0\nfor x in A:\n \n if cnt[x] == 1: \n ans += 1\n \nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\nA.sort()\nMAX = 10**6+1\ncnt = [0]*MAX\n\nfor x in A:\n if cnt[x] != 0:\n \tcnt[x] = 2\n else:\n for i in range(x, MAX, x):\n cnt[i] += 1\n \nans = 0\nfor x in A:\n \n if cnt[x] == 1: \n ans += 1\n \nprint(ans)']
['Wrong Answer', 'Accepted']
['s132994932', 's101997130']
[32060.0, 32168.0]
[435.0, 379.0]
[404, 404]
p02642
u764956288
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['import sys\nimport numpy as np\n\n\ndef solve(sequence):\n\n sequence.sort()\n\n max_v = sequence[-1]\n\n dp = [True] * (max_v + 1)\n\n previous = -1\n for v in sequence:\n if v == previous:\n dp[v] = False\n continue\n\n previous = v\n\n if not dp[v]:\n continue\n\n for iv in range(2 * v, max_v+1, v):\n dp[iv] = False\n\n count = 0\n for v in sequence:\n if dp[v]:\n count += 1\n\n return count\n\n\nif sys.argv[-1] == \'ONLINE_JUDGE\':\n from numba.pycc import CC\n cc = CC(\'my_module\')\n cc.export(\'main\', \'(i8[::1])\')(solve)\n cc.compile()\n exit()\n\n\nfrom my_module import solve\n\n\ndef main():\n _ = input()\n sequence = np.array(input().split(), np.int64)\n print(solve(sequence))\n\n\nif __name__ == "__main__":\n main()\n', 'import sys\nimport numpy as np\n\n\ndef solve(sequence):\n\n sequence.sort()\n\n max_v = sequence[-1]\n\n dp = [True] * (max_v + 1)\n\n previous = -1\n for v in sequence:\n if v == previous:\n dp[v] = False\n continue\n\n previous = v\n\n if not dp[v]:\n continue\n\n for iv in range(2 * v, max_v+1, v):\n dp[iv] = False\n\n count = 0\n for v in sequence:\n if dp[v]:\n count += 1\n\n return count\n\n\nif sys.argv[-1] == \'ONLINE_JUDGE\':\n from numba.pycc import CC\n cc = CC(\'my_module\')\n cc.export(\'main\', \'(i8[::1])\')(solve)\n cc.compile()\n exit()\n\n\nfrom my_module import solve\n\n\ndef main():\n sequence = np.array(input().split(), np.int64)\n print(solve(sequence))\n\n\nif __name__ == "__main__":\n main()\n', 'import sys\nimport numpy as np\n\n\ndef solve(sequence):\n\n sequence.sort()\n\n max_v = sequence[-1]\n\n dp = [True] * (max_v + 1)\n\n previous = -1\n for v in sequence:\n if v == previous:\n dp[v] = False\n continue\n\n previous = v\n\n if not dp[v]:\n continue\n\n for iv in range(2 * v, max_v+1, v):\n dp[iv] = False\n\n count = 0\n for v in sequence:\n if dp[v]:\n count += 1\n\n return count\n\n\n# if sys.argv[-1] == \'ONLINE_JUDGE\':\n# from numba.pycc import CC\n# cc = CC(\'my_module\')\n# cc.export(\'main\', \'(i8[::1])\')(solve)\n# cc.compile()\n# exit()\n#\n#\n# from my_module import solve\n\n\ndef main():\n _ = input()\n sequence = np.array(input().split(), np.int64)\n print(solve(sequence))\n\n\nif __name__ == "__main__":\n main()\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s006474803', 's987418013', 's173423118']
[27148.0, 27008.0, 50416.0]
[115.0, 115.0, 333.0]
[821, 805, 837]
p02642
u766646838
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\nc=list(map(int, input().split()))\n\n@jit\ndef search(N,c):\n count = 0\n for i in range(N):\n b = []\n m = copy.copy(c)\n a = c[i]\n m.pop(i)\n m.sort()\n for j in range(N-1):\n if m[j]>c[i]:\n count+=1\n break\n elif c[i]%m[j]==0:\n break\n elif j == N-2:\n count+=1\n elif c[i]%m[j]!=0:\n continue\n \n return count\n\nprint(search(N,c))\n \n \n \n \n \n ', 'N = int(input())\nc=list(map(int, input().split()))\nc.sort()\n\ncount = 0\nwhile count<len(c):\n for i,b in enumerate(c):\n if i == count:\n continue\n \n print(i,b)\n if b%c[count]==0:\n c.pop(i)\n print(c)\n count+=1\n\nprint(c)\n\n\n\n ', 'N = int(input())\nc = list(map(int,input().split()))\n\nc.sort()\na = c[N-1]\nlist_c = [0]*(a+1)\nfor i in c:\n mal = 2\n b = i\n while i<=a:\n list_c[i]+=1\n i = b*mal\n mal+=1\ncount = 0\nfor i in c:\n if list_c[i]==1:\n count+=1\nprint(count)\n \n ']
['Runtime Error', 'Runtime Error', 'Accepted']
['s426659513', 's969103754', 's234716168']
[32296.0, 151008.0, 32376.0]
[68.0, 4138.0, 787.0]
[447, 254, 255]
p02642
u767664985
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['from collections import Counter\n\nN = int(input())\nsearch_list = list(map(int, input().split()))\n\nif len(set(search_list)) == 1:\n print(0)\n exit()\n\n\nans_list = []\nans = 0\n\n\nc = Counter(search_list)\ndoubly = [x for x in c.values() if c[x] == 1]\n\ntmp = min(search_list)\n\nwhile tmp <= max(search_list)/2:\n if tmp in doubly:\n ans_list.append(tmp)\n search_list = [i for i in search_list if i % tmp != 0]\n if len(search_list) == 0:\n break\n else:\n tmp = min(search_list)\n\nans = len(ans_list) + len(search_list)\nprint(ans)\n', 'from collections import Counter\n\nN = int(input())\nA = sorted(list(map(int, input().split())))\n\nif len(set(A)) == 1:\n print(0)\n exit()\n\n\nans_list = [True for _ in range(A[-1] + 1)]\nans = 0\n\n\nc = Counter(A)\noriginal = [x for x in c.keys() if c[x] == 1]\n\nfor a in original:\n if ans_list[a] == True:\n ans += 1\n i = 2\n while a * i < A[-1]:\n ans_list[a * i] = False\n i += 1\n\nprint(ans)\n', 'from collections import Counter\n\nN = int(input())\nA = sorted(list(map(int, input().split())))\n\nif len(set(A)) == 1:\n print(0)\n exit()\n\n\nans_list = [True for _ in range(A[-1])]\nans = 0\n\n\nc = Counter(A)\noriginal = [x for x in c.keys() if c[x] == 1]\n\nfor a in original:\n if ans_list[a-1]:\n ans += 1\n i = 2\n while a * i < A[-1]:\n ans_list[a * i] = False\n\nprint(ans)\n', 'from copy import deepcopy\n\nN = int(input())\nA = list(map(int, input().split()))\n\nans = 0\n\nif len(set(A)) == 1:\n print(0)\n exit()\n\n\nsearch_list = deepcopy(A)\nans = 0\n\ntmp = min(search_list)\nsmax = int(max(search_list)**0.5) + 1\n\nwhile search_list:\n ans += 1\n search_list = [i for i in search_list if i % tmp != 0]\n tmp = min(search_list)\n if tmp < smax:\n ans += len(search_list)\n break\n\nprint(ans)\n', 'from collections import Counter\n\nN = int(input())\nA = sorted(list(map(int, input().split())))\n\nif len(set(A)) == 1:\n print(0)\n exit()\n\n\nans_list = [True for _ in range(A[-1])]\nans = 0\n\n\nc = Counter(A)\noriginal = [x for x in c.keys() if c[x] == 1]\n\nfor a in original:\n if ans_list[a-1]:\n ans += 1\n i = 2\n while a * i < A[-1]:\n ans_list[a * i] = False\n i += 1\n\nprint(ans)\n', 'from collections import Counter\n\nN = int(input())\nA = sorted(list(map(int, input().split())))\n\n\nans_list = [True for _ in range(A[-1] + 1)]\nans = 0\n\n\nc = Counter(A)\n\nfor a in A:\n if ans_list[a] == True:\n if c[a] == 1:\n ans += 1\n i = 2\n while a * i <= A[-1]:\n ans_list[a * i] = False\n i += 1\n\nprint(ans)\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s273018088', 's362416569', 's382102685', 's391003857', 's406147156', 's984363884']
[39876.0, 45836.0, 45988.0, 33108.0, 45836.0, 44688.0]
[2206.0, 688.0, 2207.0, 2206.0, 658.0, 754.0]
[641, 520, 491, 473, 510, 448]
p02642
u767821815
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\n\nA = [int(x) for x in input().split()]\nA = sorted(A)\n\n\nif A[0] == A[1]:\n cnt = 0\nelse:\n cnt = 1\n \nfor i in range(1,N):\n flag = True\n for j in range(i):\n if A[i]%A[j] == 0:\n flag = False\n break\n break\n \n if i != N-1:\n if A[i] == A[i+1]:\n flag = False\n \n if flag == True:\n cnt += 1\nprint(cnt)', 'n=int(input())\na=list(map(int,input().split()))\n\nl=[0]*(10**6+1)\nans=0\n#print(l)\nfor i in a:\n if l[i]==0:\n for j in range(i,10**6+1,i):\n l[j] += 1\n else:\n l[i] += 1\n#print(l)\nfor i in a:\n if l[i]==1:\n ans+=1\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s146144536', 's901942967']
[32192.0, 32196.0]
[247.0, 619.0]
[395, 260]
p02642
u770076823
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\nA = list(map(int, input().split()))\nans = 0\n\nA.sort(reverse=True)\n\nfor i in range(len(A)-1):\n flg = True\n for j in range(i+1, len(A)):\n if A[i] % A[j] == 0:\n flg = False\n break\n if flg == True:\n ans += 1\n\nprint(ans)\n', "from collections import Counter\n\n\ndef main():\n N = int(input())\n A = list(map(int, input().split()))\n\n A_set = set(A)\n A_dict = Counter(A)\n A_dict.sort()\n\n for key, count in A_dict.items():\n if count > 1:\n A_set.discard(key)\n continue\n\n k = key * 2\n\n if key in A_set:\n while k <= max(A):\n A_set.discard(k)\n k += key\n\n print(len(A_set))\n\n\nif __name__ == '__main__':\n main()\n", 'N = int(input())\nA = list(map(int, input().split()))\nans = 0\n\nA.sort(reverse=True)\n\nfor i in range(len(A)-1):\n flg = True\n for j in range(i+1, len(A)):\n if A[i] % A[j] == 0:\n flg = False\n break\n if flg == True:\n print(i)\n ans += 1\n\nprint(ans)\n', "\ndef main():\n N = int(input())\n A = list(map(int, input().split()))\n\n m = max(A) + 1\n dp = [0] * m\n\n for a in sorted(A):\n if dp[a] != 0:\n dp[a] = 2\n continue\n for i in range(a, m, a):\n dp[i] += 1\n\n print(sum(dp[i] == 1 for i in A))\n\n\nif __name__ == '__main__':\n main()\n"]
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s036180522', 's503019165', 's824821845', 's897148995']
[32168.0, 48132.0, 32256.0, 32200.0]
[2206.0, 119.0, 2206.0, 300.0]
[278, 481, 295, 337]
p02642
u771167374
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['from collections import Counter \nn = int(input())\na = sorted(list(map(int, input().split())))\ns = sorted(set(a))\nc = Counter(a)\nt = [0] * (10**6 + 1)\nfor i in a:\n for j in range(i, 10**6+1, i):\n t[j] += 1\nprint(len(i for i in a if t[i] == 1 and c[i] == 1))\n\n', 'from collections import Counter \nn = int(input())\na = list(map(int, input().split()))\ns = set(a)\nc = Counter(a)\nt = [0] * (10**6 + 1)\nfor i in s:\n for j in range(i, 10**6+1, i):\n t[j] += 1\n\nans = len([1 for i in s if t[i] == 1 and c[i] == 1])\nprint(ans)\n\n']
['Runtime Error', 'Accepted']
['s581625143', 's136470394']
[41284.0, 50652.0]
[2206.0, 1439.0]
[268, 265]
p02642
u773077120
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\nA = sorted(map(int, input().split()))\nsum(sum(A[j] % A[i] == 0 for i in range(j)) == 0 and (j == N - 1 or A[j] < A[j + 1]) for j in range(N))', 'import collections\n\nN = int(input())\nA = sorted(map(int, input().split()))\n\ndp = collections.defaultdict(lambda: True)\n\nfor i in range(N):\n if i < N - 1 and A[i] == A[i + 1]:\n dp[A[i]] = False\n k = 2\n while True:\n if A[i] * k > A[-1]:\n break\n else:\n dp[A[i] * k] = False\n k += 1\n\nprint(sum(dp[a] for a in A))']
['Wrong Answer', 'Accepted']
['s017160823', 's587997244']
[32064.0, 101700.0]
[2206.0, 1329.0]
[158, 371]
p02642
u780475861
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
["def main():\n n, *A = map(int, f.read().split())\n A.sort()\n n = A[-1]\n isPrime = [True] * (n + 1)\n prep = 0\n for i in A:\n if prep == i:\n isPrime[prep] = False\n continue\n if isPrime[i]:\n for j in range(i * 2, n + 1, i):\n isPrime[j] = False\n prep = i\n\n prep = res = 0\n for i in A:\n if prep == i:\n continue\n if isPrime[i]:\n res += 1\n prep = i\n print(res)\n\n\nif __name__ == '__main__':\n main()", "def main():\n n, *A = map(int, open(0).read().split())\n A.sort()\n m = A[-1]\n lst = [0] * (m + 1)\n prep = 0\n for i in A:\n if i == prep:\n lst[i] = 1\n continue\n lst[2 * i::i] = [1] * len(lst[2 * i::i])\n prep = i\n res = 0\n for i in A:\n if lst[i] == 0:\n res += 1\n print(res)\n\nif __name__ == '__main__':\n main()\n"]
['Runtime Error', 'Accepted']
['s241715527', 's679245402']
[9160.0, 40932.0]
[25.0, 235.0]
[529, 342]
p02642
u787059958
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['from collections import deque, Counter\nN = int(input())\nA = sorted(list(map(int, input().split())))\n\nk = list(set(A))\nif (len(k) == 1):\n print(0)\n exit()\nj = 0\nans = deque()\nc = Counter(A)\nwhile j <= N - 1:\n if (j < N - 1):\n if (A[0] == A[j] and A[j] == A[j + 1]):\n j += 1\n continue\n\n if (j == 0 and A[j] != A[j + 1]):\n ans.append(j)\n j += 1\n continue\n check = False\n for i in range(0, j):\n \n if (i == j):\n continue\n if (c[A[j]] != 1):\n check = True\n break\n\n if (not check):\n ans.append(j)\n j += 1\n\nprint(len(ans))\n', 'n = int(input())\na = list(map(int, input().split()))\n\ntable = [0 for i in range(10**6 + 1)]\nans = 0\na.sort()\na.append(10**7)\nfor i in range(n):\n el = a[i]\n if table[el] != 0:\n continue\n else:\n if el != a[i + 1]:\n ans += 1\n idx = el\n while idx <= 10**6:\n table[idx] += 1\n idx += el\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s092233277', 's454901798']
[41496.0, 32368.0]
[2207.0, 644.0]
[672, 346]
p02642
u796102246
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\nA = list(map(int,input().split()))\nans = 0\nfor i in range(N) : \n B = list(map(lambda x: A[i] % x , A))\n print(B)\n if B.count(0) == 1 :\n ans += 1\n\nprint(ans)\n', 'N = int(input())\nl = [0]*(10**6+1)\nfor a in map(int,input().split()) :\n l[a] += 1\nans = 0\n\nfor i in range(1, 10**6 + 1) :\n if l[i] == 1 :\n ans += 1\n if l[i] > 0 :\n for j in range(i , 10**6 + 1, i) :\n l[j] = 0\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s770963271', 's882329756']
[126008.0, 32456.0]
[2528.0, 417.0]
[190, 254]
p02642
u797798686
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['from sys import stdin\ndata = stdin.readlines()\n\nn = int(data[0].split()[0])\na = [int(s) for s in data[1].split()]\na = sorted(a)\n\nmax = a[-1]\nprint(max)\n\nl = [0]*(max+1)\n\nfor i in a:\n l[i] += 1\n if l[i] == 1:\n for j in range(i*2,max+1,i):\n l[j] = 2\nprint(l.count(1))', 'from sys import stdin\ndata = stdin.readlines()\n\nn = int(data[0].split()[0])\na = [int(s) for s in data[1].split()]\na = sorted(a)\n\nmax = a[-1]\n\nl = [0]*(max+1)\n\nfor i in a:\n l[i] += 1\n if l[i] == 1:\n for j in range(i*2,max+1,i):\n l[j] = 2\nprint(l.count(1))']
['Wrong Answer', 'Accepted']
['s494287652', 's577374591']
[32700.0, 32696.0]
[317.0, 323.0]
[289, 278]
p02642
u798260206
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['n = int(input())\na = sorted(list(map(int,input().split())))\narr = [0]*(max(a)+1)\n\nfor i in a:\n for j in range(i,max(a)+1,i):\n arr[i]+=1\n\ncnt = 0\nfor i in a:\n if arr[i] ==1:\n cnt += 1\nprint(cnt)\n ', 'n = int(input())\na = list(map(int,input().split()))\nm =max(a)\narr = [0]*(m+1)\n\nfor i in a:\n for j in range(i,m+1,i):\n arr[i]+=1\n\ncnt = 0\nfor i in a:\n if arr[i] ==1:\n cnt += 1\nprint(cnt)\n ', 'n = int(input())\na = list(map(int,input().split()))\nm =max(a)\narr = [0]*(m+1)\n\nfor i in a:\n for j in range(i,m+1,i):\n arr[j]+=1\n\ncnt = 0\nfor i in a:\n if arr[i] ==1:\n cnt += 1\n\nprint(cnt)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s354733860', 's613152495', 's982010769']
[32240.0, 32240.0, 32188.0]
[2206.0, 446.0, 452.0]
[208, 200, 194]
p02642
u799428760
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['if __name__ == "__main__":\n n = int(input())\n a = list(map(int, input().split()))\n\n a.sort()\n\n count = 0\n for ite1, i in enumerate(a):\n b = [_ for _ in a if _ < i]\n for ite2, j in enumerate(b):\n if ite1 == ite2: \n pass\n elif i%j == 0:\n break\n elif ite2 == len(a)-1:\n count += 1\n\n print(count)', 'if __name__ == "__main__":\n n = int(input())\n l_a = list(map(int, input().split()))\n s_a = list(set(l_a))\n\n s_a.sort()\n\n dub_a = [0]*(max(s_a)+1)\n\n for i in l_a:\n dub_a[i] += 1\n\n dp = [1]*(max(s_a)+1)\n\n for i in s_a:\n if dp[i] == 0:\n pass\n else:\n for j in range(2*i, len(dp), i):\n dp[j] = 0\n\n\n count = 0\n for i in s_a:\n if dp[i]==1 and dub_a[i]==1:\n count += 1\n print(count)']
['Wrong Answer', 'Accepted']
['s042314586', 's739665751']
[32068.0, 34932.0]
[2206.0, 342.0]
[402, 483]
p02642
u802234211
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['import sys\nimport copy as cp\nfrom numba import jit\n@jit\ndef fac_serch():\n n = int(input())\n all_num = list(map(int,input().split()))\n all_num.sort()\n factor = []\n tmp_fac = list()\n if(all_num[0] == all_num[-1]):\n print(0)\n sys.exit()\n while(len(all_num)!=0):\n now_factor = all_num.pop(0)\n factor.append(now_factor)\n if(len(all_num) == 0):\n break\n tmp_fac = []\n for i in range(len(all_num)):\n # print(all_num,i)\n if(all_num[i]%now_factor != 0):\n tmp_fac.append(all_num[i])\n all_num = cp.copy(tmp_fac)\n return len(factor)\nprint(fac_serch())', 'n = int(input())\nA = list(map(int,input().split()))\nA.sort()\nprint(A)\nN = len(A)\nmultiple = [0]*(A[-1]+1)\nfor i in range(N):\n now = A[i]\n while(now <= A[-1]):\n multiple[now] += 1\n now += now\nans = 0\nfor i in range(N):\n if(multiple[A[i]] == 1):\n ans += 1\nprint(multiple)\nprint(ans)', 'n = int(input())\nA = list(map(int,input().split()))\nA.sort()\n# print(A)\nmultiple = [0]*(A[-1]+1)\nfor i in range(n):\n now = A[i]\n while(now <= A[-1]):\n multiple[now] += 1\n now += now\nans = 0\nfor i in range(N):\n if(multiple[A[i]] == 1):\n ans += 1\n# print(multiple)\nprint(ans)', 'n = int(input())\nA = list(map(int,input().split()))\nA.sort()\n# print(A)\nmultiple = [0]*(A[-1]+1)\nfor i in range(n):\n now = A[i]\n while(now <= A[-1]):\n multiple[now] += 1\n now += A[i]\nans = 0\nfor i in range(n):\n if(multiple[A[i]] == 1):\n ans += 1\n# print(multiple)\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s027293760', 's342807991', 's365032014', 's306653203']
[139836.0, 32812.0, 32252.0, 32348.0]
[2210.0, 347.0, 220.0, 731.0]
[666, 310, 303, 304]
p02642
u808585569
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\nA = list(map(int, input().split()))\nA.sort()\nAmax = A[-1]\ndp = [1]*(Amax+1)\nans = 0\nfor i in range(len(A)):\n p = A[i]\n if dp[p] == 1:\n ans += 1\n for q in range(Amax//p+1):\n dp[p*q] = 0\nprint(ans)\nprint(dp)', 'N = int(input())\nA = list(map(int, input().split()))\nA.sort()\nAmax = A[-1]\ndp = [1]*(Amax+1)\nans = 0\nfor i in range(len(A)-1):\n p = A[i]\n if dp[p] == 1:\n for q in range(Amax//p+1):\n dp[p*q] = 0\n if A[i] != A[i+1]: \n ans += 1\nif dp[Amax] == 1:\n ans += 1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s160378797', 's372737769']
[32940.0, 32228.0]
[508.0, 406.0]
[235, 282]
p02642
u809108154
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['def main():\n n=int(input())\n a=sorted(map(int,input().split()))\n maxa=a[-1]+1\n tf=[False]*maxa\n r=0\n n-=1\n \n for i in range(n):\n a_i=a[i]\n if tf[a_i] ==False:\n for j in range(a_i,maxa,a_i):\n print(j)\n tf[j]=True\n if a_i < a[i+1]:\n #print(a_i)\n r+=1\n if tf[-1] ==False:\n r+=1\n print(r)\nmain()', 'def main():\n n=int(input())\n a=sorted(map(int,input().split()))\n maxa=a[-1]+1\n tf=[False]*maxa\n r=0\n n-=1\n for i in range(n):\n a_i=a[i]\n if tf[a_i] ==False:\n for j in range(a_i,maxa,a_i):\n tf[j]=True\n if a_i < a[i+1]:\n #print(a_i)\n r+=1\n if tf[-1] ==False:\n r+=1\n print(r)\nmain()']
['Wrong Answer', 'Accepted']
['s399021498', 's616538413']
[35500.0, 32172.0]
[1055.0, 213.0]
[348, 328]
p02642
u810348111
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['N = int(input())\nA = list(map(int,input().split()))\nA.sort()\ncnt = 0\nonaji = 0\n\n\nfor i in range(len(A)):\n if i >= len(A)-1: \n break\n for j in range(len(A)-1,i,-1):\u3000\n if A[i] == A[j]:\n onaji = 1\n if A[j] % A[i] == 0:\n del A[j]\n \n if onaji == 1:\u3000\n del A[i]\n onaji = 0\n\nprint(len(A))\n', 'N = int(input())\nA = list(map(int,input().split()))\nOKlist = [0]*(10**6+100)\nA.sort()\nfor i in range(len(A)-1):\n if A[i] == A[i+1]:\n continue\n elif OKlist[A[i]] == 0:\n for j in range(1,10**6+10):\n if A[i]*j > 10**6:\n break\n else:\n OKlist[A[i]*j] += 1\n else:\n OKlist[A[i]] += 1\nOKlist[max(A)] += 1\ncnt = 0\nfor i in A:\n print(OKlist[i])\n if OKlist[i] == 1:\n cnt += 1\n \n \nprint(cnt)', 'N = int(input())\nA = list(map(int,input().split()))\nOKlist = [0]*(10**6+100)\nA.sort()\nfor i in range(len(A)-1):\n if A[i] == A[i+1] and OKlist[A[i]] == 0:\n OKlist[A[i]] += 2\n for j in range(1,10**6+10):\n if A[i]*j > 10**6:\n break\n else:\n OKlist[A[i]*j] += 1\n elif OKlist[A[i]] == 0:\n for j in range(1,10**6+10):\n if A[i]*j > 10**6:\n break\n else:\n OKlist[A[i]*j] += 1\n else:\n OKlist[A[i]] += 1\nOKlist[max(A)] += 1\ncnt = 0\nfor i in A:\n if OKlist[i] == 1:\n cnt += 1\n \n \nprint(cnt)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s107116971', 's656658336', 's807882679']
[9008.0, 33248.0, 32316.0]
[26.0, 902.0, 820.0]
[662, 488, 641]
p02642
u811436126
2,000
1,048,576
Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
['from collections import Counter\n\n\ndef make_divisors(n):\n lower_divisors, upper_divisors = [], []\n i = 1\n while i * i <= n:\n if n % i == 0:\n lower_divisors.append(i)\n if i != n // i:\n upper_divisors.append(n // i)\n i += 1\n return lower_divisors + upper_divisors[::-1]\n\n\nn = int(input())\na = list(map(int, input().split()))\n\n#c = Counter(a)\n#new = [key for key, val in c.most_common() if val == 1]\n\n\nans = 0\nfor i in a:\n val = set(a) & set(a)\n if len(val) == 1:\n ans += 1\n\nprint(ans)\n', 'from collections import Counter\n\n\ndef make_divisors(n):\n lower_divisors, upper_divisors = [], []\n i = 1\n while i * i <= n:\n if n % i == 0:\n lower_divisors.append(i)\n if i != n // i:\n upper_divisors.append(n // i)\n i += 1\n return lower_divisors + upper_divisors[::-1]\n\n\nn = int(input())\na = list(map(int, input().split()))\n\nc = Counter(a)\nnew = []\nfor key, val in c.most_common():\n if val == 1:\n new.append(key)\n\nans = 0\nfor i in new:\n div = make_divisors(i)\n if len(set(new) & set(div)) == 1:\n ans += 1åç\n\nprint(ans)\n', 'from collections import Counter\n\nn = int(input())\na = list(map(int, input().split()))\n\n# new = [key for key, val in Counter(a).most_common() if val == 1]\nprime = [1] * 1000010\n\nfor i in set(a):\n \n for j in range(i + i, 1000001, i):\n prime[j] = 0\n\nc = Counter(a)\nans = 0\nfor i in a:\n if prime[i] and c[i] == 1:\n ans += 1\nprint(ans)\n']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s583934948', 's926217730', 's480491345']
[59724.0, 9072.0, 47488.0]
[2207.0, 25.0, 1333.0]
[596, 605, 368]