結果

問題 No.2355 Unhappy Back Dance
ユーザー AngrySadEightAngrySadEight
提出日時 2023-04-08 23:30:37
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 946 bytes
コンパイル時間 206 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 215,424 KB
最終ジャッジ日時 2024-04-18 19:13:34
合計ジャッジ時間 64,159 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
52,224 KB
testcase_01 AC 42 ms
51,968 KB
testcase_02 AC 42 ms
52,096 KB
testcase_03 AC 42 ms
51,968 KB
testcase_04 AC 42 ms
52,096 KB
testcase_05 AC 42 ms
52,224 KB
testcase_06 AC 715 ms
80,324 KB
testcase_07 AC 706 ms
80,048 KB
testcase_08 AC 810 ms
81,216 KB
testcase_09 AC 816 ms
80,696 KB
testcase_10 AC 1,293 ms
87,816 KB
testcase_11 AC 1,283 ms
95,360 KB
testcase_12 AC 842 ms
81,216 KB
testcase_13 AC 825 ms
80,712 KB
testcase_14 AC 1,467 ms
90,536 KB
testcase_15 AC 42 ms
51,968 KB
testcase_16 AC 4,631 ms
205,696 KB
testcase_17 AC 4,615 ms
206,336 KB
testcase_18 AC 4,675 ms
215,424 KB
testcase_19 AC 4,387 ms
184,184 KB
testcase_20 AC 4,713 ms
208,128 KB
testcase_21 AC 1,988 ms
113,152 KB
testcase_22 AC 478 ms
80,256 KB
testcase_23 AC 512 ms
80,384 KB
testcase_24 AC 4,310 ms
196,864 KB
testcase_25 AC 2,375 ms
123,648 KB
testcase_26 AC 2,390 ms
125,696 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def my_gcd(a, b):
    if b == 0:
        return a
    else:
        return my_gcd(b, a % b)

N = int(input())
X = []
Y = []
for i in range(N):
    x, y = map(int, input().split())
    X.append(x)
    Y.append(y)
pos = [False for _ in range(N)]
for i in range(N):
    lst = []
    st = set()
    for j in range(N):
        if i == j:
            lst.append([-1, -1])
            continue
        dx = X[j] - X[i]
        dy = Y[j] - Y[i]
        if dx == 0:
            dy = dy / abs(dy)
        elif dy == 0:
            dx = dx / abs(dx)
        else:
            g = my_gcd(max(abs(dx), abs(dy)), min(abs(dx), abs(dy)))
            dx /= g
            dy /= g
        lst.append([dx, dy])
        st.add((dx, dy))
    for j in range(N):
        if i == j:
            continue
        lst2 = (lst[j][0] * -1, lst[j][1] * -1)
        if lst2 in st:
            pos[j] = True
ans = 0
for i in range(N):
    if pos[i]:
        ans += 1
print(ans)
0