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 |
|---|---|---|---|---|---|---|---|---|---|---|
p02982 | u589381719 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['N,D = map(int,input().split())\nX=[]\nans=0\n\ndef cheak_root(n):\n i=0\n while i<n:\n i+=1\n if i*i==n: return i\n return False\n\nfor i in range(N):\n X.append(list(map(int,input().split())))\n\nfor i in range(N):\n for j in range(i+1,N):\n sums=0\n for d in range(D):\n ... | ['Wrong Answer', 'Accepted'] | ['s472994536', 's431460768'] | [3064.0, 3064.0] | [18.0, 31.0] | [402, 403] |
p02982 | u590253847 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\n\n\n \ndef deffer(A,B):\n sum = 0\n for i in range(len(A)):\n sum += (A[i]-B[i])**2\n sum = math.sqrt(sum)\n return sum\n\n\nN,D= map(int,input().split())\nlistA = [list(map(int,input().split())) for i in range(N)]\nans =0\nfor i in range(N):\n for j in range(i +1,N):\n D ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s228932161', 's320185223', 's575848619'] | [3064.0, 3064.0, 3064.0] | [18.0, 19.0, 18.0] | [585, 395, 577] |
p02982 | u593019570 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ["a,b = input().split(' ')\n\nc = []\nfor i in range(int(a)):\n c.append(input().split(' '))\n\ncount = 0\nfor j in range(int(a)):\n for k in range(int(a)):\n if j > k:\n ans = 0\n for l in rnage(int(b)):\n ans = ans + (int(c[j][l]) ** 2 - int(c[k][l]) ** 2) ** 0.5\n\n if ans = int(ans):\n count... | ['Runtime Error', 'Accepted'] | ['s898855356', 's371798669'] | [2940.0, 3064.0] | [18.0, 18.0] | [329, 366] |
p02982 | u594244257 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import itertools\nimport math\n\ndef solve():\n N, D = [int(s) for s in input().split() if s]\n X = []\n cnt = 0\n for _ in range(N):\n X.append([int(s) for s in input().split() if s])\n for x1,x2 in itertools.combinations(X,2):\n if dist(x1,x2).is_integer():\n cnt+=1\n print(cnt)\n\nsolve()'... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s412117666', 's797324394', 's362463694'] | [3060.0, 3060.0, 3064.0] | [18.0, 18.0, 18.0] | [303, 325, 386] |
p02982 | u598696606 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import numpy as np\nimport math\n\nbuf=input().split(" ")\n\nN=int(buf[0])\nD=int(buf[1])\n\narr = np.empty((0,D), int)\n\nfor i in range(N):\n buf=input().split(" ")\n buf = [int(s) for s in buf]\n\n arr=np.append(arr, [buf], axis=0)\n \n\nbuf=0\nc=0\n\nfor i in range(N):\n for j in range(N):\n if i<j:\n ... | ['Runtime Error', 'Accepted'] | ['s799932717', 's849034066'] | [12392.0, 12424.0] | [148.0, 151.0] | [456, 482] |
p02982 | u602773379 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['\ndef input2():\n\treturn map(int,input().split())\n\n\ndef input_array():\n\treturn list(map(int,input().split()))\n \ndef euclid(y,z,d):\n\tresult=0\n\tfor i in range(d):\n\t\tresult+=(y[i]-z[i])**2\n\treturn math.sqrt(result)\n\n\nn,d=input2()\nX=[input_array() for _ in range(n)]\n\ncount=0\nfor i in range(n):\n\... | ['Runtime Error', 'Accepted'] | ['s003707574', 's175584522'] | [9120.0, 9204.0] | [25.0, 25.0] | [455, 466] |
p02982 | u605748139 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nimport itertools\nN, D = map(int, input().split())\n\ncount = 0\nall_list = []\nfor _ in range(N):\n p_list = list(map(int, input().split()))\n all_list.append(p_list)\n\ncomb_list = list(itertools.combinations(all_list, 2))\nfor f_list, l_list in comb_list:\n print(f_list)\n diff_list = [(i-... | ['Wrong Answer', 'Accepted'] | ['s056280082', 's883837349'] | [3064.0, 3064.0] | [17.0, 17.0] | [425, 422] |
p02982 | u608809251 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['N, D= map(int,input().split())\narr = [list(map(int,input().split())) for _ in range(N)]\ncount=0\nfor i in range(N):\n for j in range(i+1,N):\n tmp = 0\n for k in range(D):\n if i != j:\n tmp += (arr[i][k]-arr[j][k])**2\n tmp = tmp**0.5\n if tmp == int(tmp)\n ... | ['Runtime Error', 'Accepted'] | ['s736050376', 's849521893'] | [2940.0, 3064.0] | [17.0, 18.0] | [346, 347] |
p02982 | u609061751 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['L,R=map(int,input().split())\nM=[]\nfor i in range(L,R):\n for j in range(i+1,R+1):\n M.append((i%2019)*(j%2019))\nprint(min(M))', 'import math\nN,D=map(int,input().split())\nX=[]\ncnt=0\ndef distance(x,y):\n d2=[]\n for k in range(D):\n d2.append((X[x][k]-X[y][k])**2)\n return math.sqrt(sum... | ['Runtime Error', 'Accepted'] | ['s120328794', 's102369253'] | [2940.0, 3064.0] | [17.0, 17.0] | [133, 374] |
p02982 | u609814378 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['b', 'n,d = map(int,input().split())\npnt = [list(map(int,input().split())) for _ in range(n)]\n\n\n\n\ndef dst(i, j):\n a = pnt[i]\n b = pnt[j]\n ret = 0\n for p, q in zip(a, b):\n ret += (p - q) ** 2\n r = ((ret ** (0.5)))\n\n return r\n\n\nans = 0\nfor i in range(n):\n for j in range(i +... | ['Runtime Error', 'Accepted'] | ['s129734100', 's645829902'] | [2940.0, 3064.0] | [17.0, 18.0] | [1, 392] |
p02982 | u610473220 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['n, d = map(int, input().split())\nXlist = []\n\nfor i in range(n):\n l = list(map(int, input().split()))\n Xlist.append(l)\n\nans = 0\ntmp = 0\n\nfor i in range(n-1):\n for j in range(i+1, n):\n for k in range(d):\n tmp += (Xlist[i][k] - Xlist[j][k]) ** 2\n a = int(tmp ** 0.5) ** 2\n... | ['Wrong Answer', 'Accepted'] | ['s666097913', 's419576567'] | [3064.0, 3064.0] | [18.0, 18.0] | [409, 372] |
p02982 | u612481724 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['# -*- coding: utf-8 -*-\nimport math\nn, d = map(int, input().split())\n\nx = [list(map(int, input().split())) for _ in range(n)]\n\ncnt = 0\nfor i in range(n - 1):\n for j in range(i + 1, n):\n tmp = 0.0\n for k in range(d):\n tmp += pow((x[i][k] - x[j][k]), 2)\n\n tmp = math.sqrt(... | ['Wrong Answer', 'Accepted'] | ['s005568836', 's185383407'] | [3060.0, 3060.0] | [17.0, 17.0] | [373, 354] |
p02982 | u613943630 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import sys\nsys.setrecursionlimit(10**7)\ninput = sys.stdin.readlines\nfrom math import sqrt\n\ndef isSquare(n):\n m = int(sqrt(n))\n for x in range(m-2, m+2):\n if x**2 == n:\n return True\n\ndef getDistance(xi, xj, dimention):\n d = 0\n for i in range(dimention):\n d += (xi[i] -... | ['Wrong Answer', 'Accepted'] | ['s335454035', 's147206533'] | [9144.0, 9172.0] | [28.0, 30.0] | [735, 707] |
p02982 | u614181788 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['n,d = map(int,input().split())\nx = [0]*n\nfor i in range(n):\n x[i] = list(map(int,input().split()))\ncount = 0\nfor i in range(n):\n for j in range(n):\n dis2 = 0\n for k in range(d):\n dis2 += (x[i][k]-x[j][k])**2\n dis = float((dis2)**0.5)\n if dis.is_integer() == True... | ['Wrong Answer', 'Accepted'] | ['s493904629', 's653274447'] | [3064.0, 3064.0] | [19.0, 18.0] | [351, 355] |
p02982 | u616117610 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['n, d = map(int,input().split())\nx = list(range(n))\nfor i in range(n):\n x[i] = list(map(int, input().split()))\n\na = []\nfor i in range(200):\n a.append(i**2)\n\nans = 0\nfor i in range(n-1):\n for j in range(i, n):\n dis = 0\n for k in range(d):\n dis = dis + (x[i][k]-x[j][k])**2\n if dis in a:\n... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s126340903', 's704806140', 's884178070'] | [3064.0, 3188.0, 3064.0] | [18.0, 17.0, 18.0] | [327, 300, 329] |
p02982 | u620846115 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['N,D = map(int,input().split())\nimport numpy as np\nxlist = [list(map(int,input().split())) for i in range(n)]\nxarray = np.array(xlist)\nans = 0\nfor i in range(n):\n for j in range(i+1,n+1):\n if (xarray[i]-xarray[j])%1!=0:\n ans+=1\nprint(ans)', 'N,D = map(int,input().split())\nimport numpy as np\nxlist =... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s217542119', 's274314159', 's729475856', 's796011258', 's828862628', 's799899301'] | [27096.0, 27064.0, 26944.0, 26984.0, 29364.0, 30204.0] | [108.0, 116.0, 112.0, 113.0, 331.0, 263.0] | [246, 260, 258, 295, 258, 266] |
p02982 | u622088062 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nfrom collections import deque\n\n\nN, D = map(int, input().split())\n\npoints = []\n\nfor i in range(0, N):\n points.append(list(map(int, input().split())))\n\n\ndef distance(x, y):\n dd = 0\n for xy in zip(x,y):\n dd += (xy[0] - xy[1])**2\n return math.sqrt(dd)\n\nq = deque(points)\n\... | ['Wrong Answer', 'Accepted'] | ['s889416674', 's019192493'] | [3316.0, 3316.0] | [21.0, 20.0] | [567, 550] |
p02982 | u623687794 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['n,d=map(int,input().split())\nl=[[] for i in range(n)]\nfor i in range(n):\n l[i]=list(map(int,input().split()))\nans=0\nfor i in range(n-1):\n for j in range(i+1,n):\n c=0\n for h in range(d):\n c+=abs(l[i][h]**2-l[j][h]**2)\n if int(c**(1/2))==c**(1/2):\n ans+=1\nprint(ans)', 'n,d=map(int,input... | ['Wrong Answer', 'Accepted'] | ['s411565159', 's357142331'] | [3064.0, 3064.0] | [18.0, 17.0] | [285, 278] |
p02982 | u626228246 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nn,m = map(int,input().split())\nx = [list(map(int,input().split())) for _ in range(n)]\ncnt,tmp = 0,0\nfor i in range(n-1):\n\tfor j in range(i+1,n):\n\t\ttmp = 0\n\t\tfor M in range(m):\n\t\t\ttmp += (x[i][M] - x[j][M])**2\n\t\t\t#print(tmp)\n\t\t\tif math.sqrt(tmp).is_integer():\n\t\t\t\tcnt += 1\nprin... | ['Wrong Answer', 'Accepted'] | ['s824581175', 's654059708'] | [9208.0, 9148.0] | [29.0, 29.0] | [294, 292] |
p02982 | u626684023 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['N, D = map(int, input().split())\nX = [[int(i) for i in input().split()] for _ in range(N)]\ncount = 0\nfor i in range(N):\n for j in range(i + 1, N):\n res = sum([(X[i][k] - X[j][k])**2 for k in range(D)])\n if (res**0.5).is_integer:\n count += 1\nprint(count)', 'N, D = map(int, input().split())\nX = [[i... | ['Wrong Answer', 'Accepted'] | ['s780327463', 's426703476'] | [3064.0, 3188.0] | [18.0, 18.0] | [265, 263] |
p02982 | u627234757 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nN, D = map(int, input().split())\na = []\nfor i in range(N):\n b = map(int, input().split())\n a += b\nprint(a)\nres = 0\nfor i in range(N-1):\n j = i + 1\n while(j < N):\n x = []\n y = []\n for k in range(D):\n x.append(a[i * D + k])\n y.append(a[j * D + k])\n tmp = 0\n for ... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s051811225', 's640489210', 's709732115', 's964465765', 's569829927'] | [3064.0, 3064.0, 3064.0, 3064.0, 9256.0] | [18.0, 18.0, 17.0, 18.0, 26.0] | [441, 441, 439, 451, 297] |
p02982 | u633450100 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\n\nn,m = [int(i) for i in input().split()]\ntable = [[int(i) for i in input().split()] for n in range(n)]\n\ncount = 0\n\nfor i in range(n):\n for j in range(i+1,n,1):\n distance = 0\n total = 0\n for k in range(m):\n total += (table[i][k] - table[j][k]) ** 2\n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s481250164', 's628591481', 's806832009', 's300219356'] | [3316.0, 3316.0, 3316.0, 3064.0] | [19.0, 19.0, 19.0, 18.0] | [465, 465, 465, 410] |
p02982 | u636489589 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import numpy as np\n\nn, d = map(int, input().split())\n\np = np.zeros(n,d)\n\nfor i in range(n):\n p[i] = np.array(list(map(int, input().split())))\n\ncnt = 0\nd = 0\nfor i in range(n):\n for j in range(i+1,n):\n d = np.sqrt((p[i] - p[j]) ** 2)\n if d % 1 == 0:\n cnt += 1\n\nprint(cnt)\n', 'import numpy... | ['Runtime Error', 'Accepted'] | ['s772236536', 's719417633'] | [13072.0, 12396.0] | [150.0, 153.0] | [284, 295] |
p02982 | u639592190 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\n\ndef dist(X1,X2):\n d=[abs(X1[i]-X2[i]) for i in range(len(X1))]\n d=[x**2 for x in d]\n d=sum(d)\n d=math.sqrt(d)\n return d\n \ncount=int(0)\nN,D=map(int,input().split())\nX=list(range(N))\nfor i in range(N):\n X[i]=list(map(int,input().split()))\nfor i in range(N):\n for j in range(i+1,N):\n ... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s011394685', 's104085337', 's307834846', 's907889510', 's694809561'] | [3064.0, 2940.0, 2940.0, 3064.0, 3064.0] | [18.0, 17.0, 17.0, 17.0, 19.0] | [390, 308, 313, 313, 377] |
p02982 | u640603056 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['n, d = map(int, input().split())\nlst = []\nlength = 0\ncnt = 0\nfor i in range(n):\n\ta = map(int, input().split())\n\tlst.append(list(a))\nfor i in range(1, n):\n\tfor j in range(i, n):\n\t\tfor k in range(d):\n\t\t\tlength += (lst[i][k]-lst[j-1][k])**2\n\t\t\tlength = length ** 0.5\n\t\t\tprint(length, length%1)\n... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s083976866', 's096003112', 's160057794', 's427171038', 's434669303', 's578915034', 's750838367', 's799255300', 's150043723'] | [3188.0, 3060.0, 3064.0, 3188.0, 3188.0, 3060.0, 3064.0, 3064.0, 3188.0] | [19.0, 17.0, 17.0, 17.0, 18.0, 17.0, 17.0, 18.0, 17.0] | [409, 173, 383, 357, 379, 289, 385, 417, 352] |
p02982 | u641770903 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['\nimport math\nx = []\nans = 0\n#input1 N, D (numeric)\nN, D = map(int, input().split())\n#input2\nfor i in range(N):\n a = list(map(int, input().split()))\n x += [a]\n#make combination\nfor i in range(N):\n for j in range(i+1, N):\n for k in range(D):\n square = 0\n obj_num = 0\n square += (x[i]... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s190735086', 's235257579', 's430968842', 's444027095', 's518126876', 's744045556', 's973175074', 's327417635'] | [3064.0, 12448.0, 12448.0, 12648.0, 12404.0, 12448.0, 14432.0, 3064.0] | [18.0, 153.0, 149.0, 153.0, 148.0, 154.0, 147.0, 21.0] | [441, 794, 715, 701, 706, 694, 706, 437] |
p02982 | u642012866 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nN, D = map(int, input().split())\nX = [list(map(int, input().split())) for x in range(N)]\nX.append(X[0])\n\ncnt = 0\nfor i in range(N):\n for j in range(i+1, N):\n a = 0\n for k in range(D):\n a += (X[i][k] - X[i+1][k]) ** 2\n if math.sqrt(a).is_integer():\n ... | ['Wrong Answer', 'Accepted'] | ['s780175312', 's850661629'] | [3064.0, 3064.0] | [20.0, 18.0] | [327, 328] |
p02982 | u650265349 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nN, D = map(int, input().split())\nX = []\n\nfor i in range(N):\n inp = input()\n buf = list(map(int, inp))\n X.append(buf)\n\ncnt = 0\n\nfor i in range(N-1):\n for j in range(i+1,N):\n dist2 = 0\n for index in range(D):\n dist2 += (X[i][index] - X[j][index]) ** 2\n dist = math.sqrt(dist... | ['Runtime Error', 'Accepted'] | ['s306248016', 's104050625'] | [3064.0, 3064.0] | [17.0, 18.0] | [364, 360] |
p02982 | u661143301 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['N, D = map(int, input().split())\nX = []\n\ndef is_integer_num(n):\n if isinstance(n, int):\n return True\n if isinstance(n, float):\n return n.is_integer()\n return False\n\nfinal_ans=0\n\nfor i in range(0,N,1):\n X.append(list(map(int, input().split())))\n\nfor i in range(0,N-1,1):\n fo... | ['Wrong Answer', 'Accepted'] | ['s803452889', 's872931779'] | [3064.0, 3064.0] | [18.0, 17.0] | [550, 531] |
p02982 | u668503853 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['n, d = map(int, input().split())\nX = []\nfor _ in range(n):\n X.append([int(x) for x in input().split()])\nans = 0\nfor i in range(n - 1):\n for j in range(i + 1, n):\n s = sum((X[i][d] - X[j][d])**2 for d in range(d))\n if (s ** .5).is_integer():\n ans += 1\nprint(ans)\n', 'n, d = map(int, input(... | ['Runtime Error', 'Accepted'] | ['s044939740', 's759905169'] | [2940.0, 3060.0] | [17.0, 17.0] | [281, 267] |
p02982 | u671787293 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nimport numpy as np\nN, D = map(int, input().split())\ntimes = int(input()) \nn = [list(map(int, input().split())) for i in range(times)]\nn = np.array(n)\nfor j in range(n.shape[0]):\n for i in range(n.shape[0]):\n length = np.linalg.norm(n[i]-n[j])\n aaa = math.modf(length)[0]\n if aaa < 0.00... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s445302981', 's845472225', 's932737708', 's877720067'] | [14448.0, 12500.0, 18744.0, 12500.0] | [149.0, 148.0, 252.0, 149.0] | [377, 385, 377, 360] |
p02982 | u672316981 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['def distance(a_lst, b_lst):\n n = len(a_lst)\n tmp_distance = 0\n\n for i in range(n):\n a = a_lst[i]\n b = b_lst[i]\n\n tmp_distance += (a - b) ** 2\n\n distance = (tmp_distance) ** (1/2)\n return distance\n\n\ndef main():\n n, d = map(int, input().split())\n x_lst = [0] * n... | ['Wrong Answer', 'Accepted'] | ['s430423705', 's790898795'] | [9040.0, 9472.0] | [28.0, 25.0] | [620, 660] |
p02982 | u681110193 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['\nimport numpy as np\n\nN, D = map(int, input().split())\nX = [ list(map(int,input().split())) for i in range(N)]\nsum = 0\n\nfor i in range(N):\n for j in range(i+1,N):\n d = 0\n sum = 0\n for k in range(D):\n sum += (X[i][k] - X[j][k])**2\n d = np.sqrt(sum)\n if d // 1 == d:\n print("{} {}... | ['Wrong Answer', 'Accepted'] | ['s286870597', 's742167180'] | [12428.0, 14472.0] | [151.0, 155.0] | [327, 328] |
p02982 | u682271925 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nx,y = map(int,input().split())\nli = []\nwhile True:\n\ttry:\n\t\tli.append(list(map(int,input().split())))\n\texcept:\n\t\tbreak\nscore = 0\nfor a in li:\n\tfor b in li:\n\t\tnum = 0\n\t\tfor c in a:\n\t\t\tfor d in b:\n\t\t\t\tnum += abs(c - d) ** 2\n\t\tnum = num / 2\n\t\tt = math.sqrt(num) - round(ma... | ['Wrong Answer', 'Accepted'] | ['s323849726', 's646910815'] | [3064.0, 12504.0] | [21.0, 153.0] | [333, 314] |
p02982 | u686615670 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['# -*- coding: utf-8 -*-\nimport math\n\n\nn,d = map(int, input().split())\nlist_x = [[0 for i in range(d)] for j in range(n)]\n\nans = 0\ntmp_targ = 0\n\nfor k in range(n):\n list_x[k] = list(map(int, input().split()))\n\nprint(list_x)\n\nfor l in range(n-1):\n for m in range(l+1,n):\n tmp_targ = 0\n ... | ['Wrong Answer', 'Accepted'] | ['s480484806', 's553249073'] | [3064.0, 3064.0] | [18.0, 18.0] | [621, 625] |
p02982 | u687053495 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nn, d = map(int, input().split())\npoints = [list(map(int, input().split())) for i in range(n)]\n\ncnt = 0\n\ndef distance(x, y):\n ans = 0\n for dd in range(d):\n ans += abs(x[dd] - y[dd]) ** 2\n return math.sqrt(ans)\n\n\nfor i in range(n):\n for j in range(i+1, n):\n if distance(points[i], po... | ['Wrong Answer', 'Accepted'] | ['s836224273', 's190748243'] | [3188.0, 3064.0] | [20.0, 18.0] | [340, 353] |
p02982 | u687173709 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nN,D= map(int,input().split())\n\nA=[[int(a) for a in input().split()]for a in range(N)]\n\ndef int_test(a,n):\n if a.is_integer():\n n+=1\n\nn=0\n\n\nfor i in range(0,N):\n\n if i != N:\n for j in range(i+1,N):\n sq=0.0\n for k in range(0,D):\n sq=... | ['Wrong Answer', 'Accepted'] | ['s348689341', 's374073786'] | [3064.0, 3064.0] | [18.0, 17.0] | [610, 449] |
p02982 | u687443343 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['N, D = map(int,input().split())\nK = [list(map(int,input().split()))for x in range(N)]\nans = 0\nfor i in range(N-1):\n for j in range(i+1,N):\n goukei=0\n for a,b in zip(K[i],K[j]):\n goukei += (a-b)**2\n ans += (goukei**0.5).is_integer()\nprint(K)', 'N, D = map(int,input().split())\nK = [list(map(int... | ['Wrong Answer', 'Accepted'] | ['s458894193', 's505814246'] | [3060.0, 3188.0] | [18.0, 18.0] | [255, 257] |
p02982 | u692453235 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['\nN, D = map(int, input().split())\nPs = []\ncount = 0\n\nfor i in range(N):\n P = list(map(int, input().split()))\n Ps.append(P)\n\ndef dis2(A, B):\n dis = 0\n for i in range(D):\n dis += (A[i] - B[i])**2\n return dis\n\nfor i in range(N-1):\n for j in range(i+1, N):\n if math.sqrt(dis2(Ps[i], Ps[j])).is... | ['Runtime Error', 'Accepted'] | ['s477134425', 's065775544'] | [3064.0, 3064.0] | [17.0, 19.0] | [343, 355] |
p02982 | u695655590 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['N,D = map(int, input().split())\n\nif D == 1:\n print(N * (N-1) // 2)\nelse:\n A = [0] * D\n count = 0\n sei = 0\n\n for i in range(0,N):\n\t A[i] = list(map(int, input().split()))\n \n for p in range(0,N):\n for q in range(0,N):\n sum = 0\n \n for r in range(0,D):\n s... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s488373319', 's872021718', 's087479228'] | [3188.0, 3064.0, 3064.0] | [18.0, 18.0, 19.0] | [505, 432, 504] |
p02982 | u697696097 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['n,d=map(int, readline().rstrip().split())\nm=[]\nfor _ in range(n):\n arr=list(map(int, readline().rstrip().split()))\n m.append(arr)\nans=0\nfor i in range(n-1):\n for j in range(i+1,n):\n a = 0\n for k in range(d):\n a += (m[i][k] - m[j][k])**2\n x = int(a**(1/2))\n i... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s001481784', 's254094103', 's091867052'] | [9036.0, 9448.0, 9456.0] | [25.0, 29.0, 31.0] | [365, 359, 343] |
p02982 | u719886494 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['n, d = (int(i) for i in input().split())\nnum = list((list(map(int, input().split())) for j in rage(n)))\nsum = 0\ncnt = 0\nfor k in range(n - 1) :\n for h in range(d) :\n sum += (num[k][h] - num[k + 1][n])**2\n if (isinstance(sum **(1 / 2)), int) :\n cnt += 1\n sum = 0\nprint(sum)', 'n, d = (int(i) for i in... | ['Runtime Error', 'Accepted'] | ['s828923646', 's733525420'] | [3060.0, 3188.0] | [17.0, 18.0] | [281, 360] |
p02982 | u724428568 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['print(5.0 == 5)', 'import math\nimport itertools\nN, D = map(int, input().split())\n\nnums = []\nfor _ in range(N):\n nums.append(list(map(int, input().split())))\n\ncom = itertools.combinations(nums, 2)\nans =0\nfor c in com: \n d = 0\n for y, z in zip(c[0], c[1]):\n d += abs(y - z) ** 2\n d = mat... | ['Wrong Answer', 'Accepted'] | ['s528395251', 's013569934'] | [2940.0, 3064.0] | [17.0, 19.0] | [15, 343] |
p02982 | u726218285 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nimport itertools\n\n\nN, D = (int(i) for i in input().split())\nX = [0]*N\n\n\nfor n in range(N):\n l = input().split()\n X[n]=[0]*D\n for d in range(D):\n X[n][d] = int(l[d])\n\n\ncount = 0\nfor y, z in itertools.combinations(X, 2):\n print(f"y={y}, z={z}")\n d = math.sqrt(sum(pow(... | ['Runtime Error', 'Accepted'] | ['s493139755', 's477758517'] | [2940.0, 3064.0] | [17.0, 19.0] | [392, 367] |
p02982 | u728566015 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['mport math\n\nN, D = map(int, input().split())\nX = [list(map(int, input().split())) for i in range(N)]\n\ncnt = 0\nfor i in range(N):\n for j in range(i + 1, N):\n dis = 0\n for d in range(D):\n dis += (X[i][d] - X[j][d])**2\n if math.sqrt(dis) == int(math.sqrt(dis)):\n ... | ['Runtime Error', 'Accepted'] | ['s648148284', 's092152025'] | [2940.0, 3064.0] | [17.0, 17.0] | [326, 330] |
p02982 | u728615412 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import numpy as np\nND = list(map(int,input().split()))\nLis = []\nfor i in range(ND[0]):\n a =list(map(int,input().split()))\n Lis.append(a)\nLisnp = np.array(Lis)\nCount = 0\nfor k in range(ND[0]):\n for g in range(k):\n u = Lisnp[k] - Lisnp[i]\n norm = np.linalg.norm(u)\n if norm.is_... | ['Wrong Answer', 'Accepted'] | ['s842760909', 's445350626'] | [12508.0, 12508.0] | [149.0, 149.0] | [352, 352] |
p02982 | u729300713 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nn, d = map(int, input().split())\nx = [[0 for i in range(d)] for j in range(n)]\nfor i in range(n):\n x[i] = map(int, input().split())\n\nresult = 0\nfor i in range(n):\n for j in range(n-1):\n diff = map(lambda x,y: (x-y)*(x-y), x[i],x[j])\n calc = math.sqrt(sum(diff))\n if calc.is_integer():... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s130476230', 's490583378', 's706136538', 's760059226', 's734151892'] | [3064.0, 3064.0, 3064.0, 3064.0, 3064.0] | [17.0, 17.0, 17.0, 18.0, 18.0] | [338, 339, 330, 371, 356] |
p02982 | u739959951 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['n,d=map(int,input().split())\n\nl=[]\nfor _ in range(n):\n l1=[map(int,input().split())]\n l.append(l1)\n\nimport math\n\nans=[]\nfor a in range(n):\n for b in range(n):\n a=0\n for c in range(d):\n D=(l[a][c]-l[b][c])**2\n a+=D\n ans.append(isinstance(math.sqrt(a),int))\n \nans=sum(ans)-n\... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s123976780', 's158671875', 's357244502', 's518947818', 's604460134'] | [3064.0, 3064.0, 3064.0, 3064.0, 3064.0] | [17.0, 17.0, 17.0, 17.0, 18.0] | [310, 322, 330, 327, 331] |
p02982 | u740284863 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['n,d = map(int,input().split())\nobj = [list(map(int,input().split())) for _ in range(n)]\nans = 0\nfor i in range(n):\n for j in range(n):\n if i == j:\n pass\n else:\n dis = 0\n for k in range(d):\n dis += (obj[i][k] - obj[j][k])**2\n dis = ... | ['Runtime Error', 'Accepted'] | ['s538483000', 's653951651'] | [3064.0, 3064.0] | [17.0, 18.0] | [388, 389] |
p02982 | u745561510 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['N, D = map(int, input().split())\n\nx = [list(map(int, input().split())) for i in range(N)]\n\nans = 0\nfor i in range(N):\n for j in range(N):\n if i == j:\n continue\n else:\n tmp = 0\n for k in range(D):\n tmp += (x[i][k] - x[j][k]) ** 2\n ... | ['Wrong Answer', 'Accepted'] | ['s492754976', 's809373442'] | [3064.0, 3188.0] | [18.0, 17.0] | [423, 400] |
p02982 | u746206084 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import numpy as np\nn,d = map(int,input().split())\nans=0\ng=[]\nif d==1:\n ans=n*(n-1)//2\n print(ans)\nelse:\n for _ in range(n):\n for i in range(len(g)):\n\t lis = np.array(list(map(int,input().split())))\n \tu = g[i]-lis\n z=np.linalg.norm(u)\n if z-int(z)==0:\n ans+=1\n g.a... | ['Runtime Error', 'Accepted'] | ['s052602239', 's530862258'] | [2940.0, 12504.0] | [17.0, 149.0] | [325, 440] |
p02982 | u749614185 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['n,d=[int(x) for x in input().rstrip().split()]\n \nl=[]\nfor i in range(n):\n X=[int(x) for x in input().rstrip().split()]\n l.append(X)\n \nans=0\nfor i in range(n):\n ni=l[i]\n for j in range(i+1,n):\n nj=l[j]\n now=0\n for s in range(d):\n now+=(ni[s]-nj[s])**2\n now=now**0.5', 'N,D=[int(x) fo... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s237143192', 's277121854', 's389073327', 's636249026'] | [9368.0, 9408.0, 8936.0, 27176.0] | [28.0, 28.0, 24.0, 119.0] | [285, 285, 427, 285] |
p02982 | u753682919 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['N,D=map(int,input().split())\nL=[list(map(int,input().split())) for i in range(N)]\nn=0\nfor i in range(N):\n for j in range(i):\n for k in range(D):\n DD=0\n DD+=(L[i][k]-L[j][k])**2\n if any(n**2==DD for n in range(1,80)):\n n+=1\nprint(n)', 'N,D=map(int,input().split())\nL=[list(map(int,input... | ['Wrong Answer', 'Accepted'] | ['s795075778', 's580048937'] | [3060.0, 3060.0] | [18.0, 20.0] | [253, 252] |
p02982 | u754733706 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['N,D = [int(i) for i in input().split()]\nfor i in range(N):\n lagd.append([int(i) for i in input().split()])\nlngs = D - 1\ndef kyoricac(daone,datwo,d):\n keka = []\n n = 0\n wa = 0\n while n <= d:\n wa = (daone[n] - datwo[n])**2\n keka += [wa]\n n += 1\n wa = sum(keka)\n kae... | ['Runtime Error', 'Accepted'] | ['s879894046', 's089260211'] | [3064.0, 3064.0] | [18.0, 18.0] | [543, 553] |
p02982 | u755180064 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['\nurl = "https://atcoder.jp//contests/abc133/tasks/abc133_b"\nimport itertools\ndef main():\n n,d = list(map(int, input().split()))\n lis = []\n for i in range(n):\n t = list(map(int, input().split()))\n lis.append(t)\n count = 0\n for i in range(len(lis)):\n for j in range(i+1, le... | ['Wrong Answer', 'Accepted'] | ['s938308543', 's287679976'] | [9084.0, 9004.0] | [31.0, 25.0] | [704, 702] |
p02982 | u756399469 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['N, D = map(int, input().split())\nx = [None for k in range(N)]\nfor k in range(N):\n a = list(map(int, input().split()))\n x[k] = a\nans = 0\nfor n in range(N):\n for p in range(n-1):\n wa = 0\n for d in range(D):\n wa += (x[n][d] - x[p][d])**2\n t = wa ** 0.5\n if type(t) is int:\n ans += 1\... | ['Wrong Answer', 'Accepted'] | ['s734064797', 's630999361'] | [3064.0, 3064.0] | [20.0, 18.0] | [315, 315] |
p02982 | u762469320 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import numpy as np\nn,d = list(map(int,input().split()))\nt = np.array([list(map(int,input().split())) for i in range(n)])\ncnt = 0\n\nfor i in range(n):\n\tfor h in range(n):\n\t\tx = (sum((t[i]-t[h])**2))**0.5\n\t\tif x % 1 == 0:\n\t\t\tcnt += 1\n\tnp.delete(t,i,0)\n\t\t\t\nprint(int(cnt-n))', 'import numpy as np\n... | ['Wrong Answer', 'Accepted'] | ['s641863251', 's595033904'] | [14420.0, 13096.0] | [153.0, 166.0] | [270, 256] |
p02982 | u764956288 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import numpy as np\n\nN, D = map(int, input().split())\n\npoints = [list(map(int, input().split())) for _ in range(N)]\n\ndef distance(p1, p2):\n squares = np.square(np.arange(p1) - np.arange(p2))\n return np.sqrt(squares.sum())\n\ncount = 0\nfor i in range(N):\n for j in range(N):\n if i != j:\n dist = di... | ['Runtime Error', 'Accepted'] | ['s340941801', 's252262135'] | [12408.0, 12408.0] | [149.0, 150.0] | [384, 357] |
p02982 | u766393261 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import numpy as np\nN,D=map(int,input().split())\nX=[]\ndist=[]\nXsumnow=0\nXsumnext=0\n\nfor i in range(N):\n X.append([int(j) for j in input().split()])\ncount=N\nfor m in range(N):\n for j in range(m+1,N):\n for k in range(D):\n Xsumnow+=abs(X[j][k]-X[m][k])*abs(X[j][k]-X[m][k])\n di... | ['Wrong Answer', 'Accepted'] | ['s639404014', 's928850114'] | [12448.0, 12440.0] | [150.0, 150.0] | [459, 462] |
p02982 | u766566560 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import sys,math\ninput = sys.stdin.readline\n\nN, D = map(int, input().split())\nX = [list(map(int, input().split())) for _ in range(N)]\ncnt = 0\nnum = 0\n\nprint(X)\n\nfor i in range(1,N):\n for j in range(1,D):\n #num += pow(abs(X[i-1][j-1] - X[i][j]) ,2)\n print(X[i-1][j-1],X[i][j])\n #if int(math.sqr... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s063504688', 's154278101', 's234563641', 's038196616'] | [3064.0, 3064.0, 3064.0, 3064.0] | [18.0, 17.0, 18.0, 18.0] | [366, 361, 315, 356] |
p02982 | u771167374 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['n, d = map(int, input().split())\nL = [list(map(int, input().split())) for i in range(n)]\nfor i in range(n-1):\n for j in range(i+1, n):\n ans = 0\n int_ = 0\n for k in range(d):\n int_ += (L[i][k]-L[j][k])**2\n if int(int_**0.5)==int_**0.5:\n ans += 1\nprint(ans)... | ['Wrong Answer', 'Accepted'] | ['s722055564', 's875237179'] | [3064.0, 3064.0] | [18.0, 18.0] | [308, 309] |
p02982 | u774160580 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import numpy as np\n\nN, D = list(map(int, input().split()))\nX = []\nfor i in range(D):\n x_i = [int(i) for i in input().split()]\n X.append(i)\nX = np.array(X)\n\nans = 0\nfor i in range(D):\n for j in range(i + 1, D):\n if np.is_integer(np.sqrt(np.sum(X[i] - X[j]) ** 2)):\n ans += 1\npri... | ['Runtime Error', 'Accepted'] | ['s461229787', 's337525565'] | [12448.0, 12448.0] | [148.0, 148.0] | [312, 314] |
p02982 | u776338097 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['n, d = map(int, input().split())\npoints = [[]] * n\nfor i in range(n):\n points[i] = list(map(int, input().split()))\n\ndef helper(a, b):\n s = 0\n for i in range(n):\n s += (a[i] - b[i]) ** 2\n a = int(0.5 + (s ** 0.5))\n if a * a == s:\n return 1\n return 0\n\nans = 0\nfor i in range(n):\n\tfor j in ra... | ['Runtime Error', 'Accepted'] | ['s989974029', 's984421974'] | [3064.0, 3188.0] | [18.0, 17.0] | [364, 375] |
p02982 | u780698286 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['n, d = map(int, input().split())\nx = [list(map(int, input().split())) for i in range(n)]\ncnt = 0\nfor i in range(n):\n for j in range(i+1, n):\n a = x[i]\n b = x[j]\n z = 0\n for k in range(d):\n z += (a[k] - b[k]) ** 2\n if math.sqrt(z) % 1 == 0:\n cnt += 1\nprint(cnt)', 'import math\n\nn... | ['Runtime Error', 'Accepted'] | ['s044328482', 's237058891'] | [9136.0, 9084.0] | [28.0, 27.0] | [286, 299] |
p02982 | u784022244 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import numpy as np\nN, D =map(int, input().split())\n\nX_matrix=[]\nfor i in range(N):\n X = list(map(int, input().split()))\n X_matrix.append(X)\ncount=0 \nprint(X_matrix)\nfor i in range(N-1):\n for j in range(i+1, N):\n dd=0\n for k in range(D):\n dd+=(X_matrix[i][k] - X_matrix[j][k])**2\n d=np.s... | ['Wrong Answer', 'Accepted'] | ['s702874789', 's154880356'] | [12420.0, 13224.0] | [149.0, 168.0] | [362, 346] |
p02982 | u789290859 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\n\ndef colcu (bli,ali,D):\n num = 0\n for i in range(D):\n num += (bli[i] - ali[i]) ** 2\n return math.sqrt(num)\n\nN,D = map(int, input().split())\npli = []\nfor i in range(N):\n pli.append(list(map(int, input().split())))\n\nan = 0\nfor i in range(N-1):\n for t in range(i+1,N):\n if... | ['Wrong Answer', 'Accepted'] | ['s378340435', 's435469692'] | [9128.0, 9136.0] | [31.0, 23.0] | [401, 366] |
p02982 | u795733769 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\n\nn, d = map(int, input().split())\nx = [list(int, input().split()) for i in range(n)]\ncnt = 0\nfor i in range(n):\n for j in range(i+1, n):\n for k in range(d):\n dis = 0\n dis += (x[i][k]-x[j][k])**2\n if math.sqrt(dis) % 1 == 0:\n cnt += 1\npr... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s293160344', 's654894717', 's770367697', 's171428709'] | [9008.0, 9196.0, 9200.0, 9112.0] | [25.0, 30.0, 28.0, 28.0] | [314, 315, 319, 307] |
p02982 | u796563423 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import numpy as np\nfrom scipy.special import comb\nn,d=map(int,input().split())\nx=[]\ntotal=0\nfor i in range(n):\n x.append(list(map(int,input().split())))\nfor i in range(n):\n for j in range(n):\n if i!=j:\n a=np.array(x[i])\n b=np.array(x[j])\n u=b-a\n pr... | ['Wrong Answer', 'Accepted'] | ['s897119801', 's099125746'] | [41888.0, 42200.0] | [187.0, 185.0] | [425, 393] |
p02982 | u797848138 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nn, a = map(int, input().split())\n\nvc = []\n\ndef isqrt(n):\n x = n\n y = (x + 1) // 2\n while y < x:\n x = y\n y = (x + n // x) // 2\n return x\n\nfor i in range(n):\n v = list(map(int, input().split()))\n vc.append(v)\n\ncc = 0\nfor k, i in enumerate(vc):\n if len(vc... | ['Wrong Answer', 'Accepted'] | ['s659722735', 's872886247'] | [3064.0, 3064.0] | [19.0, 18.0] | [542, 505] |
p02982 | u800058906 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nn,d=map(int,input().split())\n\nx=[]\nfor i in range(n):\n x.append(list(map(int,input().split())))\n\ncnt=0\n\nfor i in range(n-1):\n for j in range(i+1,n):\n d=0\n for k in range(d):\n d+=(x[i][k]-x[j][k])**2\n if int(math.sqrt(d))**2==d:\n cnt+=1\nprint(cnt)', 'import math\nn,d=ma... | ['Wrong Answer', 'Accepted'] | ['s284789800', 's510070025'] | [8972.0, 9128.0] | [29.0, 23.0] | [279, 289] |
p02982 | u802772880 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nn,d=map(int,input().split())\nx=[list(map(int,input().split())) for i in range(n)]\ncnt=0\ndis=0\nif d==1:\n print(n*(n-1)//2)\nelse:\n for i in range(n-1):\n for j in range(i+1,n):\n distance=0\n dis=0\n for k in range(d):\n dis+=(x[i][k]-x[j]... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s167326029', 's823422811', 's307295840'] | [3064.0, 3064.0, 3064.0] | [18.0, 18.0, 17.0] | [462, 439, 433] |
p02982 | u805332733 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ["N, _ = (int(i) for i in input().split())\ndata = [int(int(i) for i in input().split()) for i in range(N)]\n\nimport numpy as np\nfrom scipy.spatial import distance\n\ndistance = distance.cdist(data, data, metric='euclidean')\ncount = 0\nfor n in range(0,N):\n for d in range(n+1,N):\n if distance[n][d].is_integer(... | ['Runtime Error', 'Accepted'] | ['s882409940', 's875423229'] | [3064.0, 19440.0] | [18.0, 299.0] | [363, 360] |
p02982 | u810978770 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import numpy as np\nimport math\nN ,D = map(int , input().split(" "))\n\nx = np.array(input().split(" ") , dtype="int32")\nans = 0\nfor i in range(N-1):\n x = np.append(x, np.array(input().split(" ") , dtype="int32"))\nprint(x)\nx = x.reshape(N , D)\nprint(x)\nfor i in range(N):\n for n in range(i+1 , N):\n ... | ['Wrong Answer', 'Accepted'] | ['s295887389', 's050932114'] | [12468.0, 12508.0] | [155.0, 165.0] | [423, 405] |
p02982 | u811817592 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nn,d=input().split()\nn=int(n)\nd=int(d)\ndef combinations(n, r):\n return math.factorial(n)/(math.factorial(n-r)*math.factorial(r))\nx=[]\nfor i in range(n):\n xa=[int(s) for s in input().split()]\n x.append(xa)\n a=[]\nfor i in range(n-1):\nfor j in range(i+1,n):\n t=[]\n for k in rang... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s304880818', 's636259111', 's922417815', 's032256133'] | [2940.0, 3064.0, 3188.0, 3064.0] | [17.0, 18.0, 18.0, 18.0] | [554, 655, 647, 592] |
p02982 | u813452457 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['N, D = map(int,input().split())\nli = []\nfor _ in range(N):\n li.append(list(map(int,input().split())))\n\ns = 0\nc = 0\nfor n in range(-1,N-1):\n for d in range(D):\n s = s + abs(li[n][d] - li[n+1][d]) ** 2\n if (s**(1/2)).is_interger():\n c += 1\n s = 0', 'N, D = map(int,input().split())\... | ['Runtime Error', 'Accepted'] | ['s704904142', 's186623235'] | [3064.0, 3188.0] | [17.0, 18.0] | [270, 362] |
p02982 | u814986259 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['N,D=map(int,input().split())\nfor i in range(N):\n X[i]=list(map(int,input().split()))\ncount=0\nfor i in range(N):\n for j in range(i,N):\n dis=0\n for k in range(D):\n dis += pow(X[i][k],2) + pow(X[j][k],2) \n dis = sqrt(dis)\n if dis==int(dis):\n count+=1\nprint(count)', 'import math\nN,D=m... | ['Runtime Error', 'Accepted'] | ['s619668449', 's949597538'] | [3064.0, 3064.0] | [18.0, 18.0] | [284, 312] |
p02982 | u816462023 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nz=[]\nans=0\nsumsum=0\nN,D=(int(x) for x in input().split())\nfor i in range(N):\n a=input().split()\n print(a)\n z.append(a)\n#print(z)\n\nfor i in range(N):\n for j in range(i,N):\n for k in range(D):\n sumsum=sumsum+(int(z[i][k])-int(z[j][k]))**2\n if sumsum!=0 and... | ['Wrong Answer', 'Accepted'] | ['s710763525', 's898505989'] | [3064.0, 3064.0] | [18.0, 18.0] | [379, 379] |
p02982 | u816935184 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import numpy as np\n\n\nn,d=map(int,input().split())\nx=[]\nX=[]\ncnn=0\nfor i in range(n):\n x=input().split()\n x=[int(i) for i in x]\n X.append(x)\n\nfor i in range(n-1):\n for j in range(n-i,n,1):\n a=np.array(X[i])\n b=np.array(X[i+1])\n u=b-a\n if u==int(u):\n ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s711594799', 's854208218', 's825489052'] | [12484.0, 12428.0, 21696.0] | [149.0, 152.0, 312.0] | [317, 347, 364] |
p02982 | u821712904 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['n,d=map(int,input().split())\nx=[list(int(i) for i in input().split()) for _ in range(n)]\ndis=0\nans=1\nfor i in x:\n for j in x:\n for k in range(d):\n dis+=(i[k]-j[k])*(i[k]-j[k])\n if dis**0.5%1==0:\n ans+=1\nprint(ans*(ans-1)//2)\n', 'n,d=map(int,input().split())\nx=[list(int(i) for i in input()... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s849854505', 's876103074', 's040932827'] | [3060.0, 3188.0, 3064.0] | [18.0, 19.0, 18.0] | [242, 237, 250] |
p02982 | u823885866 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import sys\nimport numpy as np\n\nrm = lambda: map(int, sys.stdin.readline().split())\nrl = lambda: list(map(int, sys.stdin.readline().split()))\nfor i in range(n):\n for j in range(i):\n a = sum((li[i] - li[j]) ** 2)**0.5\n if a - a//1 == 0:\n cnt += 1\nprint(cnt)', 'import sys\nimport numpy as np\nrm = ... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s369167570', 's576988193', 's670421125', 's719985385'] | [27072.0, 26936.0, 27284.0, 27260.0] | [112.0, 114.0, 118.0, 117.0] | [267, 276, 571, 345] |
p02982 | u830616191 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import numpy as np\nn,d = map(int,input().split())\nlist=[list(map(int,input().split())) for i in range(n)]\narr_list = np.array(list)\ncount = 0\nfor i in range(n):\n for j in range(i+1,n):\n if(i != j):\n distance = 0.0\n for k in range(d):\n distance += (arr_list[i][k... | ['Wrong Answer', 'Accepted'] | ['s340471772', 's212173416'] | [12472.0, 12468.0] | [150.0, 150.0] | [532, 488] |
p02982 | u835467030 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nN, D = map( int, input().split() )\nX = [list(map(int, input().split())) for _ in range(N)]\nresult = 0\n\nfor i in range(N):\n for j in range(i, N):\n if i != j:\n tmp = 0.0\n for k in range(D):\n tmp += abs(X[i][k] - X[j][k]) ** 2\n tmp = math.s... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s177991075', 's217738254', 's340732027', 's238515229'] | [3060.0, 3188.0, 3060.0, 3064.0] | [18.0, 20.0, 17.0, 18.0] | [415, 414, 342, 391] |
p02982 | u836939578 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['def dist(a, b):\n res = 0\n for i in range(D):\n res += (a[i] - b[i]) ** 2\n res = res ** 0.5\n\nN, D = map(int, input().split())\nX = [list(map(int, input().split())) for i in range(N)]\nans = 0\nfor i in range(N - 1):\n for j in range(i +1, N):\n if dist(X[i], X[j]).is_integer():\n ans += 1\nprint(... | ['Runtime Error', 'Accepted'] | ['s828211390', 's345178896'] | [3188.0, 3060.0] | [18.0, 18.0] | [315, 342] |
p02982 | u842043169 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nR = lambda : map(int,input().split())\nn,d = R()\nxs = [list(R()) for _ in range(n)]\n\ndef dist(y,z):\n return math.sqrt(sum([(y[i]-z[i])**2 for i in range(d)]))\n\n\ncount = 0\nfor i in range(n):\n for j in range(i+1,n):\n d = dist(xs[i],xs[j])\n if int(d)==d:\n count+=1\... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s057018425', 's944609541', 's258614636'] | [3064.0, 3064.0, 3064.0] | [18.0, 18.0, 18.0] | [316, 577, 684] |
p02982 | u847165882 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['num=input()\nK,X=[int(s) for s in num.split(" ")]\n\nmax=X+(K-1)\nmin=X-(K-1)\n\nlist=[]\nfor i in range(min,max+1,1):\n list.append(i)\n\nans=" ".join(map(str,list))\n\nprint(ans)', 'import math\nN,D=map(int,input().split(" "))\nX=[input().split(" ") for _ in range(N)]\n\nAns_List=[]\nfor i in range(N):\n for ... | ['Wrong Answer', 'Accepted'] | ['s235244261', 's820866915'] | [3064.0, 3064.0] | [17.0, 18.0] | [171, 365] |
p02982 | u847605090 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['n,d=map(int,input().split())\nx=[list(map(int,input().split())) for i in range(n)]\nans=0\nfor i in range(n):\n for j in range(i+1,n):\n tmp=0\n for k in range(d):\n tmp+=abs(x[i][d]-x[j][d])**2\n tmp=tmp**0.5\n if tmp==int(tmp):1\n ans+=1\nprint(ans)', 'n,d=map(int,input().split())\nx=[list(ma... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s312746840', 's830420071', 's136898634'] | [3060.0, 2940.0, 3060.0] | [17.0, 17.0, 18.0] | [263, 245, 285] |
p02982 | u850200768 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nN, D = map(int, input().split())\np=[]\nfor _ in range(N):\n p.append(list(map(int, input().split())))\n\ndis=[]\nfor a in p:\n for b in p:\n n = 0\n for i in range(D):\n n = n + (a[i]-b[i])**2\n if not n==0:\n dis.append(n)\nprint(len([d for d in dis if i... | ['Wrong Answer', 'Accepted'] | ['s291884767', 's829955332'] | [3064.0, 3064.0] | [17.0, 18.0] | [331, 332] |
p02982 | u855665975 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\n\nN, D = map(int, input().split())\nX = [list(map(int, input().split())) for _ in range(N))]\ncnt = 0\n\nfor i in range(N - 1):\n for j in range(i + 1, N):\n tmp = 0\n for k in range(D):\n tmp += ((X[i][k] - X[j][k])** 2)\n tmp = math.sqrt(tmp)\n if tmp.is_integer:\n cnt += 1... | ['Runtime Error', 'Accepted'] | ['s378897442', 's897718235'] | [8948.0, 9048.0] | [26.0, 27.0] | [318, 343] |
p02982 | u855819610 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\nN,D=map(int,input().split())\nX = [list(map(int,input().split())) for i in range(N)]\ncount = 0\nfor j in range(N-1):\n for k in range(j+1,N):\n L = 0\n for l in range(D):\n L += (X[j][l]-X[k][l])**2\n print(L)\n if math.sqrt(L).is_integer() == True:\n ... | ['Wrong Answer', 'Accepted'] | ['s445271945', 's413962126'] | [3064.0, 3064.0] | [18.0, 18.0] | [335, 314] |
p02982 | u859897687 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['n,d=map(int,input().split())\nx=[]\nfor _ in range(d):\n x+=[list(map(int,input().split()))]\nans=0\nfor i in range(d):\n for j in range(i+1,d):\n l=0\n for k in range(n):\n l+=(x[i][k]-x[j][k])**2\n l=l**0.5\n if l.is_integer():\n ans+=1\nprint(ans)', 'n,d=map(int,input().split())\nx=[]\nfor ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s125043529', 's586733028', 's939153960'] | [3188.0, 3188.0, 3188.0] | [18.0, 18.0, 18.0] | [261, 246, 261] |
p02982 | u863397945 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['#! python3\n# solve_133B.py\n\nimport math\n\ndef dis(Y,Z):\n ans = 0\n for i in range(len(Y)):\n ans += (Y[i] - Z[i])**2\n return math.sqrt(ans)\n\n\nN,D = map(int,input(().split()))\nX = []\nans = 0\n\nfor i in range(N):\n X.append(list(map(int,input().split())))\n\nfor i in range(N):\n for j... | ['Runtime Error', 'Accepted'] | ['s951355269', 's928761310'] | [9128.0, 9208.0] | [21.0, 29.0] | [374, 377] |
p02982 | u864276028 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['N,D = map(int,input().split())\nP = []\nfor i in range (N):\n P.append(list(map(int, input().split())))\nPi = 0\nfor i in range(N):\n for j in range(i+1, N):\n Di = 0\n for k in range (D):\n Di += (P[i][k]-P[j][k])**2\n if int(Di**0.5) == dist**0.5:\n Pi += 1\nprint(Pi... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s007836866', 's290294302', 's510308013'] | [3060.0, 2940.0, 3064.0] | [17.0, 17.0, 18.0] | [307, 355, 305] |
p02982 | u866769581 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ["# b.py\nn,d = map(int,input().split())\nlis = [list(map(int,input().split())) for x in range(n)]\nans = 0\nfor xli in range(n-1):\n for yli in range(xli,n):\n le = 0\n for x,y in zip(lis[xli],lis[yli]):\n le += (y-x) **2\n print(xli,yli,'xli','yli')\n print((le**0.5)//1,le**0... | ['Wrong Answer', 'Accepted'] | ['s817761956', 's655867199'] | [3064.0, 3060.0] | [18.0, 19.0] | [440, 442] |
p02982 | u867736259 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['a,b = map(int,input().split())\nc = [list(map(int,input().split())) for j in range(a)]\nans = 0\nfor l in range(a-1):\n for k in range(l+1,a):\n d = [(x-y)**2 for (x, y) in zip(c[l], c[k])]\n g = sum(d)\n if (g**0.5).is_integer:\n ans += 1\nprint(ans)', 'a,b = map(int,input().split(... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s171534542', 's854976543', 's457156777'] | [3064.0, 3064.0, 3064.0] | [18.0, 17.0, 18.0] | [277, 265, 291] |
p02982 | u872030436 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['N, D = map(int, input().split())\narX = [list(map(int, input().split()))[:D] for n in range(N)]\n\nimport math\n\ncount = 0\nfor x in range(len(arX)):\n xp = arX[x]\n for y in range(x, len(arX)):\n if x == y:\n continue\n \n yp = arX[y]\n \n powSum = 0\n for ... | ['Runtime Error', 'Accepted'] | ['s213733979', 's508351670'] | [3064.0, 3064.0] | [17.0, 17.0] | [546, 526] |
p02982 | u873134970 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import numpy as np\n\nn,d=map(int,input().split())\narr=np.array((n,d))\nfor i in range(n):\n arr[i]=np.array(list(map(float,input().split())))\nans=0\nfor i in range(n):\n for j in range(i,n):\n if j!=i:\n k = np.linalg.norm(arr[i]-arr[j],ord=2)\n else:\n k=np.nan\n if k==int(k):\n ans +=1\... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s010180411', 's642122443', 's847697979'] | [12424.0, 12504.0, 12468.0] | [150.0, 151.0, 150.0] | [314, 310, 311] |
p02982 | u873422538 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['# -*- coding: utf-8 -*-\nimport sys\nimport numpy as np\nfrom itertools import combinations\n\n\ndef answer(l):\n results = []\n for i, j in combinations(l, 2):\n v_a = np.array(i)\n v_b = np.array(j)\n results.append(np.linalg.norm(v_a - v_b))\n return sum(float.is_integer(i) for i in r... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s203623128', 's225849527', 's385153667', 's542853954', 's571975937', 's588458607', 's707279470', 's110523901'] | [12252.0, 12252.0, 21416.0, 12284.0, 12284.0, 12284.0, 12284.0, 12500.0] | [149.0, 148.0, 284.0, 149.0, 148.0, 149.0, 147.0, 152.0] | [441, 486, 486, 486, 486, 486, 486, 364] |
p02982 | u889344512 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['5 1\n1\n2\n3\n4\n5', 'import math\nn,d = map(int,input().split())\nx = []\nfor i in range(0,n):\n x.append(list(map(int,input().split())))\ndef f(a,b):\n s = 0\n for l in range(0,d):\n s+=(a[l]-b[l])**2\n return math.sqrt(s)\ncount = 0\nfor j in range(0,n):\n for k in range(0,n):\n if not... | ['Runtime Error', 'Accepted'] | ['s156992072', 's858150159'] | [2940.0, 3064.0] | [17.0, 18.0] | [13, 380] |
p02982 | u891482208 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['n, d = list(map(int, input().split()))\np = []\nans = 0\nfor i in n:\n p.append(list(map(int, input().split())))\n for j in range(i):\n s = 0\n for k in d:\n s += (p[i] - p[j]) ** 2\n t = int(s ** 0.5 + 1e-7)\n if t * t == s:\n ans += 1\nprint(ans)', 'n, d = list(map(int, input().split()))\np ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s252527140', 's484857121', 's684288558'] | [3060.0, 3064.0, 3064.0] | [18.0, 18.0, 17.0] | [260, 266, 280] |
p02982 | u895526251 | 2,000 | 1,048,576 | There are N points in a D-dimensional space. The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}). The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 + ... + (y_D - z_D)^2}. How many pairs (i, j) (i < j) are there such ... | ['import math\n\nn, d = tuple([int(s) for s in input().split()])\nx = [[0]*d for i in range(n)]\n\nfor i in range(n):\n x_t = [int(s) for s in input().split()]\n x[i] = x_t\n\ncnt_fit = 0\n\nfor i in range(n-1):\n for j in range(i+1, n):\n sumd = 0\n for k in range(d):\n sumd += (x[i][... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s352094313', 's676129923', 's837534173'] | [3064.0, 3064.0, 3064.0] | [17.0, 18.0, 17.0] | [448, 450, 430] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.