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
u815559330
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()))\nkey=max(A)+1 \nB=[0]*key \nfor a in A:\n for b in range(a,key,a):\n B[b]+=1 \nans=0\nfor a in A:\n if B[a]==1: \n ans+=1\nprint(ans)', 'N=int(input())\nA=list(map(int,input().split()))\nkey=max(A)+1 \nB=[0]*key \nfor a in A:\n for b in range(a,key,a):\n...
['Runtime Error', 'Accepted']
['s434711021', 's055607225']
[9032.0, 32380.0]
[27.0, 514.0]
[361, 369]
p02642
u821989875
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()]\na.sort()\ncnt = 0\n\ns = [a[0]]\nfor i in range(1, n):\n s.append(a[i] * s[i-1])\n\nfor i in range(n):\n if i == 0:\n if a[i] != a[i+1]:\n cnt += 1\n continue\n if i != n-1:\n if a[i] % s[i-1] != 0 and a[i+1] != a[i]:\n cnt += 1\n if i == n...
['Runtime Error', 'Accepted']
['s315120630', 's049155038']
[9064.0, 52652.0]
[26.0, 1973.0]
[359, 302]
p02642
u825378567
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 main1():\n N=int(input())\n A=list(map(int,input().split()))\n A.sort()\n ans=[0]*(10**6)\n for i in range(len(A)-1):\n if ans[i]>=2:\n continue\n if A[i]!=A[i+1]:\n ans[i]+=1\n for j in range(A[i]*2,10**6,A[i]):\n ans[j]=2\n print(ans.c...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s081864902', 's617755434', 's582225939']
[32380.0, 24600.0, 32240.0]
[230.0, 39.0, 208.0]
[323, 316, 332]
p02642
u826785572
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\nM = 1000005\ncnt = [0] * M\n\nfor i in range(n):\n if cnt[i] != 0:\n cnt[i] = 2\n continue\n for j in range(a[i], M, a[i]+1):\n cnt[j] += 1\n\nans = 0\n\nfor i in range(n):\n if cnt[a[i]] == 1:\n ans += 1\n\nprint(ans)', 'n ...
['Wrong Answer', 'Accepted']
['s086187674', 's715382493']
[32048.0, 32164.0]
[2206.0, 411.0]
[293, 307]
p02642
u830054172
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 = sorted(list(map(int, input().split())))\n\nif len(set(A)) == 1:\n print(0)\nelse:\n ju = [True for _ in range(N)]\n\n for i in range(N-1):\n n = i+1\n if not ju[n] or not ju[i]:\n continue\n if A[i] > math.sqrt(A[-1]):\n brea...
['Wrong Answer', 'Accepted']
['s631096001', 's339402662']
[33108.0, 32252.0]
[2206.0, 496.0]
[499, 229]
p02642
u836311327
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()', "def main():\n \n\n n = int(input())\n a = list(map(int, input().split()))\n a.sort()\n count = 0\n while a != []:\n t = a[0]\n if len(a) == 1:\n count +=1\n elif a[0] != a[1]:\n count +=1\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s172727799', 's522983735', 's528257183']
[32180.0, 32192.0, 32244.0]
[97.0, 2206.0, 289.0]
[61, 358, 480]
p02642
u840773955
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.
['M = 10 ** 6 + 5\nN = int(input())\nA_ref = list(map(int, input().split()))\nA = set(M)\nfor i in A_ref:\n A.add(i)\ncnt = [0] * M\nfor i in A:\n for j in range(0, M, i):\n cnt[j] += 1\nans = 0\nfor i in A:\n if(cnt[i] == 1):\n ans += 1\nprint(ans)', 'M = 10 ** 6 + 5\nN = int(input())\nA_ref = l...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s290401808', 's411743147', 's604315824']
[32228.0, 39352.0, 32372.0]
[68.0, 621.0, 878.0]
[256, 301, 251]
p02642
u840920983
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(x) for x in input().split()]\na.sort()\nmax=a[-1]\ndp=[False for _ in range(max+1)]\n\nfor i in a:\n if dp[i]==False:\n for j in range(2,max+1):\n if i*j>max:\n break\n dp[i*j]=True\nfor i in a:\n if a.count(i)>1:\n dp[i]=True\ncnt=0\nfor...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s087184498', 's363557471', 's538184102', 's371603447']
[32116.0, 32172.0, 32184.0, 32132.0]
[2206.0, 2206.0, 134.0, 583.0]
[353, 367, 102, 390]
p02642
u842964692
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\nC=Counter(A)\n\nA=set(A)\n\nMAX_A=10**6\n\nX=[0]*(MAX_A+1)\n\nfor a in A:\n for i in range(a,MAX_A+1,a):\n X[i]+=1\n\nans=len([a for a in A if (X[1]==1) and (C[a]==1)])\n\nprint(ans)', 'from collections import Counter\n\nN...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s193627289', 's267004784', 's187726252']
[8964.0, 50952.0, 51080.0]
[27.0, 1730.0, 1594.0]
[259, 260, 286]
p02642
u844123804
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.
['num = int(input())\narr = input().split()\narr = [int(i) for i in arr]\n\narr = sorted(arr, reverse=True)\n\ncnt = 0\n\nfor i in range(num):\n flg=0\n for j in range(i+1, num):\n print(arr[i], arr[j])\n if arr[i]%arr[j]==0:\n flg=1\n break\n if flg==1: cnt += 1\n \nprint(cnt)', 'num = int(input(...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s381978197', 's477917075', 's769056728', 's905740406']
[48556.0, 32024.0, 32196.0, 34556.0]
[2662.0, 2206.0, 2206.0, 507.0]
[281, 257, 263, 250]
p02642
u844895214
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\nfrom numba import njit\n\n@njit(cache+True)\ndef solve(a,n):\n ava = [0]*a[-1]\n for i in range(n):\n for j in range(n):\n if a[j]%a[i]==0 and ava[a[j]-1]<2:\n ava[a[j]-1] += 1\n return ava.count(1)\n \nif __name__=='__main__':\n n = int(sys.stdin.readline().rs...
['Runtime Error', 'Runtime Error', 'Accepted']
['s550524971', 's681837647', 's116343526']
[91892.0, 32160.0, 32116.0]
[393.0, 303.0, 289.0]
[408, 428, 428]
p02642
u845573105
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 math import sqrt\n\nN = int(input())\nA = list(map(int, input().split()))\nA.sort()\n#print(A)\nans = []\nres = []\nnans = 0\ndoubling = 0\ni = 0\nwhile i < N:\n a = A[i]\n sqa = sqrt(a)\n #print(i,a)\n if i == 0:\n flag = False\n while i + 1 < N:\n bufa = A[i+1]\n if bufa == a:\n i +=...
['Wrong Answer', 'Accepted']
['s303227308', 's481015641']
[32372.0, 32176.0]
[2206.0, 338.0]
[1452, 316]
p02642
u846226907
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(map(int,input().split()))\n\n\nb = sorted(list(A))\ndp = [0]*(max(A)+4)\n\nm_a = max(A)\nfor i in b:\n dp[i] += 1\n if dp[i]==1 :\n for j in range(i*2, m_a,i):\n dp[j] +=100\n\nprint(dp.count(1))', 'N = int(input())\n\nA = list(map(int,input().split()))\n\n\nb = so...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s169252025', 's935383262', 's240554530']
[41296.0, 32240.0, 40252.0]
[585.0, 280.0, 698.0]
[233, 235, 231]
p02642
u854405453
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.
['_,*p=map(int,open(0).read().split())\ni=0\np.sort()\nwhile(len(p)!=0):\n t=p[0]\n p=[m if m!=t else 0 for m in p[1:] if m%t!=0 or m==t ]\n if 0 in p:\n p=[i for i in p if i!=0]\n else:i+=1\nprint(len(q))', '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:\...
['Runtime Error', 'Accepted']
['s164001279', 's887534977']
[33204.0, 33036.0]
[2206.0, 384.0]
[201, 153]
p02642
u858742833
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 njit, int32, int64\nfrom numba.typed import Dict\n\n@njit\ndef solve(B):\n A = Dict.empty(\n key_type=int64,\n value_type=int64)\n for b in B:\n A[b] = A.get(b, 0) + 1\n r = 0\n for a, v in A.items():\n if v > 1:\n continue\n if 1 in A:\n ...
['Wrong Answer', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s219052859', 's267644619', 's801053286', 's868558118', 's917945460', 's830530079']
[140688.0, 140444.0, 140520.0, 141216.0, 140656.0, 39420.0]
[1931.0, 2017.0, 2209.0, 2202.0, 2106.0, 195.0]
[670, 681, 706, 706, 706, 344]
p02642
u867200256
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 collections\nimport sys\nimport math\nimport copy\nimport collections\n\n\ndef I(): return int(sys.stdin.readline().rstrip())\ndef LI(): return list(map(int, sys.stdin.readline().rstrip().split()))\ndef S(): return sys.stdin.readline().rstrip()\ndef LS(): return list(sys.stdin.readline().rstrip().split())\n\...
['Wrong Answer', 'Accepted']
['s480365788', 's001526519']
[46056.0, 32852.0]
[163.0, 320.0]
[884, 771]
p02642
u867408000
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())\noriginal_ary = sorted(list(map(int, input().split())))\n\nbool_ary = [0] * original_ary[-1]\n\nfor num in original_ary:\n bool_ary[num-1] += 1\n if bool_ary[num-1] == 1:\n for multiple in range(num * 2, original_ary[-1], num):\n bool_ary[multiple-1] = 2\n\nprint(bool_ary.coun...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s620179306', 's800705539', 's028375184']
[32232.0, 32232.0, 32204.0]
[387.0, 2206.0, 378.0]
[312, 510, 315]
p02642
u879921371
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 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 r+=1\n if tf[n] ==False:\n r+=1\n print(r)\n...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s524703701', 's643715144', 's136041388']
[32168.0, 42720.0, 32376.0]
[207.0, 317.0, 194.0]
[307, 328, 328]
p02642
u880480312
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>\nn = int(input())\na = list(map(int,input().split()))\nc=a\nans=0\nb=0\nfor i in range(n):\n b=a[i]\n a=set(a)\n a=[b%x for x in a]\n if a.count(0) > 1:\n ans+=1\n a=c\nprint(ans)', 'n = int(input())\nA = list(map(int,input().split()))\nd = {}\nfor a in A:\n d.setdefault(a,0)\n d[a] +...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s475906110', 's803988104', 's036621629']
[39772.0, 44216.0, 44216.0]
[2206.0, 1638.0, 1587.0]
[193, 647, 639]
p02642
u884323674
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\nN = int(input())\nA = sorted([int(i) for i in input().split()])\na = collections.Counter(A)\nA = np.array([i[0] for i in a.items() if i[1] == 1])\n\nif len(A) == 0:\n print(0)\nelse:\n dp = np.array([True for i in range(A[-1])])\n dp[:A[0]-1] = False\n ans = 0\n for i in range(A[-...
['Runtime Error', 'Runtime Error', 'Accepted']
['s087712632', 's447775255', 's432120878']
[51560.0, 35920.0, 50728.0]
[195.0, 2019.0, 1320.0]
[508, 343, 311]
p02642
u886297662
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.sort()\ncnt = [0] * (A[-1]+1)\n\nfor a in A:\n cnt[::a] += 1\n\nans = 0\nfor a in A:\n if cnt[a] == 1:\n ans += 1\n\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\n\nA.sort()\ncnt = [0] * (A[-1]+1)\n\nfor a in A:\n for i in range(a...
['Runtime Error', 'Accepted']
['s297637413', 's511438696']
[32272.0, 32308.0]
[108.0, 423.0]
[177, 210]
p02642
u896451538
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()\nm = a[-1]\nl = [True]*(m+1)\n\nans=0\na.sort()\nfor i in range(n):\n if l[a[i]]:\n for j in range(i,m,a[i]):\n l[j]=False\n if i==n-1:\n ans+=1\n break\n if a[i]!=a[i+1]:\n ans+=1\nprint...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s349507700', 's766745297', 's402083975']
[32384.0, 32176.0, 32380.0]
[338.0, 255.0, 284.0]
[306, 308, 263]
p02642
u896726004
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(A, key=lambda x: x[0])\nmaxi = 2*(10**5)+1\ndp = [0] * maxi\n\nfor i in range(N):\n tmp = A[i]\n if dp[tmp] != 0:\n dp[tmp] = 2\n continue\n else:\n for j in range(tmp, maxi, tmp):\n dp[j] += 1\n\nans = 0\nfor...
['Runtime Error', 'Accepted']
['s145622159', 's420129588']
[32028.0, 32188.0]
[70.0, 438.0]
[381, 357]
p02642
u902544771
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()\ndp = [True for i in range(a[-1]+1)]\ncount=0\n\nfor i in range(n):\n if dp[a[i]]:\n count+=1\n for j in range(1,n-i):\n if a[i]!=a[i+j]:\n break\n elif j==1:\n count-=1\n ...
['Wrong Answer', 'Accepted']
['s043271834', 's921454482']
[32180.0, 32060.0]
[371.0, 524.0]
[593, 234]
p02642
u909514237
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())\nAList = list(map(int, input().split()))\nif AList.count(AList[0]) == N:\n print(0)\n exit()\n \nsortList = list(sorted(set(AList)))\nAmax = max(sortList)\ndp = [True] * (Amax+1)\n\nidx = 0\nfor n in sortList:\n if dp[n] == True:\n for j in range(n*2, Amax, n):\n dp[j] = False\nansCount =...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s477166944', 's795404689', 's265504346']
[32524.0, 32568.0, 32028.0]
[319.0, 687.0, 446.0]
[378, 401, 246]
p02642
u919017918
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\nN = int(input())\nA = list(map(int, input().split()))\nA.sort()\nmaxA = A[-1]+1\n#print(N, A, maxA)\ndp = [1 for a in range(maxA)]\n#print(dp)\nfor a in range(maxA):\n if a in A and dp[a] == 1:\n tgt = math.sqrt(maxA)\n b = 2\n while b*a < maxA:\n dp[a*b] = 0\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s144695685', 's847221818', 's959504413']
[58528.0, 46400.0, 44672.0]
[2271.0, 1397.0, 607.0]
[414, 507, 508]
p02642
u930574673
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 math import ceil\n\nX, N = [int(x) for x in input().split()]\nl = [int(x) for x in input().split()]\nl2 = [abs(int(x)-X) for x in l]\nl2.sort()\nfor i in range(N):\n if ceil(i/2) != l2[i]:\n t = ceil(i/2)\n break\nif X - t in l:\n print(X + t)\nelse:\n print(X - t)', 'N = int(input())\nl =...
['Runtime Error', 'Accepted']
['s441101276', 's042305009']
[9208.0, 32328.0]
[24.0, 701.0]
[280, 304]
p02642
u946346344
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\ndef input():\n return sys.stdin.readline().strip()\n\ndef main():\n x, n= map(int, input().split())\n if n == 0:\n print(x)\n return\n P=[]\n P = list(map(int, input().split()))\n \n for i in range(100):\n a = x-i\n b = x+i\n if a not in P:\n ...
['Runtime Error', 'Accepted']
['s533376990', 's425197308']
[9204.0, 32384.0]
[24.0, 366.0]
[415, 384]
p02642
u950825280
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 = list(set(a))\na.sort()\nans = 0\nif len(a) == 1:\n print(0)\nelse:\n for _ in range(n):\n m = a.pop()\n ind = True\n print(a)\n for i in a:\n if m % i == 0:\n ind = False\n break\n ...
['Runtime Error', 'Accepted']
['s360580464', 's344320506']
[143660.0, 31948.0]
[2393.0, 639.0]
[350, 221]
p02642
u956433805
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(A, reverse = True)\nans = 0\n\nif A.count(A[-1]) != 0:\n ans = -1 \n\nfor i in range(N):\n flag = 0\n a = i\n for j in range(a,N):\n if i == j:\n continue\n if A[i] % A[j] == 0:\n flag = 1\n b...
['Wrong Answer', 'Accepted']
['s670204121', 's443766461']
[32300.0, 103016.0]
[2206.0, 775.0]
[430, 681]
p02642
u959682820
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 = 1000005\ncnt = [0] * MAX\nfor x in a:\n if cnt[x] != 0:\n continue\n \n for i in range(x, MAX, x):\n cnt[i] += 1\nans = 0\nfor x in a:\n if cnt[x] == 1:\n ans += 1\n\nprint(ans)', 'n = int(input())\na = list(map(int, input...
['Wrong Answer', 'Accepted']
['s192284159', 's384135331']
[32404.0, 31896.0]
[496.0, 596.0]
[296, 315]
p02642
u966207392
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\nres = []\n\nfor i in range(N):\n for j in range(N):\n if j == i:\n continue\n elif (A[i] % A[j]) == 0:\n res.append(A[j])\n break\n \n else:\n if len(res) == 0:\n count += 1\...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s148690984', 's354540902', 's362216052', 's385254913', 's931258913', 's459906208']
[32248.0, 32256.0, 32056.0, 32380.0, 8964.0, 32232.0]
[2206.0, 505.0, 2206.0, 2206.0, 26.0, 534.0]
[354, 247, 268, 389, 267, 267]
p02642
u966542724
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\n\nl = [0] * max(a)\n\n\nfor i in a:\n\n c = 2\n while True:\n if i*c-1 >= max(a):\n break\n l[i*c - 1] += 1\n c += 1\n\n\n\nans = 0\n\nfor i in set(a):\n if l[i] == 1:\n ans += 1\n\nprint(ans)\n', 'n = int(input...
['Runtime Error', 'Accepted']
['s577557095', 's129205626']
[31972.0, 39372.0]
[2206.0, 887.0]
[276, 295]
p02642
u970133396
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\nfrom numba import jit\n\nn = int(input().strip())\nL = list(map(int, input().strip().split()))\nseen = Counter()\nans=0\n\nfor x in L:\n seen[x]+=1\n@jit\ndef loop():\n ans=0\n for x in L:\n if seen[x]>1 or x!=1 and 1 in seen:\n continue\n \n tmp=2...
['Wrong Answer', 'Time Limit Exceeded', 'Accepted']
['s759183081', 's934305518', 's317723679']
[161628.0, 161432.0, 32260.0]
[2210.0, 2210.0, 410.0]
[486, 644, 517]
p02642
u970308980
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 is_prime(n):\n if n == 1:\n return False\n for i in range(2,int(n**0.5)+1):\n if n % i == 0:\n return False\n return True\n\n\nN = int(input())\nA = list(map(int, input().split()))\n\nD = defaultdict(int)\nfor a in A:\n D[a] += 1\n\nL = []\nfor k, v in D.items():\n if v >...
['Runtime Error', 'Accepted']
['s429731096', 's498737255']
[32400.0, 82716.0]
[66.0, 974.0]
[619, 629]
p02642
u971124021
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.sort()\ndp = [1] * n\n\ndef div(k):\n global dp\n if dp[k] != 0:\n for i in range(k):\n if a[k]%a[i] == 0:\n dp[k] = 0\n if a[k] == a[i]:dp[i] = 0\n break\n if k < n-1:div(k+1)\n\ndiv(1)', 'n = int(input())\na= list(map(int,inp...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s148195195', 's188226943', 's614970750', 's709789178', 's748007723', 's950725987', 's754385339']
[32368.0, 31988.0, 32340.0, 32192.0, 32168.0, 43380.0, 45052.0]
[155.0, 114.0, 108.0, 107.0, 109.0, 191.0, 1818.0]
[261, 174, 126, 126, 254, 354, 328]
p02642
u971531055
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_i = list(map(int,input().split()))\n\ndef solve():\n ans = 0\n count = 0\n for i in range(1, 1000001):\n if i in a_i:\n for j in range(n):\n if i != a_i[j] and i % a_i[j] == 0:\n break\n else:\n ans += 1\n ...
['Wrong Answer', 'Accepted']
['s793542744', 's812704873']
[32176.0, 32232.0]
[2206.0, 622.0]
[389, 458]
p02642
u978167553
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(stdins) for stdins in input().split()]\n\na.sort()\n\nans = n\nfor i in range(n):\n for j in range(n):\n if a[i] % a[j] == 0:\n ans -= 1\n break\n\nprint(ans)\n', '# ABC170\n\nn = int(input())\na = list(map(int, input().split()))\n\na.sort()\na_max = max(a)\n...
['Wrong Answer', 'Accepted']
['s019052178', 's051940009']
[32164.0, 32368.0]
[2206.0, 377.0]
[206, 416]
p02642
u978531093
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\n\ndef main():\n _ = int(input())\n A = list(map(int, input().split()))\n\n A.sort()\n\n sames = 0\n C = collections.Counter(A)\n for v in C.values():\n if v > 1:\n sames += 1\n\n a_max = A[-1]\n dp = [True] * a_max\n A = set(A)\n\n for a in A:\n ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s353339611', 's376019726', 's892882505']
[51196.0, 50908.0, 32120.0]
[331.0, 201.0, 415.0]
[571, 542, 423]
p02642
u981309686
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\ninp = list(map(int,input().split()))\nc=Counter(inp)\ninp=[]\nfor item in c.keys():\n if c[item]==1:\n inp.append(item)\narr=[1]*len(inp)\ninp.sort()\nans=0\nfor i in range(len(inp)):\n if arr[i]==0:\n continue\n else:\n ans+=1\n \tfor j in range(i+1,len(inp)):\n if...
['Runtime Error', 'Accepted']
['s828990048', 's698471618']
[8972.0, 61712.0]
[26.0, 1057.0]
[348, 442]
p02642
u984592063
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\na = int(input())\nA = list(map(int, input().split()))\n\n\n# A_set = list(set(A))\n# if len(A_set) == 1:\n# print(0)\n# else:\n# A_count = Counter(A)\n\n# for j in range(len(A_set)):\n# if(A_set[i]%A_set[j] == 0):\n# A_set[i] = A_set[j]\n# ...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s029089929', 's280387254', 's414308439', 's552290723', 's900782340', 's964546993', 's997681384', 's170949913']
[34120.0, 32220.0, 9252.0, 32292.0, 32340.0, 32152.0, 32332.0, 32380.0]
[97.0, 140.0, 26.0, 133.0, 177.0, 143.0, 2206.0, 301.0]
[477, 441, 32, 441, 441, 466, 431, 349]
p02642
u994985556
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.
['# MAX = int(1e6)+2\n\n\nn = int(input())\nlis = list(map(int,input().split()))\nlis.sort()\nMAX = lis[-1]\nlis2 = [0]*MAX\n# lis.sort()\n# m = max(lis)\nans = 0\n\nfor num in lis:\n for i in range(num, MAX, num):\n lis2[i] += 1\n\nfor j in set(lis):\n if lis2[j] == 1:\n ans += 1\nprint(ans)', ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s456299431', 's826472890', 's646155651']
[39488.0, 32080.0, 39384.0]
[487.0, 145.0, 463.0]
[296, 309, 302]
p02642
u997641430
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())\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 tmp = 2\n while a * tmp <= maxA:\n D[a * tmp] = 1\n tmp += 1\nans = 0\nfor a in A:\n if C[a] == 1 and D[a] == 0:\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s576452872', 's996524339', 's718985336']
[49600.0, 108824.0, 104020.0]
[163.0, 1220.0, 1244.0]
[406, 441, 420]
p02644
u021548497
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
['import sys\nfrom heapq import *\ninput = sys.stdin.readline\n\n\ndef main():\n h, w, k = map(int, input().split())\n sx, sy, gx, gy = map(int, input().split())\n pond = [input().replace("\\n", "") for _ in range(h)]\n \n dist_N = [[None]*w for _ in range(h)]\n dist_S = [[None]*w for _ in range(h)]\n...
['Wrong Answer', 'Accepted']
['s485492697', 's398596047']
[309984.0, 45388.0]
[3316.0, 1693.0]
[3247, 1970]
p02644
u021916304
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
["def ii():return int(input())\ndef iim():return map(int,input().split())\ndef iil():return list(map(int,input().split()))\nfrom collections import deque\n\n\ndef bfs(xg,yg):\n queue = deque([(xs,ys,0)])\n while queue:\n x,y,dep = queue.popleft()\n l = []\n for xx,yy in [(1,0),(0,1),(-1,0),(0...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s201534983', 's723402031', 's751243285', 's451729703']
[32724.0, 32748.0, 32608.0, 51072.0]
[93.0, 760.0, 2889.0, 1787.0]
[970, 1592, 1463, 999]
p02644
u070201429
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
["from sys import stdin\ndef input():\n return stdin.readline().strip()\n\nimport heapq\n\ndef main():\n h, w, k = map(int, input().split())\n x1, y1, x2, y2 = map(int, input().split())\n\n # surround the square with '@'\n c = [['@'] * (w+2)]\n for _ in range(h):\n i = list('@' + input() + '@')...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s027947588', 's127722118', 's180645654', 's748352988', 's755183408', 's877599086', 's676047109']
[75808.0, 91636.0, 75508.0, 75488.0, 75592.0, 75520.0, 77536.0]
[2261.0, 2370.0, 2260.0, 2253.0, 2239.0, 2299.0, 2121.0]
[1674, 1605, 1674, 1557, 1553, 1555, 1698]
p02644
u094102716
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
['from collections import deque\nh,w,k = map(int,input().split())\na,b,c,d = map(int,input().split())\na -= 1\nb -= 1\nc -= 1\nd -= 1\nmaze = [input() for _ in range(h)]\ndx = [1, -1, 0, 0]\ndy = [0, 0, 1, -1]\ndepth = [[float("inf") for _ in range(w)] for _ in range(h)]\ndq = deque([(b,a)])\ndepth[a][b] = 0\nwhile dq:...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s308865955', 's456566560', 's623899013', 's658083612', 's362508016']
[50340.0, 50264.0, 9032.0, 50320.0, 55104.0]
[183.0, 199.0, 25.0, 189.0, 2669.0]
[832, 768, 765, 770, 851]
p02644
u113971909
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
["#!/usr/bin python3\n# -*- coding: utf-8 -*-\n\nH, W, K = map(int,input().split())\nsth,stw,glh, glw = map(int,input().split())\nsth, stw = sth-1, stw-1\nglh, glw = glh-1, glw-1\n\nINF = -1\nGmap = [list(input()) for _ in range(H)]\nDist = [[INF]*W for _ in range(H)]\ndirec = {(1,0), (-1,0), (0,1), (0,-1)}\ninit_q =[]...
['Wrong Answer', 'Accepted']
['s220596699', 's423461782']
[40772.0, 43196.0]
[1793.0, 1750.0]
[1247, 1161]
p02644
u135454978
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
['from collections import deque\nimport sys\n\n\ndef bfs(xs, ys, d):\n queue = deque((xs, ys, d))\n M[xs][ys] = d\n while queue:\n \n x1, y1, d = queue.popleft() \n if [x1, y1] == [xg, yg]: \n return\n\n for dx, dy in ((1, 0), (-1, 0), (0, 1), (0, -1)):\n for...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s011291086', 's081399088', 's173910543', 's515654207', 's573739878', 's666256463', 's831549140', 's879194907', 's324130042']
[26448.0, 604736.0, 27028.0, 29248.0, 26376.0, 45308.0, 26564.0, 26524.0, 45304.0]
[134.0, 3327.0, 3309.0, 1389.0, 137.0, 1890.0, 3309.0, 128.0, 1844.0]
[1404, 1242, 1503, 1105, 1569, 1098, 1498, 1569, 1348]
p02644
u221301671
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
["h, w, k = map(int, input().split())\nx1, y1, x2, y2 = map(int, input().split())\nx1, y1, x2, y2 = x1-1, y1-1, x2-1, y2-1\n\nxxx = set()\nfor hh in range(h):\n c = input()\n for ww, cc in enumerate(c):\n if cc == '@':\n xxx.add((hh, ww))\n\nfrom heapq import heappush, heappop\nq = []\nheappush(...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s351772629', 's596142768', 's478198915']
[113392.0, 542464.0, 49596.0]
[3313.0, 3325.0, 1740.0]
[1684, 1301, 1556]
p02644
u266014018
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
["from heapq import heappop, heappush \ndef dijkstra(xs, ys, xg, yg,h,w,k,field):\n \n que = [(0, xs, ys)]\n inf = 10 ** 6\n dp = [[inf for _ in range(w+1)] for _ in range(h+1)]\n visited = [[False for _ in range(w+1)] for _ in range(h+1)]\n dp[xs][ys] = 0\n dx = [-1,0,1,0]\n dy = [0,1,0,-1]\n ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s021292358', 's401194929', 's599899235', 's940299883', 's362759898']
[8936.0, 10776.0, 9108.0, 79220.0, 82624.0]
[26.0, 27.0, 25.0, 222.0, 1842.0]
[1474, 855, 1711, 1475, 1423]
p02644
u340781749
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
["from heapq import heappop, heappush\n\nimport numpy as np\n\nfrom numba import njit\n\n\n@njit('UniTuple(i8[:],4)(i1[:],i8,i8,i8)', cache=True)\ndef reachable(field, h2, w2, k):\n \n hw = h2 * w2\n up = np.full(hw, -1, dtype=np.int64)\n dw = np.full(hw, -1, dtype=np.int64)\n lf = np.full(hw, -1, dtype=...
['Wrong Answer', 'Accepted']
['s240087011', 's004190869']
[574344.0, 294956.0]
[3458.0, 2566.0]
[2795, 1104]
p02644
u477977638
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
['import sys\nread = sys.stdin.buffer.read\ninput = sys.stdin.readline\n\n\n\n\n#from functools import lru_cache\n\ndef RD(): return sys.stdin.read()\ndef II(): return int(input())\ndef MI(): return map(int,input().split())\ndef MF(): return map(float,input().split())\ndef LI(): return list(map(int,input().split()))\nd...
['Runtime Error', 'Accepted']
['s027289983', 's656981160']
[59056.0, 59108.0]
[1380.0, 1936.0]
[1911, 1196]
p02644
u543954314
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
["import sys\nfrom collections import deque\n\nreadline = sys.stdin.readline\nreadall = sys.stdin.read\nns = lambda: readline().rstrip()\nni = lambda: int(readline().rstrip())\nnm = lambda: map(int, readline().split())\nnl = lambda: list(map(int, readline().split()))\n\n\ndef solve():\n h, w, k = nm()\n sy, sx, g...
['Runtime Error', 'Accepted']
['s117782244', 's384450699']
[3417240.0, 36768.0]
[3415.0, 1578.0]
[1080, 1156]
p02644
u726285999
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
['from collections import deque\nimport math\nimport sys\n\nN_MAX = 200000 + 5\nsys.setrecursionlimit(N_MAX)\n\nH, W, K = map(int, sys.stdin.readline().split())\nx1, y1, x2, y2 = map(int, sys.stdin.readline().split())\nINF = 10**6 * K\n\ndp = [[INF for _ in range(W+2)] for _ in range(H+2)]\n\ndp[0] = [-1]*(W+2)\ndp[H+1...
['Runtime Error', 'Runtime Error', 'Accepted']
['s482261093', 's824587550', 's619001836']
[40560.0, 53104.0, 53372.0]
[291.0, 2155.0, 2137.0]
[1468, 1571, 1571]
p02644
u729133443
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
["h,a,*m=open(0)\nh,w,k,a,b,f,g=map(int,(h+a).split())\nd=[I:=9**9]*h*w\nd[~w+a*w+b]=1\nq=[(a-1,b-1)]\nfor s,t in q:\n p=d[s*w+t]+1\n for y,x in(-1,0),(0,-1),(0,1),(1,0):\n for z in range(k):\n if(h>(i:=s+y*~z)>-1<(j:=t+x*~z)<w)-1or'.'<m[i][j]or d[i*w+j]<=p:break\n q+=(i,j),;d[i*w+j]=p\nprint(d[~w+f*w+g]%I-1)", "h...
['Wrong Answer', 'Accepted']
['s679528022', 's472612767']
[117980.0, 66284.0]
[2897.0, 2743.0]
[302, 293]
p02644
u748241164
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
['from collections import deque\ndef bfs(maze, visited, sy, sx, gy, gx):\n queue = deque([[sy, sx]])\n visited[sy][sx] = 0\n while queue:\n \n y, x = queue.popleft()\n if [y, x] == [gy, gx]:\n print(visited[y][x])\n quit()\n return visited[y][x]\n for ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s065946282', 's806151328', 's839969151', 's978841911', 's456847901']
[31028.0, 36616.0, 36512.0, 36676.0, 36548.0]
[1693.0, 1487.0, 1396.0, 1451.0, 1663.0]
[1526, 1583, 1479, 1582, 1521]
p02644
u809108154
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
["\ndef main():\n h, w, k = map(int, input().split())\n x1, y1, x2, y2 = map(int, input().split())\n \n # surround the square with '@'\n c = [['@'] * (w+2)]\n for _ in range(h):\n i = input()\n l = ['@']\n for j in i:\n l.append(j)\n l.append('@')\n c.append(...
['Runtime Error', 'Accepted']
['s270137433', 's032531210']
[58772.0, 36392.0]
[130.0, 1587.0]
[1622, 1093]
p02644
u839509562
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
['import sys\nfrom collections import deque\n\ninput = sys.stdin.readline\n\n\ndef log(*args):\n print(*args, file=sys.stderr)\n\n\ndef main():\n h, w, k = map(int, input().strip().split())\n x1, y1, x2, y2 = map(int, input().strip().split())\n x1 -= 1\n y1 -= 1\n x2 -= 1\n y2 -= 1\n m = []\n ...
['Wrong Answer', 'Accepted']
['s183499078', 's472803954']
[109804.0, 51328.0]
[3312.0, 1912.0]
[1132, 2043]
p02644
u947883560
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
['#!/usr/bin/env python3\nimport sys\ndef input(): return sys.stdin.readline().strip()\ndef INT(): return int(input())\ndef MAP(): return map(int, input().split())\ndef LIST(): return list(map(int, input().split()))\ndef ZIP(n): return [LIST() for _ in range(n)]\n\n@profile\ndef main():\n from heapq import heappush,...
['Runtime Error', 'Accepted']
['s855185650', 's653801341']
[9056.0, 32644.0]
[30.0, 2823.0]
[1840, 1831]
p02644
u971124021
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
["from collections import deque\nh,w,k = list(map(int, input().split()))\nx1,y1,x2,y2 = list(map(int, input().split()))\nx1,y1,x2,y2 = x1-1,y1-1,x2-1,y2-1\nc = [[]*w for _ in range(h)]\ndp = [[0]*w for _ in range(h)]\nque = deque()\nfor i in range(h):\n for j,s in enumerate(input()):\n c[i].append(s)\n if s != '...
['Wrong Answer', 'Accepted']
['s702408454', 's562407516']
[45124.0, 36476.0]
[2145.0, 2855.0]
[960, 885]
p02644
u989345508
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
["h,a,*m=open(0)\nh,w,k,a,b,f,g=map(int,(h+a).split())\nd=[I:=h*w]*I\nm+=d,\nq=[a:=~w+a*w+b]\nd[a]=1\nfor s in q:\n for y,x in(1,0),(-1,0),(0,1),(0,-1):\n for z in range(k):\n i,j=s//w+y*~z,s%w+x*~z;t=i*w+j;p=d[s]+1\n if'.'<m[i][j]or d[t]<p:break\n if d[t]>p:q+=t,;d[t]=p\nprint(d[~w+f*w+g]%I-1)", "h,a,*m=open(0)...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s172681252', 's190095940', 's200105848', 's495549442', 's783831769']
[25080.0, 17764.0, 17880.0, 66300.0, 36464.0]
[876.0, 39.0, 43.0, 3309.0, 2637.0]
[288, 288, 288, 304, 461]
p02644
u994935583
3,000
1,048,576
Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i-th row from the north and j-th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. The square (i,j) has a lotus leaf on i...
["def resolve():\n H,W,K = map(int,input().split())\n ys, xs, yg, xg = map(int,input().split())\n\n board = [['@']*(W+2)]\n for i in range(H):\n board.append(['@'] + list(input())+['@'])\n board.append(['@']*(W+2))\n board[ys][xs] = '#'\n\n queue = deque([(xs,ys,0)])\n while queue:\n ...
['Runtime Error', 'Accepted']
['s881221523', 's178085254']
[32384.0, 51080.0]
[76.0, 1073.0]
[1619, 1650]
p02651
u021548497
2,000
1,048,576
There are two persons, numbered 0 and 1, and a variable x whose initial value is 0. The two persons now play a game. The game is played in N rounds. The following should be done in the i-th round (1 \leq i \leq N): * Person S_i does one of the following: * Replace x with x \oplus A_i, where \oplus represents bit...
['import sys\ninput = sys.stdin.readline\n\nclass BaseXor:\n def __init__(self):\n self.size = 0\n self.base = []\n \n def base_calculate(self, x, b):\n return min(x, x ^ b)\n\n def make_base(self, x):\n for b in self.base:\n x = self.base_calculate(x, b)\n retu...
['Wrong Answer', 'Accepted']
['s183699829', 's163258432']
[9136.0, 9028.0]
[106.0, 197.0]
[1415, 1486]
p02651
u093041722
2,000
1,048,576
There are two persons, numbered 0 and 1, and a variable x whose initial value is 0. The two persons now play a game. The game is played in N rounds. The following should be done in the i-th round (1 \leq i \leq N): * Person S_i does one of the following: * Replace x with x \oplus A_i, where \oplus represents bit...
["T = int(input())\nfor i in range(T):\n N = int(input())\n A = list(map(int, input().split()))\n S = input()\n base = set([0])\n for i in range(1,N+1):\n temp = A[-i]\n for x in base:\n temp = min(temp,temp^x)\n if temp != 0:\n if S[-i] == '1':\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s372903130', 's759527124', 's037735129']
[9152.0, 8980.0, 9160.0]
[61.0, 59.0, 150.0]
[417, 414, 414]
p02651
u193582576
2,000
1,048,576
There are two persons, numbered 0 and 1, and a variable x whose initial value is 0. The two persons now play a game. The game is played in N rounds. The following should be done in the i-th round (1 \leq i \leq N): * Person S_i does one of the following: * Replace x with x \oplus A_i, where \oplus represents bit...
['def solve():\n base = []\n for a, s in zip(A[::-1], S[::-1]):\n x = a\n for y in base:\n x = min(x, x ^ y)\n if s == "0":\n if x:\n base.append(x)\n else:\n if x:\n return 1\n return 0\n\n\nt = int(input())\nfor i in r...
['Wrong Answer', 'Accepted']
['s830971569', 's998080858']
[9068.0, 9100.0]
[22.0, 135.0]
[402, 593]
p02651
u206890818
2,000
1,048,576
There are two persons, numbered 0 and 1, and a variable x whose initial value is 0. The two persons now play a game. The game is played in N rounds. The following should be done in the i-th round (1 \leq i \leq N): * Person S_i does one of the following: * Replace x with x \oplus A_i, where \oplus represents bit...
['import numpy as np\nimport math\nimport collections\n\nT = int(input())\nfor i in range(T):\n x = 0\n L0 = [0]\n L1 = [0]\n #print("x:", x)\n N = int(input())\n A = list(map(int, input().split()))\n S = input()\n if S.count(\'0\') < N / 2:\n for i, s in enumerate(S):\n if s =...
['Wrong Answer', 'Accepted']
['s028009579', 's400807234']
[27480.0, 27036.0]
[2206.0, 170.0]
[1307, 483]
p02651
u227082700
2,000
1,048,576
There are two persons, numbered 0 and 1, and a variable x whose initial value is 0. The two persons now play a game. The game is played in N rounds. The following should be done in the i-th round (1 \leq i \leq N): * Person S_i does one of the following: * Replace x with x \oplus A_i, where \oplus represents bit...
['for _ in range(int(input())):\n n=int(input())\n a=list(map(int,input().split()))\n s=input()\n b=[]\n ans=0\n for i in range(n-1,-1,-1):\n for j in b:\n a[i]=min(a[i],a[i]^j)\n if a[i]!=0:\n if s[i]=="0":\n b.append(a[i])\n else:\n ans=1\n print(ans,a)', 'for _ in range(int(...
['Wrong Answer', 'Accepted']
['s918560156', 's555736206']
[9036.0, 8824.0]
[321.0, 321.0]
[281, 279]
p02651
u761320129
2,000
1,048,576
There are two persons, numbered 0 and 1, and a variable x whose initial value is 0. The two persons now play a game. The game is played in N rounds. The following should be done in the i-th round (1 \leq i \leq N): * Person S_i does one of the following: * Replace x with x \oplus A_i, where \oplus represents bit...
['3\n2\n1 2\n10\n2\n1 1\n10\n6\n2 3 4 5 6 7\n111000', "def gauss_jordan(bs):\n rank = 0\n pivot_cols = []\n for col in reversed(range(61)):\n pivot = -1\n for i,row in enumerate(bs[rank:]):\n if row&(1<<col):\n pivot = rank+i\n break\n if pivot < 0:...
['Runtime Error', 'Accepted']
['s950438521', 's672796315']
[8776.0, 9164.0]
[22.0, 646.0]
[40, 907]
p02651
u989345508
2,000
1,048,576
There are two persons, numbered 0 and 1, and a variable x whose initial value is 0. The two persons now play a game. The game is played in N rounds. The following should be done in the i-th round (1 \leq i \leq N): * Person S_i does one of the following: * Replace x with x \oplus A_i, where \oplus represents bit...
['from random import randint\nt=int(input())\nfor i in range(t):\n n=int(input())\n a=list(map(int,input().split()))\n s=input()\n if s[-1]=="1":\n print(1)\n continue\n print(randint(0,1))', 'I=input\nn=int\nfor i in range(n(input())):\n I();t=[];x=0\n for i,j in zip(map(n,I().split()[::...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s182238611', 's217652924', 's434162955', 's766964753', 's593690354']
[9564.0, 8860.0, 9036.0, 9068.0, 9064.0]
[27.0, 20.0, 18.0, 392.0, 363.0]
[207, 181, 354, 188, 185]
p02652
u102461423
2,000
1,048,576
Given is a string S, where each character is `0`, `1`, or `?`. Consider making a string S' by replacing each occurrence of `?` with `0` or `1` (we can choose the character for each `?` independently). Let us define the unbalancedness of S' as follows: * (The unbalancedness of S') = \max \\{ The absolute difference ...
["import sys\nimport numpy as np\nfrom numba import njit\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\n@njit('(i4[::1],i4[::1])', cache=True)\ndef f(S, T):\n m, x, M = 0, 0, 0\n for i in range(len(S)):\n if S[i] == -1:\n x -= 1\n...
['Runtime Error', 'Accepted']
['s614234858', 's407506842']
[137776.0, 118968.0]
[595.0, 884.0]
[751, 1282]
p02652
u539692012
2,000
1,048,576
Given is a string S, where each character is `0`, `1`, or `?`. Consider making a string S' by replacing each occurrence of `?` with `0` or `1` (we can choose the character for each `?` independently). Let us define the unbalancedness of S' as follows: * (The unbalancedness of S') = \max \\{ The absolute difference ...
["from numba import njit\ns = input()\n\n@njit\ndef test(c):\n # current point can be seen as xth smallest val, where x can be any value in [a, b] (subset of [0, c])\n # a <= b\n a, b = 0, c\n ok = True\n discrete = False # when True x = a, a+2, ..., b-2, b\n for si in s:\n if si == '1':\n ...
['Time Limit Exceeded', 'Accepted']
['s141324228', 's590555997']
[127144.0, 117868.0]
[2208.0, 964.0]
[1222, 1294]
p02658
u000022466
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['import sys\n\nN = int(input())\nA = list(map(int,input().split())\n\nfor a in A:\n\tif a == 0:\n\t\tprint("0")\n\t\tsys.exit()\n\nnum = 1\nfor a in A:\n\tnum *= a\n\tif num > 1000000000000000000:\n\t\tprint(-1)\n\t\tsys.exit()\n\nprint(num)\n\t\t', 'import heapq\nfrom collections import deque\nfrom enum import Enum\n...
['Runtime Error', 'Accepted']
['s907638803', 's445311675']
[9016.0, 33428.0]
[25.0, 119.0]
[215, 532]
p02658
u000037600
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['input()\na=1\nb=map(int,input().split())\nfor i in b:\n a*=i\nif a>10^18:\n a=-1\nprint(a)', 'input()\na=1\nb=map(int,inpit().split())\nfor i in b:\n a*=i\nif a>10^18:\n a=-1\nprint(a)', 'n=int(input())\nl=list(map(int,input().split()))\nif 0 in l:\n print(0)\nelse:\n a=1\n for i in l:\n a=a*i\n if a>10*...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s348189311', 's497955763', 's226665622']
[19200.0, 9032.0, 21488.0]
[2206.0, 27.0, 61.0]
[85, 85, 163]
p02658
u000085263
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N=input()\nA=input()\na=A.split()\nc=1\nfor i in a:\n c=c*int(i)\nif c<(10**8):\n print(c)\nelse:\n c=-1\n print(c)', 'N = int(input())\nA = list(map(int,input().split()))\nA = 1\nfor i in A:\n A *= i\n if A== 0:\n break\nif ans > 10**18:\n print(-1)\nelse:\n print(ans)', 'N=input()\nA=input()\...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s290310109', 's384479164', 's573523987', 's586365124', 's938109108']
[20420.0, 21476.0, 20548.0, 21632.0, 21660.0]
[2206.0, 53.0, 2206.0, 57.0, 56.0]
[109, 160, 109, 251, 253]
p02658
u000513658
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\n\na = set(map(int, input().split()))\n\nresult = 1\nif 0 in a:\n result = 0\nelse:\n for i in a:\n result = result * i\n if result > 10**18:\n result = -1\n break\n \n\nprint(result)', 'n = int(input())\n\na = list(map(int, input().split()))\n\nresult...
['Wrong Answer', 'Accepted']
['s040833829', 's363912140']
[26868.0, 21648.0]
[65.0, 47.0]
[234, 235]
p02658
u001490106
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nA = list(map(int, input().split()))\n\nsum = 1\nA.sort()\nfor i in A:\n sum = sum*i\n if sum >= pow(10,18):\n sum = -1\n break\nprint(sum)', 'N = int(input())\nA = list(map(int, input().split()))\n\nsum = 1\nA.sort()\nfor i in A:\n sum = sum*i\n if sum > pow(10,18):\n ...
['Wrong Answer', 'Accepted']
['s477417841', 's866906067']
[21704.0, 21704.0]
[113.0, 114.0]
[166, 165]
p02658
u003855259
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['\nN=int(input(""))\n\nar=[]\ntotal=1\nbig=False\n\nar = list(map(int, input().strip().split(\' \')))\n\nA=len(ar)\n \nwhile big == False:\n for i in range (0,A):\n total=ar[i]*total\n if total>(10^18):\n big=True\n break\n\nif big == False:\n prin...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s792091381', 's924002176', 's350904428']
[21640.0, 21784.0, 21648.0]
[2206.0, 2206.0, 55.0]
[389, 321, 555]
p02658
u004482945
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\na = list(map(int, input().split()))\nans = 1\nfor i in a:\n ans *= i\n if ans >= 10**18:\n ans = -1\n break\nif 0 in a:\n ans = 0\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\nfor i in a:\n ans *= i\nif ans >= 10**18:\n ans = -1\nprint(ans)', 'n = int(inpu...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s297304723', 's928603015', 's152326241']
[21656.0, 21784.0, 21700.0]
[54.0, 2206.0, 53.0]
[158, 123, 157]
p02658
u007637377
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['#include <bits/stdc++.h>\nusing namespace std;\n\n#define REP(i,b) FOR(i,0,b)\n\n#define RREP(i,a) RFOR(i,a,0)\n\n\n#define REPITR(itr,x) for (auto itr = (x).begin(); itr != (x).end(); itr++)\n#define ALL(x) (x).begin(), (x).end()\n#define SORT(x) sort(ALL(x))\n#define MIN_ELEMENT(x) min_element(ALL(x))\n#define MAX_...
['Runtime Error', 'Accepted']
['s880780311', 's026272788']
[9012.0, 21600.0]
[23.0, 68.0]
[1576, 268]
p02658
u008323723
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\na = map(int,input().split())\nb =1\n\nfor i in range(n):\n b *= a[i]\n\nif b >= 10**18:\n print(-1)\nelse:\n print(b)', 'n = int(input())\na = list(map(int,input().split()))\nb =1\n\nfor i in range(n):\n b *= a[i]\n if b>=10**18:\n b=-1\n break\n else:\n continue\nprint(b)', 'n = int(...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s062674307', 's199717729', 's366512280', 's610604227']
[19352.0, 21564.0, 21632.0, 21648.0]
[36.0, 49.0, 2206.0, 60.0]
[128, 153, 134, 170]
p02658
u008582165
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input());\nans = 1;\nfor i in range(n):\n a = int(input())\n ans*=a\nif ans>=1000000000000000001:\n print(-1)\nelse:\n print(ans)', 'n = int(input());\nans = 1;\nlis = list(map(int,input().split()))\nflag = False\nflag2 = False\nfor i in range(n):\n if lis[i]==0:\n flag = True\n if an...
['Runtime Error', 'Accepted']
['s075526440', 's401788390']
[12772.0, 21632.0]
[37.0, 72.0]
[141, 310]
p02658
u010379708
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
["n=int(input())\nl=list(map(int, input().split(' ')))\nans=1\nfor i in l:\n ans*=i\n if ans>10**18:\n print(-1)\n break\nif not ans>10**18:\n print(ans)\n", "n=int(input())\nl=list(map(int, input().split(' ')))\nans=1\nfor i in l:\n ans*=i\n if ans>10**18:\n print(-1)\n break\nif not ans...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s506220499', 's860907323', 's634154138']
[21636.0, 9028.0, 21588.0]
[47.0, 22.0, 51.0]
[162, 158, 224]
p02658
u011277545
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['import numpy as np\nN=int(input())\nA=list(map(int, input().split()))\nA_N=np.array(A,dtype=\'int64\')\n\nANS=np.prod(A_N)\n\nif ANS>10**18:\n print(""-1")\nelse:\n print(ANS)', 'import numpy as np\nN=int(input())\nA=list(map(int, input().split()))\nA_N=np.array(A)\n\nANS=np.prod(A_N)\n\nif ANS>=10**18:\n pr...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s020336904', 's474947684', 's520877749', 's884821950', 's038700995']
[8968.0, 40332.0, 22992.0, 24384.0, 24112.0]
[22.0, 142.0, 2206.0, 67.0, 68.0]
[169, 153, 169, 200, 301]
p02658
u011387432
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n=int(input())\nmul=1\nlimit=1000000000000000000\nfor i in range (n):\n x=int(input())\n mul*=x\nif(mul>limit):\n print(-1)\nelse:\n print(mul)', 'n=int(input())\nmul=1\nlimit=1000000000000000000\nx=input().split()\nfor i in range (n):\n p=int(x[i])\n if(p==0):\n mul=0\n break\nif(mul==0):\n ...
['Runtime Error', 'Accepted']
['s937392317', 's355566231']
[12752.0, 19516.0]
[35.0, 72.0]
[138, 337]
p02658
u011453891
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\nvalues =list(map(int, input().split()))\na=1\n \nfor i in range(n):\n a=a*values[i]\n \nimport math\nif math.log10(a) < 18:\n print(a)\nelse:\n print(-1)', 'n = int(input())\nvalues =list(map(int, input().split()))\na=1\nt = 10**18\nfor i in range(n):\n if values[i] == 0:\n a = 0\n break\...
['Runtime Error', 'Accepted']
['s892704926', 's300270439']
[21648.0, 21580.0]
[2206.0, 60.0]
[164, 224]
p02658
u012820749
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['a = ()\nn = input()\na = map(int, input().split())\n\nans = a[0]\na2 = a[1:]\nfor i in a2:\n ans = ans * i\n\nif ans > 10e+18:\n ans = -1\n\nprint(ans)', 'a = ()\nn = input()\na = map(int, input().split())\n\nprint(sum(a))', 'def main():\n n = input()\n a = tuple(map(int, input().split()))\n\n if 0 in a:\n pr...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s299623107', 's957494817', 's059170303']
[19200.0, 19124.0, 21864.0]
[34.0, 46.0, 51.0]
[141, 63, 249]
p02658
u013061784
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\na = [int(i) for i in input().strip.split(" ")]\nres=1\nxx=1**18\nfor i in a:\n res*=i\nif res>xx:\n print(-1)\nelse:\n print(res)', 'N = int(input())\na = [int(i) for i in input().split(" ")]\nres=1\nxx=1**18\nfor i in a:\n res*=i\nif res>xx:\n print(-1)\nelse:\n print(res)', 'N = ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s202194944', 's311725812', 's619557550']
[12780.0, 21640.0, 21652.0]
[24.0, 2206.0, 92.0]
[147, 141, 193]
p02658
u013864607
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nA = list(map(int, input().split()))\n\ntmp = 1\nfor num in A:\n tmp *= num\n if tmp <= 1e18:\n break\nif tmp <= 1e18:\n print(tmp)\nelse:\n print("-1")\n', 'N = int(input())\nA = list(map(int, input().split()))\n \ntmp = 1\nfor num in A:\n tmp *= num\n if tmp > 1e18:\n br...
['Wrong Answer', 'Accepted']
['s242696774', 's596443276']
[21572.0, 21644.0]
[51.0, 51.0]
[176, 202]
p02658
u014139588
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['print(-1)', 'print(0)', 'n = int(input())\na = list(map(int,input().split()))\na.sort()\nans = 1\nif a[0] == 0:\n print(0)\nelse:\n for i in range(len(a)):\n ans *= a[i]\n if ans > 10**18:\n print("-1")\n exit()\n elif i == len(a)-1:\n print(ans)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s102724649', 's447823927', 's886860770']
[9084.0, 9144.0, 21632.0]
[23.0, 23.0, 89.0]
[9, 8, 234]
p02658
u014554381
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['def main ():\nN = int(input())\nA = list(map(int,input(). split ()))\nif 0 in A:\nprint(0)\nreturn\nprod = 1\nfor a in A:\nprod *= a\nif prod > 1000000000000000000:\nprint(-1)\nreturn\nprint(prod)\nmain ()\n', 'n,a = map(int.input().split())\nb = list[]\nfor n:\n b.append(a)\n\nplint(a**n)\n', 'n,a = map(int.input()...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s145661999', 's670557452', 's987067244', 's335477666']
[9004.0, 9044.0, 8984.0, 21664.0]
[26.0, 22.0, 25.0, 49.0]
[193, 76, 108, 236]
p02658
u015593272
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nA_s = list(map(int, input().split()))\n\nseki = 1\n\nif (A_s.count(0) > 0):\n print(0)\n exit()\n\nfor i in range(N):\n seki *= A_s[i]\n print(seki)\n \n if (seki > 10 ** 18):\n print(-1)\n exit()\n\nprint(seki)', 'N = int(input())\nA_s = list(map(int, input().split()...
['Wrong Answer', 'Accepted']
['s808867767', 's061546233']
[21628.0, 21656.0]
[80.0, 49.0]
[244, 228]
p02658
u015647294
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = int(input())\nA = list(map(int, input().split()))\nans = A[0]\nif A.count(0) == 0:\n ans = 0\nelse:\n for i in range(1,N):\n ans = ans * A[i]\n if ans >= 10 ** 18:\n ans = -1\n break\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\nans = A[0]\nfor i i...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s274480143', 's415311106', 's437887015', 's634156311']
[21572.0, 21696.0, 21700.0, 21644.0]
[60.0, 57.0, 60.0, 59.0]
[229, 171, 229, 228]
p02658
u016336953
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\nc = list(map(int, input().split()))\nans=1\nmax =10**18\nfor i in range(n):\n if ans< max:\n ans=ans*c[i]\n if ans >= max:\n ans =-1\n break\n else:\n ans = -1\n break\nprint(ans)', 'n = int(input())\nc = list(map(int, input().split()))\nans=1\...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s524611536', 's935177638', 's188371371']
[21584.0, 21648.0, 21780.0]
[51.0, 55.0, 52.0]
[240, 305, 304]
p02658
u017624958
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N = input()\nA = list(map(int, input().split()))\n\nanswer = 1\nfor Ai in A:\n answer *= Ai\n\nif answer >= 10 ** 18:\n answer = -1\n\nprint(answer)\n', 'N = input()\nA = list(map(int, input().split()))\n\nhaz_zero = 0 in A\nif haz_zero:\n print(0)\n exit()\n\nanswer = 1\nfor Ai in A:\n answer *= Ai\n ...
['Wrong Answer', 'Accepted']
['s721734606', 's492199609']
[21584.0, 21768.0]
[2206.0, 47.0]
[145, 221]
p02658
u018168283
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['from collections import deque\nimport math\nn=int(input())\na=deque()\na=list(map(int,input().split()))\ns=1\ne=0\nf=0\nfor i in range(n):\n l=a.pop()\n if l == 0:\n s=0\n break\n else:\n s=s*l\n f+=math.log10(s)\n if s>=18:\n e=1\n break\n \nif e!=0:\n print(-1)\nelse:\n print(s)', 'fro...
['Wrong Answer', 'Accepted']
['s861931232', 's524196839']
[22676.0, 22508.0]
[61.0, 74.0]
[288, 282]
p02658
u018679195
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['\n#user input A in list\n#function of multiplication of all item in list\n#time complexity is O(n)\nN = int(input())\nA = [int(x) for x in input().split()[:N]]\n\ndef multiplyList(list1):\n b = 1\n for i in list1:\n b = b*i\n return b\n\nif multiplyList(A) < 1*10**18:\n print(multiplyList(A))\nelse...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s020949917', 's717785416', 's952454189']
[21612.0, 19332.0, 21616.0]
[2206.0, 2206.0, 68.0]
[332, 165, 472]
p02658
u018771977
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\na = list(map(int, input().split()))\n\nresult = 1\n\nfor ac in a:\n result *= ac\n if result >= 10 ** 18:\n print(-1)\nelse:\n\tprint(result)\n \n \n', '#! env/bin/local python3\n\nimport sys\n\nn = int(input())\na = list(map(int, input().split()))\na = sorted(a, key=lambda x: x)\n\nresul...
['Wrong Answer', 'Accepted']
['s738495695', 's503612943']
[21472.0, 21632.0]
[2206.0, 94.0]
[164, 254]
p02658
u018846452
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['n = int(input())\na = list(map(int, input().split()))\nans = 1\n\nfor i in range(n):\n\tans *= a[i]\n\tif ans > 10^18:\n \t\tans = -1\n break\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\nans = 1\n\nfor i in range(n):\n\tans *= a[i]\nif ans > 10^18:\n ans = -1\nprint(ans)', 'n = int(in...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s012639398', 's086082579', 's104574094', 's657586645', 's985741891', 's296963269']
[8912.0, 21624.0, 21736.0, 8952.0, 21744.0, 21604.0]
[22.0, 2206.0, 63.0, 28.0, 54.0, 56.0]
[147, 131, 166, 147, 146, 173]
p02658
u019355060
2,000
1,048,576
Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N. However, if the result exceeds 10^{18}, print `-1` instead.
['N=int(input())\nA=[]\nA=list(map(int,input().split()))\nL=10^18\nS=1\nfor i in range(N):\n S=S*A[i]\n if S>L:\n print("-1")\n break\nif S<=L:\n print(S)\n', 'N=int(input())\nA=[]\nA=list(map(int,input().split()))\nA.sort(reverse=True)\nL=10**18\nS=1\nif A[N-1]==0:\n print("0")\nelse:\n fo...
['Wrong Answer', 'Accepted']
['s481425849', 's905285413']
[21624.0, 21592.0]
[47.0, 76.0]
[165, 250]