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...
['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 ...
['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 =...
['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_...
['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...
['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 d...
['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...
['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)\ncoun...
['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(' ...
['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(...
['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 ...
['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 ...
['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 i...
['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(...
['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 ...
['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 +=...
['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 an...
['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 ...
['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 = [...
['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]*(...
['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 ...
['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]-...
['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...
['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 ...
['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...
['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(...
['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 pri...
['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...
['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()...
['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...
['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...
['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 - (le...
['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 ...
['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...
['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())\...
['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...
['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...
['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 retur...
['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.heap...
['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 ...
['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:\...
['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+...
['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 std...
['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 ...
['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.coun...
['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 enumer...
['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...
['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[...
['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 ran...
['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] =...
['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 #...
['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 ...
['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_l...
['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()]\n...
['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...
['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)\nm...
['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] =...
['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)\n...
['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...
['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...
['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]...
['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 ...
['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 continu...
['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...
['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 ...
['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)...
['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(m...
['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)'...
['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 +...
['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 =...
['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 co...
['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(an...
['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...
['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()...
['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\n...
['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 ...
['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...
['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...
['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...
['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\...
['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(m...
['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 ...
['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 e...
['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_l...
['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 ...
['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 imp...
['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...
['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 ...
['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...
['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 ...
['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...
['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...
['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 ...
['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 ...
['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 no...
['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()\nA...
['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...
['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 ...
['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...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s583934948', 's926217730', 's480491345']
[59724.0, 9072.0, 47488.0]
[2207.0, 25.0, 1333.0]
[596, 605, 368]