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 | u276204978 | 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\nX = []\n\nfor i in range(N):\n X.append([int(i) for i in list(input().split())])\n\nres = 0\nX = np.array(X)\nfor i in range(N):\n if i == j:\n continue\n for j in range(i + 1, N):\n if np.linalg.norm(X[i] - X[j]).is_integer():\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s429147037', 's849319951', 's385999543'] | [12504.0, 12504.0, 12504.0] | [147.0, 152.0, 150.0] | [326, 326, 294] |
p02982 | u278057806 | 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\na = 0\nb = 0\nN, D = map(int, input().split())\nls = [list(map(int, input().split()))for i in range(N)]\nfor i in range(N):\n for j in range(i, N):\n for k in range(D):\n a += (ls[i][k] - ls[j][k]) ** 2\n if math.sqrt(a).is_integer() is True:\n b += 1\n\npri... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s034477882', 's337823456', 's668187012', 's799254988', 's419254144'] | [3064.0, 3060.0, 3060.0, 3060.0, 3060.0] | [18.0, 18.0, 18.0, 18.0, 18.0] | [312, 316, 324, 312, 320] |
p02982 | u289858521 | 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.append(list(map(int,input().split())))\n\ndef distance(a, b):\n dist = 0\n \n for a, b in zip(a, b):\n dist += (a - n) ** 2\n\n if dist == 0:\n return False\n return int(dist ** 0.5) ** 2 == dist\n\ncount = 0\n\nfor pa in points:\... | ['Wrong Answer', 'Accepted'] | ['s257142724', 's812553981'] | [9396.0, 9464.0] | [29.0, 26.0] | [380, 380] |
p02982 | u293198424 | 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 i in range(n):\n xi = [int(i) for i in input().split()]\n x.append(xi)\ncount = 0\nans = 0\nfor i in range(n-1):\n for l in range(i+1,n):\n ans = 0\n for j in range(d):\n ans += (x[i][j]-x[l][j])**2\n\n ans = ans **(1/2)\n pri... | ['Wrong Answer', 'Accepted'] | ['s755388596', 's767950228'] | [3064.0, 3064.0] | [18.0, 17.0] | [380, 361] |
p02982 | u294385082 | 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())\nw = [list(map(int,input().split())) for a in range(n)]\nc = 0\n \nfor i in range(n-1):\n for j in range(i+1,n):\n b = 0\n for m in range(d):\n b += (w[i][m]-w[j][m])**2\n if (b**0.5)\u3000== float(int(b**0.5)):\n c += 1\n \nprint(c)', 'n,d = map(int,input().spl... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s008309396', 's314555853', 's368100100', 's656825967', 's664696530', 's876116578', 's962544400', 's491800686'] | [2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 3060.0, 3060.0] | [17.0, 17.0, 17.0, 19.0, 17.0, 17.0, 17.0, 17.0] | [274, 275, 286, 274, 275, 284, 272, 270] |
p02982 | u296518383 | 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\nres=0\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 d = 0\n for k in range(D):\n k+=(X[i][k]-X[j][k])**2\n k=k**0.5\n if k.is_integer():\n res+=1\nprint(res)', ... | ['Wrong Answer', 'Accepted'] | ['s876646709', 's875742399'] | [3188.0, 3064.0] | [18.0, 18.0] | [302, 320] |
p02982 | u302292660 | 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 _ in range(n)]\n\nc=0\nfor i in range(n-1):\n for j in range(i+1,n):\n c+=(sum((a-b)**2 for a,b in zip(x[i],x[j]))**0.5).is_integer\n\nprint(c)', 'n,d = map(int,input().split())\nx = [list(map(int,input().split())) for _ in range(n)]\n\nc=0\n... | ['Runtime Error', 'Accepted'] | ['s426569643', 's093965845'] | [3060.0, 3188.0] | [17.0, 18.0] | [211, 213] |
p02982 | u306070611 | 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 =[]\nimport math\ndef dist(a,b):\n li2 = []\n for k in range(D):\n li2.append((a[k]-b[k])**2)\n return math.sqrt(sum(li2))\nfor _ in range(N):\n X = list(map(int,input().split()))\n li.append(X)\ncnt = 0\nfor i in range(N):\n for j in range(N):\n x = ... | ['Wrong Answer', 'Accepted'] | ['s730816866', 's550898660'] | [3064.0, 3064.0] | [18.0, 18.0] | [473, 478] |
p02982 | u309018392 | 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)]\ncount = 0\n\nimport numpy as np\nfor i in range(n-1):\n for j in range(1,n):\n a = np.array(x[i])\n b = np.array(x[j])\n ab = sum(np.power((a-b),2))**0.5\n if ab%1 == 0:\n count += 1\nprin... | ['Wrong Answer', 'Accepted'] | ['s011161268', 's974987479'] | [21408.0, 18756.0] | [373.0, 276.0] | [314, 316] |
p02982 | u310381103 | 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=list(map(int,input().split()))\na=['X' for _ in range(int(N[0]))]\nA=0\nfor i in range(int(N[0])):\n a[i]=list(map(int,input().split()))\n for t in range(int(i)):\n Y=[(a[i][s]-a[t][s])**2 for s in range(int(N[1]))]\n Z=sum(Y)\n if (math.sqrt(Z)-int(math.sqrt(Z)))==0:\n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s019289299', 's265294814', 's641940379', 's648617379', 's687429957', 's853360600', 's899367892', 's229223467'] | [3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0] | [18.0, 18.0, 18.0, 17.0, 18.0, 18.0, 18.0, 17.0] | [361, 425, 452, 412, 353, 361, 390, 431] |
p02982 | u314906167 | 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\nfor _ in range(N):\n x = [int(s) for s in input().split()]\n X.append(x)\nfor i in range(N - 1):\n for j in range(i + 1, N):\n dist = 0\n for d in range(D):\n dist += (X[i][d] - X[j][d]) ** 2\n for n in range(500):\n ... | ['Wrong Answer', 'Accepted'] | ['s618519122', 's897112779'] | [3064.0, 3064.0] | [19.0, 18.0] | [415, 388] |
p02982 | u316233444 | 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=[]\nfor i in range(n):\n x.append([int(i) for i in input().split()])\n\nfor i in range(n-1): #0-n\n for j in range(i+1,n):\n s = 0\n for k in range(d):\n s += (x[i][k]-x[j][k])**2\n a = math.sqrt(s)\n if a.is_integer():\n ans += 1\nprint(ans)'... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s089907640', 's978173667', 's756313258'] | [3064.0, 3064.0, 3064.0] | [18.0, 17.0, 18.0] | [302, 289, 308] |
p02982 | u319589470 | 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)]\nans = 0\nfor i in range(n):\n for j in range(i+1,n):\n sq= 0\n for k in range(d):\n sq += (x[i][k]-x[j][k])**2\n if math.sqrt(sq).is_integer():\n ans += 1\nprint(ans)', 'import math\n\nn,d = m... | ['Wrong Answer', 'Accepted'] | ['s219427858', 's880552431'] | [3064.0, 3064.0] | [17.0, 18.0] | [281, 278] |
p02982 | u321605735 | 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 ... | ['r=input().split()\nN=int(r[0])\nD=int(r[1])\nd=[[int(s) for s in input().split()] for i in range(N)]\nans=0\nfor i in range(N-1):\n for j in range(i+1,N):\n dis=0\n for k in range(D):\n dis+=(d[i][k]-d[j][k])**2\n ans_pre=dis**(int(1/2))\n if type(ans_pre)==int or ans_pre.is_... | ['Wrong Answer', 'Accepted'] | ['s806114103', 's243532079'] | [9144.0, 9352.0] | [29.0, 25.0] | [353, 348] |
p02982 | u322354465 | 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)]\n\nans = 0\nfor i in range(n - 1):\n for j in range(i + 1, n):\n dist = sum(map(lambda v1, v2: (v1 - v2) ** 2, x[i], x[j]))\n print(dist)\n if math.sqrt(dist) == int(math.sqrt(dist)):\n ... | ['Wrong Answer', 'Accepted'] | ['s020436087', 's932010495'] | [3064.0, 3064.0] | [18.0, 17.0] | [335, 315] |
p02982 | u333404917 | 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 re\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 results)\n \n... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s041900102', 's090187845', 's918504074', 's959131106', 's974094678'] | [12388.0, 12504.0, 12388.0, 12284.0, 3064.0] | [158.0, 162.0, 149.0, 149.0, 18.0] | [423, 394, 423, 461, 369] |
p02982 | u334222621 | 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\ndlst = []\n\nN, D=map(int, input().split())\n\nfor i in range(N):\n grid = list(map(int, input().split()))\n dlst.append(grid)\n\nlst=[1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1024, 1089, 1156, 122... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s208420106', 's361854708', 's979210100', 's355731821'] | [3064.0, 3064.0, 3064.0, 3064.0] | [17.0, 18.0, 18.0, 17.0] | [765, 821, 415, 411] |
p02982 | u340792767 | 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\nN, D = [int(x) for x in input().strip().split()]\nif D == 1:\n print(int(N*(N-1)/2)\nelse: \n points = []\n for data in range(N):\n points.append([int(x) for x in input().strip().split()])\n\n result = 0\n for p1,p2 in itertools.combinations(points, 2):\n ... | ['Runtime Error', 'Accepted'] | ['s300372000', 's507031233'] | [2940.0, 3064.0] | [17.0, 18.0] | [504, 501] |
p02982 | u347600233 | 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 ... | ['from math import sqrt\nn, d = map(int, input().split())\npoint = [[int(i) for i in input().split()] for j in range(n)]\ncount = 0\nfor i in range(n):\n for j in range(i + 1, n):\n norm = 0\n for pi, pj in zip(point[i], point[j]):\n norm += (pi - pj) ** 2\n if int(sqrt(norm)) == norm... | ['Wrong Answer', 'Accepted'] | ['s461658580', 's336415152'] | [3064.0, 9376.0] | [17.0, 30.0] | [347, 304] |
p02982 | u350093546 | 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)]\ncnt=0\nfor i in range(n):\n for j in range(i+1,n):\n sum=0\n for k in range(n):\n sum+=(x[i][k]-x[j][k])**2\n z=pow(sum,0.5)\n if math.ceil(z)==math.floor(z):\n cnt+=1\nprint(cnt)', 'import math\nn,... | ['Runtime Error', 'Accepted'] | ['s820331613', 's763744013'] | [9472.0, 9292.0] | [24.0, 27.0] | [287, 288] |
p02982 | u358957649 | 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\n\nN, D = map(int, input().split())\n\nlstMain = list()\nfor i in range(0, N):\n lstMain.append(list(map(int, input().split())))\n\nprint(lstMain)\n\ncount = 0\nfor i in range(0, N):\n for j in range(i+1, N):\n y = numpy.array(lstMain[i])\n z = numpy.array(lstMain[j])\n u = z -... | ['Wrong Answer', 'Accepted'] | ['s118071797', 's020533820'] | [12424.0, 12424.0] | [151.0, 149.0] | [423, 407] |
p02982 | u362563655 | 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())\ncount = 0\n\nfor i in range(n):\n x = list(map(int, input().split()))\n\nfor i in range(d):\n n=0\n for j in range(d) if i < j:\n n += (x[i][j]-x[i+1][j])**2\n if type(n**0.5) = int:\n count +=1\n\nprint(count)', 'import math\nn,d = map(int,input().split())\ncount = 0\nfor i... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s632736893', 's674519592', 's969906556'] | [2940.0, 2940.0, 3060.0] | [17.0, 17.0, 18.0] | [240, 265, 325] |
p02982 | u367147039 | 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 i in range(n):\n x.append(list(map(int,input().split())))\nans=0\nprint("zzzzzzzzzzzzzzzzzzzzzzzz")\n\nfor i in range(n-1):\n for j in range(i+1,n):\n d2=0\n for l in range(d):\n d2+=(x[i][l]-x[j][l])**2\n d2=int(d2)\n print(d2)\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s176189534', 's992860349', 's188893614'] | [3064.0, 3064.0, 3064.0] | [39.0, 37.0, 38.0] | [588, 386, 368] |
p02982 | u368016155 | 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\nrow = list()\ncount = 0\nfor i in range(N):\n x = [int(_) for _ in input().split()]\n if i == 0:\n row.append(x)\n else:\n for j in len(row):\n dist = 0\n for k in range(D):\n dist += (row[j][k]-x[k])^2\n if (dist**1/2) == int:\n \tcount += 1\n ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s732603568', 's877592279', 's746543678'] | [3064.0, 3064.0, 3188.0] | [17.0, 18.0, 17.0] | [335, 394, 354] |
p02982 | u371530330 | 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 = list(map(int, input().split()))\nx = [list(map(int, input().split())) for N in range(n)]\n\nkaijou = 0\ncnt = 0\n\nfor i in n:\n for j in n:\n for k in d:\n kaijou += (x[j,k]**2-x[i,k]**2)\n if math.sqrt(kaioju).is_integer() == True:\n cnt += 1\n\nprint(cnt-n)\n \n', 'import math\... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s019669913', 's243417007', 's172932286'] | [3060.0, 3064.0, 3064.0] | [18.0, 17.0, 18.0] | [286, 284, 319] |
p02982 | u376515719 | 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 numpy as np\n\n\nn, d = map(int, input().split())\ne = [[int(i) for i in input().split()] for i in range(n)] \n\nresult=0\nfor v in itertools.combinations(e, 2):\n calc = sum(np.sqrt(abs((np.array(v[0]) - np.array(v[1])))^2))\n if isinstance(calc, int)==False:\n res=0\n else:\... | ['Wrong Answer', 'Accepted'] | ['s871090795', 's409428372'] | [12444.0, 12440.0] | [152.0, 151.0] | [418, 398] |
p02982 | u383416302 | 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 sys import stdin\n\nN,D=[int(x) for x in stdin.readline().rstrip().split()]\ndata = [stdin.readline().rstrip().split() for _ in range(N)]\n\nret=0\nfor i in range(N-1):\n for j in range(i+1,N,1):\n a=[ int(x) for x in data[i]]\n b=[ int(x) for x in data[j]]\n u = np.ar... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s269263057', 's858666516', 's940743511'] | [12444.0, 3064.0, 12452.0] | [149.0, 17.0, 149.0] | [464, 445, 496] |
p02982 | u385244248 | 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())\nA=[]\nC=0\nD=0\nE=0\nfor i in range (1,N+1):\n A.append(i)\nfor i in range (0,N):\n A[i]=list(map(int,input().split()))\nfor i in range (0,N-1):\n for j in range(i,N-1):\n for k in range(0,D):\n B=(A[j][k]-A[j+1][k])**2\n C+=B\n D=C\n ... | ['Wrong Answer', 'Accepted'] | ['s964498152', 's016156257'] | [3064.0, 3064.0] | [17.0, 18.0] | [383, 361] |
p02982 | u392938961 | 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 = [int(s) for s in input().split()]\nnumList = [[int(s) for s in input().split()] for i in range(x[0])]\nsum = 0\nfor i in range(len(numList)):\n for j in range(i+1,len(numList)):\n d = 0\n for k in range(x[1]):\n d += (numList[i][k] - numList[i+1][k]) ** 2\n num... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s070214622', 's224029626', 's157241097'] | [3188.0, 3188.0, 3064.0] | [18.0, 18.0, 18.0] | [444, 455, 520] |
p02982 | u395202850 | 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 ... | ['cnt = 0\n\nN, D = map(int, input().split())\nX = []\nfor l in range(N):\n X.append(list(map(int, input().strip().split())))\n\nfor i in range(0, N - 1):\n for j in range(i + 1, N):\n sum = 0\n for k in range(0, D):\n sum += (X[i][k] - X[j][k])**2\n if math.sqrt(sum) == int(math.s... | ['Runtime Error', 'Accepted'] | ['s823070937', 's996210203'] | [3064.0, 3064.0] | [17.0, 18.0] | [348, 361] |
p02982 | u395620499 | 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 ... | ['from math import sqrt\nn,d = map(int, input().split())\n\nvs = []\nfor i in range(n):\n v = list(map(int,input().split()))\n vs.append(vs)\n\ndef ds(a,b):\n s = 0\n for i in range(d):\n s += (b[i] - a[i])**2\n return sqrt(s)\n\nans = 0\nfor i in range(n):\n for j in range(i+1,n):\n d = ds(vs[i], vs[j])\n ... | ['Runtime Error', 'Accepted'] | ['s718614555', 's173991063'] | [9212.0, 9188.0] | [29.0, 33.0] | [351, 390] |
p02982 | u397496203 | 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 ... | ['from math import sqrt\n\nN,D = [int(i) for i in input().split()]\nXY_l = [[int(i) for i in input().split()] for _ in range(N)]\nans = 0\n\nfor i in range(N):\n for j in range(N):\n if i <= j :\n continue\n S = 0\n for d in range(D):\n S = ((XY_l[i][d]) - (XY_l[j][d]))**2\n if sqrt(S).is_intege... | ['Wrong Answer', 'Accepted'] | ['s949846241', 's443198680'] | [3064.0, 3064.0] | [18.0, 18.0] | [334, 341] |
p02982 | u399754648 | 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\ndef distance():\n N,D=map(int,input().split())\n y=[]\n ans=0\n for i in range(N):\n x=list(map(int,input().split()))\n y.append(x)\n y=np.array(y)\n y.reshape(N,-1)\n for i in range(N-1):\n for j in range(i+1,N):\n dis=(((y[i]-y... | ['Wrong Answer', 'Accepted'] | ['s491731000', 's106821680'] | [12388.0, 12500.0] | [147.0, 152.0] | [402, 430] |
p02982 | u403331159 | 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())\nl=[list(map(int,input().split())) for i in range(n)]\nans=0\ncnt=0\nsiki=0\nfor i in range(n-1):\n for j in range(i+1,n):\n siki=0\n for k in range(d):\n siki+=((l[i][k]-l[j][k])**2)\n han=math.sqrt(ans)\n if han%1==0:\n c... | ['Wrong Answer', 'Accepted'] | ['s006154820', 's124190504'] | [3064.0, 3188.0] | [18.0, 17.0] | [321, 301] |
p02982 | u404629709 | 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())\na=[]\nans=0\ncnt=1\n\nfor i in range(n):\n b=list(map(int,input().split()))\n a.append(b)\nfor i in range(n-1):\n for j in range(i+1,n):\n dist=0\n for k in range(d):\n dist+=(a[i][k]-a[j][k])**2\n while cnt**2>dist:\n if cnt**2==dist:\n ans+=1\nprint(ans)', ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s092516062', 's795873462', 's235492159'] | [3064.0, 3064.0, 3064.0] | [17.0, 17.0, 19.0] | [299, 293, 317] |
p02982 | u408375121 | 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 = []\nfor _ in range(n):\n x = list(map(int, input().split()))\nans = 0\nfor i in range(n-1):\n for j in range(i+1, n):\n dist = 0\n for k in range(d):\n dist += (lst[i][k] - lst[j][k])**2\n j = 1\n while j**2 <= dist:\n if j**2 == dist:\n ans += 1\... | ['Runtime Error', 'Accepted'] | ['s254807825', 's944151488'] | [9136.0, 8952.0] | [26.0, 28.0] | [342, 358] |
p02982 | u408791346 | 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 return res\n\nN, D = map(int,input().split())\nx = [list(map(int, input().split()) for _ 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[i]).is_integer():... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s438670023', 's806828490', 's813700867'] | [3064.0, 3064.0, 3064.0] | [18.0, 17.0, 19.0] | [339, 339, 310] |
p02982 | u411858517 | 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 _ in range(N)]\n\nres = 0\n\nfor i in range(N):\n for j in range(N):\n if i != j:\n tmp = 0\n for k in range(D):\n tmp += (L[i][k] - L[j][k]) ** 2\n \n if tmp - int(tmp) == 0:\n res += 1\n \nprint... | ['Wrong Answer', 'Accepted'] | ['s197075485', 's069322403'] | [3064.0, 3060.0] | [18.0, 18.0] | [308, 356] |
p02982 | u426764965 | 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 = np.zeros((N, D), np.int8)\nfor i in range(N):\n X[i,:] = list(map(int, input().split()))\n\nans = 0\nfor i in range(N):\n for j in range(i+1, N):\n dist_sq = 0\n for x, y in zip(X[i], X[j]):\n dist_sq += (x - y) ** 2\n\n dist = dist_sq ** 0.5\n #print(i, j, dis... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s026866325', 's452746838', 's607867924'] | [3064.0, 3064.0, 3064.0] | [17.0, 17.0, 17.0] | [365, 351, 399] |
p02982 | u431381247 | 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\n\n\nN, D = (int(i) for i in input().split())\nX = [[int(i) for i in input().split()] for i in range(N)]\nprint([D, N])\nprint(X)\n\na = numpy.array(X[0])\nb = numpy.array(X[1])\nu = b - z\nprint(numpy.linalg.norm(u))', 'import numpy as np\n\nN, D = (int(i) for i in input().split())\nX = [[int(i) for i i... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s117643063', 's596197075', 's287969418'] | [14408.0, 12476.0, 3064.0] | [148.0, 151.0, 17.0] | [219, 335, 350] |
p02982 | u434872492 | 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] * N\nfor i in range(N):\n X[i] = list(map(int,input().split()))\ncount = 0\ndef func(A,B):\n a = 0\n for k in range(D):\n a += (A[k] - B[k])**2\n a = math.sqrt(a)\n return a\nfor i in range(N):\n for j in range(i,N):\n sum_x = 0\n ... | ['Runtime Error', 'Accepted'] | ['s702161777', 's730292087'] | [3064.0, 3064.0] | [17.0, 17.0] | [471, 480] |
p02982 | u435108403 | 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 as mt\n\nN, D = list(map(int, input().split()))\n\nxlis = [[0 for _ in range(D)] for _ in range(N)]\n\nfor i in range(N):\n inputlis = list(map(int, input().split()))\n for l in range(D):\n xlis[i][l] = inputlis[l]\n\ncnt = 0\n\nfor i in range(N):\n for s in range(N):\n res = 0\n ... | ['Wrong Answer', 'Accepted'] | ['s146631416', 's865641138'] | [3064.0, 3064.0] | [18.0, 18.0] | [492, 497] |
p02982 | u436887866 | 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 ... | ['#!/usr/local/bin/python3\n#coding:utf-8\n#import numpy as np\n\n\ndef main():\n\n in0 = input()\n\n IN = in0.split(\' \')\n\n N = int(IN[0])\n D = int(IN[1])\n\n X = np.zeros((N,D))\n\n for i in range(N):\n in0 = input()\n IN = in0.split(\' \')\n for j in range(D):\n X[i,j] = int(IN... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s478500093', 's637985281', 's742797778', 's332268037'] | [3064.0, 3064.0, 3064.0, 12492.0] | [18.0, 17.0, 18.0, 149.0] | [638, 639, 627, 637] |
p02982 | u437215432 | 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 ... | ['# ABC133B\n\nimport numpy as np\n\nn, d = map(int, input().split())\nx = [0] * n\nfor i in range(n):\n x[i] = list(map(int, input().split()))\nx = np.array(x)\ncount = 0\nfor i in range(n-1):\n for j in range(i+1, n):\n d = np.sqrt(sum((x[i, :] - x[j, :]) ** 2))\n print(i, j, "** d =", d)\n ... | ['Wrong Answer', 'Accepted'] | ['s032701117', 's548821845'] | [14448.0, 12392.0] | [153.0, 149.0] | [357, 359] |
p02982 | u439918693 | 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())\nt = []\nfor i in range(N):\n t.append(list(map(int, input().split())))\ncount = 0\nsum = 0\nfor i in range(0, N-1):\n for j in range(i + 1, N):\n for d in range(D):\n sum += pow(t[i][d] - t[j][d], 2)\n sqrt = math.sqrt(sum)\n print(sum)\n ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s593026783', 's877792150', 's543068563'] | [3064.0, 3064.0, 3064.0] | [18.0, 18.0, 18.0] | [408, 396, 373] |
p02982 | u443536265 | 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 all_list = [list(map(int, input().split())) for i in range(N)]\n #>>>4\n count = 0\n for n in range (N):\n for nn in range(N):\n distance = 0\n for d in range(D):\n kou = (all_list[n][d] - all_list[nn][d])**2\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s630025205', 's694133900', 's035634938'] | [2940.0, 2940.0, 3060.0] | [18.0, 17.0, 21.0] | [488, 370, 410] |
p02982 | u452269253 | 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 = list(map(int, input().rstrip().split(" ")))\nans = 0\ncoor = []\nfor a in n[0]:\n coor.append(list(map(int, input().rstrip().split(" "))))\n \ndef dis(a,b):\n ans = 0\n for i in range(a):\n ans += (a[i] - b[i])**2\n return ans**0.5\n \nfor a in range(len(coor)):\n for b in range(0,a):\n if coor[a]!=c... | ['Runtime Error', 'Accepted'] | ['s341835510', 's389834195'] | [3064.0, 3064.0] | [17.0, 17.0] | [384, 396] |
p02982 | u453623947 | 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 _ in range(n)]\n\nans = 0\n\nfor i in range(n-1):\n for j in range(i+1,n):\n sub = 0\n for k in range(d) :\n sub += abs(x[i][k]-x[j][k])**2\n sub = sub**0.5\n print(sub)\n if sub.is_integer() :\n... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s157454724', 's596142075', 's849604238', 's501988870'] | [9396.0, 9440.0, 9348.0, 9348.0] | [25.0, 30.0, 27.0, 28.0] | [337, 334, 334, 318] |
p02982 | u454524105 | 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().split())\nX = [[int(x) for x in input().split(" ")] for _ in range(n)]\nans = 0\nprint(X)\nfor i in range(n-1):\n for j in range(i+1, n):\n s = 0\n for k in range(d):\n s += (X[i][k] - X[j][k]) ** 2\n if (s ** 0.5).is_integer(): ans += 1\nprint(ans)\n... | ['Wrong Answer', 'Accepted'] | ['s642327715', 's739248661'] | [3316.0, 3188.0] | [21.0, 18.0] | [307, 298] |
p02982 | u456896733 | 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\na,b=map(int,input().split())\nX = [[int(i) for i in input().split()] for i in range(a)] \n\nc = list(itertools.combinations(X, 2))\n\n\ndef get_distance(x1, y1, x2, y2):\n d = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)\n return d\n\nans = 0\nfor i in range(len(c)):\n C_x1 = c[i... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s316419796', 's916672081', 's901904048'] | [3064.0, 3064.0, 3064.0] | [19.0, 18.0, 18.0] | [472, 388, 372] |
p02982 | u460129720 | 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_ls = []\ncnt = 0\n \nfor i in range(N):\n X_ls.append(list(map(int, input().split(' '))))\n \nfor i in range(N - 1):\n for j in range(i+1, N):\n dist_squared, dist = 0, 0\n print(i,j)\n for y, z in zip(X_ls[i], X_ls[j]):\n dist_... | ['Wrong Answer', 'Accepted'] | ['s010166259', 's907098922'] | [9152.0, 9172.0] | [29.0, 33.0] | [440, 420] |
p02982 | u464627439 | 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 = []\nfor _ in range(N):\n X.append(list(map(int, input().split())))\n\ndist = 0\ncnt = 0\nfor i in range(N):\n for j in range(N):\n if j == i:\n continue\n for k in range(D):\n dist += (X[i][k] - X[j][k])**2\n dist = ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s336953667', 's885668557', 's787765116'] | [3188.0, 3064.0, 3064.0] | [19.0, 18.0, 18.0] | [389, 347, 347] |
p02982 | u464912173 | 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())\npoint = []\nfor _ in range(n):\n\tx = list(map(int, input().split()))\n point.append(x)\n \ncnt = 0\nfor i in range(n-1):\n\tfor j in range(i+1, n):\n\t\tdist = 0\n for d in range(D):\n \tdist += (point[i][d] - point[j][d])**2\n \n ... | ['Runtime Error', 'Accepted'] | ['s832742267', 's416884337'] | [2940.0, 3064.0] | [17.0, 18.0] | [385, 358] |
p02982 | u466331465 | 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()))\nX = [list(map(int,input().split())) for _ in range(N)]\nans = 0\nfor i in range(N):\n for j in range(i+1,N):\n for d in range(D):\n a += (X[i][d]-X[j][d])**2\n for l in range(a):\n if l**2==a:\n ans+=1\nprint(ans)\n ', 'N,D = list(map(int,input().split(... | ['Runtime Error', 'Accepted'] | ['s356050369', 's190173717'] | [3060.0, 3060.0] | [17.0, 59.0] | [270, 282] |
p02982 | u470208427 | 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 = list(map(int,input().split()))\nl = [0]*n\nprint(l)\nfor i in range(n):\n ipt = list(map(int,input().split()))\n l[i] = ipt\nans = 0\nfor i in range(n-1):\n for j in range(i+1,n):\n sm = 0\n for k in range(d):\n sm += abs(l[i][k] - l[j][k])**2\n sm = math.sq... | ['Wrong Answer', 'Accepted'] | ['s004930314', 's486047476'] | [3064.0, 3064.0] | [17.0, 18.0] | [365, 356] |
p02982 | u471684875 | 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())\na=0\nl=[]\nfor i in range(n):\n l.append(list(map(int,input().split())))\n for j in range(i+1,n):\n b=0\n for k in range(d):\n b+=(l[i][k]-l[j][k])**2\n c=b**(1/2)\n if c%1 == 0:\n a+=1\nprint(a)\n', 'n,d=map(int,input().split())\nl=[list(map... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s403879422', 's595882872', 's441675472'] | [3316.0, 3188.0, 3064.0] | [21.0, 18.0, 18.0] | [260, 316, 307] |
p02982 | u472696272 | 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())\npoint = [list(map(int,input().split())) for _ in range(n)]\ncount = 0\nfor i in range(n-1):\n for j in range(i+1,n):\n d = 0\n for k in range(0,d):\n d += pow(point[i][k]-point[j][k],2)\n d = d**0.5\n if int(d)==d: count += 1\nprint(count)\n', 'n,d = map(int,input().s... | ['Wrong Answer', 'Accepted'] | ['s957851339', 's627576300'] | [3188.0, 3064.0] | [19.0, 18.0] | [280, 291] |
p02982 | u474925961 | 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\n\nif sys.platform =='ios':\n sys.stdin=open('input_file.txt')\n\n\nN,D=map(int,input().split())\nX=[list(map(int,input().split())) for _ in range(N)]\na=0\ncnt=0\nprint(X)\n\nfor i in range(N):\n\tfor j in range(i+1,N):\n\t\tfor k in range(D):\n\t\t\ta+=(X[i][k]-X[j][k])**2\n\t\tif int(a**.5)**2==a:\n\... | ['Wrong Answer', 'Accepted'] | ['s078408881', 's389625295'] | [3064.0, 3064.0] | [18.0, 18.0] | [327, 323] |
p02982 | u475598608 | 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 _ in range(n)]\nans=0\nfor i in range(n):\n for j in range(i):\n ans+=(sum((a-b)**2 for a,b in zip(x[i],x[j])**0.5)).is_integer()\nprint(ans)', 'n,d = map(int,input().split())\nx = [list(map(int,input().split())) for _ in range(n)]\nans = 0\... | ['Runtime Error', 'Accepted'] | ['s128986922', 's415754974'] | [3060.0, 3316.0] | [17.0, 20.0] | [212, 212] |
p02982 | u478266845 | 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 = [int(i) for i in input().split()]\nX = np.zeros((N,D))\nfor i in range(N):\n X[i] = [int(i) for i in input().split()]\n \ncount_dummy=0\nfor i in range(N):\n for j in range(i+1,N):\n dist = (np.sum((X[i] - X[j])**2))**0.5\n if dist.is_integer():\n count_d... | ['Wrong Answer', 'Accepted'] | ['s946878182', 's077757647'] | [21580.0, 12444.0] | [305.0, 148.0] | [338, 346] |
p02982 | u486251525 | 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\nN,D= map(int,input().split())\nX = []\ncount=0\nfor x in range(N):\n X.append(list(map(int,input().split()))) \n\nprint(X)\nlistArray = list(itertools.combinations(X, 2))\n\nprint(listArray)\nfor X in listArray:\n sumX = 0\n for x in range(D):\n subX = X[0][x] - X[1][x... | ['Wrong Answer', 'Accepted'] | ['s631144377', 's935095163'] | [3064.0, 3064.0] | [19.0, 20.0] | [413, 387] |
p02982 | u488127128 | 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\n\ndef solve():\n n,d = map(int, input().split())\n l = [[int(x) for x in sys.stdin.readlines()] for _ in range(n)]\n count = 0\n for i in range(n):\n Y = l[i]\n for Z in l[i+1:]:\n total = 0\n for y,z in zip(Y,Z):\n total += (y-z)**2\n ... | ['Runtime Error', 'Accepted'] | ['s794089722', 's754845833'] | [3064.0, 3064.0] | [18.0, 17.0] | [443, 442] |
p02982 | u491462774 | 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 = [list(map(int, input().split())) for _ in range(n)]\nprint(x)\ncnt = 0\nsum_tmp = 0\n\nfor i in range(n):\n for j in range(i+1, n):\n for h in range(d):\n sum_tmp += (x[i][h] - x[j][h]) ** 2\n print("test i:",i , "h:", h ,x[i][h])\n... | ['Wrong Answer', 'Accepted'] | ['s171952416', 's974524284'] | [9132.0, 9192.0] | [31.0, 28.0] | [488, 343] |
p02982 | u492447501 | 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\nS = input()\nS = S.split()\nN = int(S[0])\nD = int(S[1])\nmatrix = np.zeros([N, D])\ncount = 0\n\n\nfor i in range(0, N, 1):\n X_vector = input()\n X_vector = X_vector.split()\n for j in range(0, D, 1):\n matrix[i][j] = int(X_vector[j])\n\nfor i in range(0, N... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s042366294', 's322277350', 's545102917', 's711786647', 's158521489'] | [3064.0, 3064.0, 3064.0, 3064.0, 13132.0] | [17.0, 17.0, 17.0, 17.0, 160.0] | [520, 495, 527, 513, 519] |
p02982 | u494514222 | 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 #math.sqrt(x)\n\nn,d = map(int, input().split())\nx = []\nfor _ in range(n):\n x.append(list(map(int, input().split())))\n\nans = 0\nfor i in range(n):\n for q in range(n):\n sumv = 0\n if i == q:\n continue\n for j in range(d):\n sumv += (x[i][j] - x[q][j]... | ['Wrong Answer', 'Accepted'] | ['s130347820', 's204677188'] | [3064.0, 3188.0] | [20.0, 18.0] | [395, 402] |
p02982 | u495166526 | 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()]\nX=[]\nans=0\nfor j in range(N):\n X.append([int(i) for i in input().split()])\n\nfor i in range(N):\n for j in range(i+1,N):\n y=X[i]\n z=X[j]\n tmp=0\n for k in range(D):\n tmp += (y[k]-z[k])**2\n tmp2 = tmp ** 0.5\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s456817819', 's843502530', 's449369730'] | [3064.0, 3316.0, 3064.0] | [18.0, 18.0, 20.0] | [392, 396, 369] |
p02982 | u503111914 | 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())\nA = [list(map(int,input().split())) for i in range(N)]\n\nOK = 0\nfor j in range(N-1):\n print(j)\n num = 0\n for k in range(D):\n num =num+ (A[j][k]-A[j+1][k])**2\n print(num)\n print(num**(1/2).is_integer())\n if num**(1/2).is_integer() == True:\n OK += 1\n print(typ... | ['Wrong Answer', 'Accepted'] | ['s756318465', 's992679279'] | [3064.0, 3188.0] | [18.0, 28.0] | [346, 344] |
p02982 | u511449169 | 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 copy\nimport math\n\nn, d = map(int, input().split())\nx = [list(map(int, input().split())) for _ in range(n)]\ny = copy.deepcopy(x)\ncnt = 0\ninside = 0\nfor nx, i in enumerate(x[:]):\n # print(i)\n for ny, j in enumerate(y[:]):\n # print(j)\n inside = 0\n if nx != ny:\n for item in range(d):\... | ['Wrong Answer', 'Accepted'] | ['s674031409', 's945110154'] | [3444.0, 3572.0] | [23.0, 23.0] | [473, 482] |
p02982 | u517152997 | 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 -*-\n# \nimport math\nimport sys\nimport itertools\nimport numpy as np\n\n\n\nn,d = map(int, input().split())\n\n\nx = [[int(i) for i in input().split()] for i in range(n)] \nprint(x)\nanswer = 0\nfor j in range(n):\n for i in range(j):\n dist2 = 0\n for k in range(d):\n ... | ['Wrong Answer', 'Accepted'] | ['s231263674', 's276281454'] | [12512.0, 12448.0] | [148.0, 148.0] | [625, 628] |
p02982 | u517930510 | 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())\nl=[]\nfor i in range(n):\n l.append(list(map(int, input().split())))\ncount = 0\nfor i in range(n):\n for j in range(i+1,n):\n distance_a = 0\n for k in range(d):\n distance_k= l[i][k]-l[j][k]\n distance_a +=distance_k**2\n distance = np.sqrt(d... | ['Runtime Error', 'Accepted'] | ['s532567726', 's470264225'] | [2940.0, 20924.0] | [17.0, 314.0] | [386, 429] |
p02982 | u519832983 | 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 = []\ncount = 0\nfor n in range(N):\n temp = list(map(int, input().split()))\n X.append(temp)\nfor i in range(N):\n for j in range(i + 1, N):\n sums = 0\n for d in range(D):\n sums += (X[i][d] - X[j][d]) ** 2\n for n in range(sums):\n if n * n == sums or sums ... | ['Wrong Answer', 'Accepted'] | ['s612007956', 's462674579'] | [3064.0, 3064.0] | [41.0, 39.0] | [382, 343] |
p02982 | u521087562 | 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 = [list(map(int,input().split())) for i in range(N)]\n\nimport numpy as np\np1 = np.array(P)\ntmp_index = np.arange(p1.shape[0])\nxx, yy = np.meshgrid(tmp_index, tmp_index)\ndistances = np.linalg.norm(p1[xx]-p1[yy], axis=2)\nresults = np.reshape(np.tril(distances), (1, N**2))\n\n\n... | ['Runtime Error', 'Accepted'] | ['s415861423', 's693651129'] | [12472.0, 12480.0] | [147.0, 150.0] | [422, 431] |
p02982 | u523545435 | 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=[]\nfor i in range(N):\n x=list(map(int,input().split()))\n X.append(x)\n\ndef dist(R,L):\n P=0\n for z in range(D):\n P+=(R[z]-L[z])**2\n return math.sqrt(P)\n\ncount=0\nfor j in range(N-1):\n for k in range(j+1,N):\n print(dist(X[j],X[k]... | ['Wrong Answer', 'Accepted'] | ['s303948767', 's823540940'] | [3064.0, 3064.0] | [18.0, 18.0] | [439, 441] |
p02982 | u524489226 | 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\nlist_N = []\nfor i in range(n):\n list_N.append(list(map(int, input().split())))\n\n\nprint(list_N)\nscore = 0\nfor i in range(len(list_N)):\n for j in range(i+1, len(list_N)):\n val = 0\n\n for a, b in zip(list_N[i], list_N[j]):\n val += (a-b)**2\n\n... | ['Wrong Answer', 'Accepted'] | ['s926903851', 's572057602'] | [3064.0, 3188.0] | [18.0, 18.0] | [442, 428] |
p02982 | u531220228 | 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 = np.zeros((N,D))\nfor i in range(N):\n X[i][:] = list(map(int, input().split()))\n\nn = 0\nfor i in range(N):\n for j in range(i+1, N):\n dist = linalg.norm(X[i]-X[j])\n if dist.is_integer():\n n += 1\n\nprint(n)', 'import numpy as np\n\n_N, _D, *_... | ['Runtime Error', 'Accepted'] | ['s154462822', 's424715120'] | [12472.0, 12500.0] | [152.0, 149.0] | [269, 276] |
p02982 | u531813438 | 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=[]\nf=0\nfor i in range(N):\n X.append(list(map(int,input().split())))\nfor i in range(N-1):\n for j in range(i+1, N):\n ans=0\n print(X[i] , X[j])\n for k in range(D):\n ans = ans + (X[i][k] - X[j][k])**2\n ans = (ans)**0.5\n pri... | ['Wrong Answer', 'Accepted'] | ['s810345258', 's922698016'] | [3188.0, 3064.0] | [18.0, 18.0] | [365, 319] |
p02982 | u533713111 | 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 array = list(map(int, input().split()))\n X.append(array)\n \ncount = 0\n\nfor i in range(N):\n for j in range(i + 1, N):\n L = []\n for k in range(D):\n L.append((X[i][k] - X[j][k]) ** 2)\n y = sum(L)\n for l in r... | ['Wrong Answer', 'Accepted'] | ['s703968283', 's109045696'] | [3064.0, 3064.0] | [61.0, 59.0] | [386, 387] |
p02982 | u533885955 | 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())\nX = [list(map(int,input().split())) for i in range(N)]\ncount = 0\nfor i in range(N):\n for j in range(N-i-1):\n J=i+j+1\n dist = 0\n for k in range(D):\n dist+=(X[i][k]-X[J][k])**2\n flag = 0\n for d in range(dist):\n if (d... | ['Wrong Answer', 'Accepted'] | ['s031667580', 's173452366'] | [3064.0, 3064.0] | [51.0, 57.0] | [440, 413] |
p02982 | u539517139 | 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 _ in range(n)]\np=0\ndef c(i,j):\n global x\n s=0\n for k in range(d):\n s+=(x[i][k]-x[j][k])**2\n if s**(1/2).is_integer()==True:\n return 1\n else:\n return 0\nfor i in range(n):\n for j in range(i+1,n):\n p+=c(i,j)\nprint(p)', 'n... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s635961756', 's720580257', 's491990679'] | [3060.0, 3060.0, 3060.0] | [18.0, 18.0, 17.0] | [298, 298, 300] |
p02982 | u542932305 | 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 _ in range(N)]\ncount = 0\ntmp = []\n\nfor i in range(N):\n r1 = X[i]\n for j in range(N):\n t = str(i)+str(j)\n if i == j or t in tmp or str(j)+str(i) in tmp:\n continue\n\n r2 = X[j]\n ls = [(r1[j... | ['Runtime Error', 'Accepted'] | ['s631855751', 's070822833'] | [3064.0, 3064.0] | [17.0, 17.0] | [455, 379] |
p02982 | u543000780 | 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 = []\nans = 0\nfor _ in range(N):\n tmp = list(map(int, input().split()))\n a.append(tmp)\nfor n in range(N):\n for m in range(n+1,N):\n \tdis = 0\n for d in range(D):\n dis += (a[n][d]-a[m][d])**2\n if math.sqrt(dis) == int(math.sqrt(dis)):\n ans +=... | ['Runtime Error', 'Accepted'] | ['s420118398', 's699646162'] | [8864.0, 9120.0] | [23.0, 27.0] | [317, 321] |
p02982 | u543019323 | 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\n\nx = []\nfor i in range(n):\n x.append(list(map(int, input().split())))\n\n\nresult = 0\n\nfor i in range(n-1):\n total = 0\n for k in range(d-1):\n r = (x[i][k] - x[i+k][k]) ** 2\n total += r\n total = total ** 0.5\n if total.is_integer():\n res... | ['Runtime Error', 'Accepted'] | ['s719287292', 's264456700'] | [3064.0, 3188.0] | [18.0, 18.0] | [323, 387] |
p02982 | u544212192 | 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=[]\nout=0\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 tol=0\n for k in range(d):\n tol+=(x[i][k]-x[j][k])**2\n print(tol)\n if tol**(1/2)-int(tol**(1/2))==0:\n ou... | ['Wrong Answer', 'Accepted'] | ['s515737363', 's687530099'] | [3064.0, 3316.0] | [18.0, 19.0] | [321, 302] |
p02982 | u546686251 | 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()))\ncount = 0\nfor i in range(N):\n for j in range(i + 1, N):\n r = 0\n for k in range(D):\n r += (X[i][k] - X[j][k]) ** 2\n if r ** 0.5 % 1 == 0:\n count += 1\nprint(count)', 'N, D = map(int, input().spli... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s196244147', 's418821927', 's855502992'] | [3060.0, 3060.0, 3060.0] | [17.0, 18.0, 17.0] | [276, 281, 301] |
p02982 | u549497563 | 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\nfor i in range(n-1):\n for j in range(i+1,n):\n res = 0\n for z in range(d):\n res += (x[i][z]-x[j][z])**2\n if math.sqrt(res)**2==res:\n cnt += 1\nprint(cnt)', ... | ['Runtime Error', 'Accepted'] | ['s309472768', 's120541562'] | [3064.0, 3064.0] | [17.0, 18.0] | [304, 323] |
p02982 | u551066908 | 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\n\na = [int(i) for i in input().split()]\nN = a[0]\nD = a[1]\nX = []\nfor i in range(N):\n tmp = [int(i) for i in input().split()]\n X.append(tmp)\n\nif D == 1:\n print(int(N*(N-1)/2))\n sys.exit(0)\ncount = 0\nfor n in range(0,N-1):\n result = 0\n for d in range(D):\n result = (X[n][d]-X[n+... | ['Wrong Answer', 'Accepted'] | ['s282471265', 's837636967'] | [3064.0, 3064.0] | [17.0, 18.0] | [379, 455] |
p02982 | u556589653 | 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\nk = []\n\na = 0\n\nfor i in range(N):\n k.append(map(int,input().split())\nfor i in range(N):\n for j in range(D):\n\n a += (k[i][j]-k[i+1][j])**2\n a = sqrt(a)\n if a%1 == 0:\n ans += 1\nprint(ans)', 'import math\nN,D = map(int,input().split())\nk = []\nans_2 = 0\nans_1 = 0\... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s305820083', 's750566523', 's134314835'] | [2940.0, 3064.0, 9208.0] | [18.0, 18.0, 27.0] | [327, 374, 314] |
p02982 | u557136512 | 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 = list(map(int, input().split()))\nX = []\nfor i in range(N):\n X.append(list(map(int, input().split())))\n\ncount = 0\nfor a in range(N):\n for b in range(a+1, N):\n sumX = 0\n for c in range(D):\n sumX += (X[a][c]-X[b][c])**2\n if math.sqrt(sumX)%1 == 0:\n count += 1\nprint(count)',... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s263819124', 's931706593', 's770714111'] | [2940.0, 2940.0, 3064.0] | [17.0, 17.0, 18.0] | [302, 306, 308] |
p02982 | u558059388 | 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=[[int(i) for i in input().split()] for i in range(n)] \nans=0\nfor i in range(n-1):\n for j in range(i+1,n):\n check = 0\n for k in range(d):\n check += (x[i][k]-x[j][k])**2\n if type(check) is int:\n ans+=1\nprint(ans)', 'n,d=... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s227847938', 's680880287', 's106663302'] | [3064.0, 3064.0, 3188.0] | [18.0, 18.0, 20.0] | [299, 290, 294] |
p02982 | u565868811 | 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,b=map(int,input().split())\nx=[list(map(int,input().split())) for i in range(n)]\n\ncount=1\nfor i in range(n):\n for j in range(i+1,n):\n t=0\n for k in range(b):\n t += (x[i][k]-x[j][k])**2\n t = t**(1/2)\n if t.is_integer():\n count += 1\nprint(count)\n ', 'a,b=map(int,input().split())\... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s207704112', 's362804430', 's682783669'] | [3060.0, 3060.0, 3060.0] | [18.0, 17.0, 18.0] | [272, 274, 272] |
p02982 | u571969099 | 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=[int(i) for i in inpput().split()]\nx=[]\nfor _ in range(n):\n x.append(np.array([int(i) for i in input().split()]))\ndef dis(x,y):\n return int(np.sum((x-y)**2))\ndef iss(x):\n a=round(math.sqrt(x))\n return a**2==x\nk=0\nfor i in range(n):\n for j in range(i+1,n):\n if i... | ['Runtime Error', 'Accepted'] | ['s854559469', 's595993730'] | [12488.0, 12480.0] | [149.0, 158.0] | [343, 343] |
p02982 | u572012241 | 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=[]\nfor i in range(n):\n l=map(int,input().split())\n x.append(l)\n\nx=np.array(x)\n\ndef dist(x,y):\n diff=x-y\n diff_sq=np.square(diff)\n return(np.sqrt(np.sum(diff_sq)))\n\nans=0\nfor N in range(n):\n for i in range(N,n):\n X = dist(x[N], x[i])\n \... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s304690189', 's409441133', 's946359284', 's987047015'] | [14520.0, 21912.0, 12504.0, 12428.0] | [155.0, 357.0, 151.0, 163.0] | [361, 287, 284, 454] |
p02982 | u573754721 | 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)]\n\nc=0\nfor i in range(n):\n for j in range(i+1,n):\n for k in range(d):\n if math.sqrt((x[i][k]-x[j][k])**2)==int(math.sqrt((x[i][k]-x[j][k])**2)):\n c+=1\nprint(c)'... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s707759713', 's884892026', 's984295469'] | [3060.0, 3060.0, 3060.0] | [18.0, 18.0, 17.0] | [307, 274, 330] |
p02982 | u575031797 | 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 ... | ["from functools import sqrt\nN, D = map(int, input().split(' '))\n\ncoordinate_list = list()\n\n\nfor i in range(N):\n coordinate = list(input().split())\n coordinate = list(map(int, coordinate))\n coordinate_list.append(coordinate)\n\ndef make_dis_list(D, coordinate_list):\n distance_list = list()\n fo... | ['Runtime Error', 'Accepted'] | ['s547172530', 's812724255'] | [3572.0, 3064.0] | [22.0, 18.0] | [891, 892] |
p02982 | u577942884 | 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().rstrip().split()))\na = []\nfor i in range(0, n):\n b = list(map(int, input().rstrip().split()))\n a.append(b)\n\nprint(a)\ndef nijou(a,n):\n korelist = 0\n for i in range(0, n-1):\n for j in range(i+1, n ):\n c = [x - y for (x, y) in zip(a[i], a[j])]\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s316939650', 's488707476', 's444254262'] | [3064.0, 3188.0, 3188.0] | [18.0, 18.0, 17.0] | [572, 552, 508] |
p02982 | u579699847 | 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 LI(): return list(map(int,input().split()))\nN,D = LI()\nX = [LI() for _ in range(N)]\nans = 0\nfor i in range(N):\n for j in range(i+1,N):\n temp = 0\n for k in range(D):\n temp += (X[j][k]-X[i][k])**2\n if temp **0.5%1==0:\n ans += 1\nprint(ans)', 'def LI(): return list... | ['Runtime Error', 'Accepted'] | ['s628551728', 's562354145'] | [2940.0, 3060.0] | [18.0, 18.0] | [282, 286] |
p02982 | u580199868 | 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()]\nX = [[int(i) for i in input().split()] for _ in range(N)]\n \nans = 0\nfor i in range(N):\n for j in range(i+1, N):\n yz = [abs((y - z)**2) for y, z in zip(X[i], X[j])]\n v = math.sqrt(sum(yz))\n if v == int(v):\n ans += 1\n \npri... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s348586062', 's869208677', 's262956060'] | [3064.0, 3064.0, 3064.0] | [18.0, 18.0, 18.0] | [314, 314, 326] |
p02982 | u581403769 | 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 = []\nfor i in range(n):\n l.append(list(map(int, input().split())))\ncount = 0\nimport math\nfor i in range(n):\n for j in range(n):\n sum = 0\n for i in range(d):\n sum += (l[i][d] -l[i][d]) ** 2\n dis = sqrt(sum)\n if dis % 1 == 0:\n... | ['Runtime Error', 'Accepted'] | ['s692829502', 's148521345'] | [9060.0, 9256.0] | [24.0, 27.0] | [340, 392] |
p02982 | u582663624 | 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 ... | ['from math import sqrt\nn,d=map(int,input().split())\nl=[list(map(float,input().split())) for i in range(n)]\nnums=[i for i in range(n-1)]\nfa=[i for i in range(d)]\ncnt=0\nans=0\nt=[]\nfor i in nums:\n for j in l[i+1:]:\n cnt=0\n for k in fa:\n cnt+=(l[i][k]-j[k])**2\n cnt=sqrt(cnt)\n print(cnt)\n ... | ['Wrong Answer', 'Accepted'] | ['s159680876', 's191675897'] | [3064.0, 3064.0] | [18.0, 17.0] | [379, 364] |
p02982 | u583276018 | 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 = [int(i) for i in input().split()]\ndot = []\nfor _ in range(n):\n zahyo = list(map(int, input().split()))\n dot.append(zahyo)\ncnt = 0\nfor i in range(n-1):\n for j in range(i+1, n):\n for k in range(d):\n test += pow(dot[i][k] - dot[j][k], 2)\n test_a = float(math.sqrt(test))\n t... | ['Runtime Error', 'Accepted'] | ['s141139250', 's999736411'] | [3064.0, 3064.0] | [18.0, 18.0] | [386, 399] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.