結果

問題 No.2355 Unhappy Back Dance
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2023-06-16 22:43:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,552 ms / 6,000 ms
コード長 540 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 87,180 KB
実行使用メモリ 81,060 KB
最終ジャッジ日時 2023-09-06 21:12:46
合計ジャッジ時間 21,964 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,284 KB
testcase_01 AC 78 ms
71,676 KB
testcase_02 AC 79 ms
71,536 KB
testcase_03 AC 76 ms
71,532 KB
testcase_04 AC 75 ms
71,324 KB
testcase_05 AC 76 ms
71,468 KB
testcase_06 AC 93 ms
76,852 KB
testcase_07 AC 94 ms
76,760 KB
testcase_08 AC 94 ms
77,064 KB
testcase_09 AC 94 ms
77,076 KB
testcase_10 AC 234 ms
77,884 KB
testcase_11 AC 239 ms
78,172 KB
testcase_12 AC 102 ms
77,348 KB
testcase_13 AC 98 ms
77,020 KB
testcase_14 AC 222 ms
78,084 KB
testcase_15 AC 79 ms
71,388 KB
testcase_16 AC 1,534 ms
81,060 KB
testcase_17 AC 1,540 ms
80,536 KB
testcase_18 AC 1,552 ms
80,664 KB
testcase_19 AC 1,541 ms
80,464 KB
testcase_20 AC 1,543 ms
80,684 KB
testcase_21 AC 697 ms
78,216 KB
testcase_22 AC 214 ms
77,696 KB
testcase_23 AC 224 ms
77,376 KB
testcase_24 AC 1,423 ms
80,556 KB
testcase_25 AC 803 ms
78,844 KB
testcase_26 AC 805 ms
78,572 KB
testcase_27 AC 702 ms
77,960 KB
testcase_28 AC 106 ms
76,416 KB
testcase_29 AC 130 ms
77,812 KB
testcase_30 AC 1,280 ms
79,324 KB
testcase_31 AC 973 ms
79,116 KB
testcase_32 AC 184 ms
77,580 KB
testcase_33 AC 593 ms
77,880 KB
testcase_34 AC 99 ms
76,676 KB
testcase_35 AC 110 ms
76,812 KB
testcase_36 AC 704 ms
78,228 KB
testcase_37 AC 425 ms
78,064 KB
testcase_38 AC 498 ms
77,976 KB
testcase_39 AC 412 ms
77,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from sys import stdin
import math
import heapq

N = int(stdin.readline())

XY = []

for i in range(N):

    X,Y = map(int,stdin.readline().split())
    XY.append((X,Y))

ans = 0

for i in range(N):

    x,y = XY[i]
    s = set()

    for j in range(N):
        
        if j == i:
            continue
        x2,y2 = XY[j]

        xx = x2 - x
        yy = y2 - y

        g = math.gcd(xx,yy)
        xx //= g
        yy //= g

        if (xx,yy) in s:
            ans += 1
            break
        s.add((xx,yy))

print (ans)
0