提出 #7124005


ソースコード 拡げる

def distance(a, b):
    d = len(a)
    s = 0
    for i in range(d):
        s += (a[i] - b[i]) ** 2
    return s ** 0.5


n, _ = map(int, input().split())
xs = [list(map(int, input().split()))
      for _ in range(n)]

cnt = 0
for i in range(n):
    for j in range(i + 1, n):
        d = distance(xs[i], xs[j])
        if (d - int(d)) == 0:
            cnt += 1
print(cnt)

提出情報

提出日時
問題 B - Good Distance
ユーザ lol
言語 Python (3.4.3)
得点 200
コード長 392 Byte
結果 AC
実行時間 17 ms
メモリ 3064 KiB

ジャッジ結果

セット名 All Sample
得点 / 配点 200 / 200 0 / 0
結果
AC × 13
AC × 3
セット名 テストケース
All sample_01, sample_02, sample_03, testcase_01, testcase_02, testcase_03, testcase_04, testcase_05, testcase_06, testcase_07, testcase_08, testcase_09, testcase_10
Sample sample_01, sample_02, sample_03
ケース名 結果 実行時間 メモリ
sample_01 AC 16 ms 3060 KiB
sample_02 AC 17 ms 3060 KiB
sample_03 AC 17 ms 3060 KiB
testcase_01 AC 17 ms 3064 KiB
testcase_02 AC 17 ms 3060 KiB
testcase_03 AC 17 ms 3064 KiB
testcase_04 AC 17 ms 3060 KiB
testcase_05 AC 17 ms 3064 KiB
testcase_06 AC 17 ms 3060 KiB
testcase_07 AC 17 ms 3060 KiB
testcase_08 AC 17 ms 3064 KiB
testcase_09 AC 17 ms 3060 KiB
testcase_10 AC 17 ms 3064 KiB