結果

問題 No.2353 Guardian Dogs in Spring
ユーザー yabityabit
提出日時 2023-06-18 12:42:06
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 648 bytes
コンパイル時間 1,297 ms
コンパイル使用メモリ 86,704 KB
実行使用メモリ 836,260 KB
最終ジャッジ日時 2023-09-08 08:23:24
合計ジャッジ時間 7,647 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,132 KB
testcase_01 AC 75 ms
71,444 KB
testcase_02 AC 74 ms
71,260 KB
testcase_03 AC 73 ms
71,116 KB
testcase_04 AC 73 ms
71,452 KB
testcase_05 MLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd

N = int(input())
X, Y = [0] * N, [0] * N
for i in range(N):
    X[i], Y[i] = map(int, input().split())
kumi = []
for i in range(N):
    for j in range(i + 1, N):
        kumi.append(((X[i] - X[j]) ** 2 + (Y[i] - Y[j]) ** 2, i, j))
kumi.sort()
used = set()
tilt = set()
ans = []
for d, x, y in kumi:
    w, h = X[x] - X[y], Y[x] - Y[y]
    if w == 0:
        katamuki = 10000
    else:
        katamuki = h / w
    if x not in used and y not in used and katamuki not in tilt:
        ans.append((x + 1, y + 1))
        used.add(x)
        used.add(y)
        tilt.add(katamuki)
print(len(ans))
for x, y in ans:
    print(x, y)
0