結果

問題 No.2355 Unhappy Back Dance
ユーザー lloyzlloyz
提出日時 2023-06-24 14:28:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,373 ms / 6,000 ms
コード長 692 bytes
コンパイル時間 340 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 121,376 KB
最終ジャッジ日時 2023-09-14 09:45:44
合計ジャッジ時間 32,587 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,712 KB
testcase_01 AC 91 ms
71,920 KB
testcase_02 AC 92 ms
71,528 KB
testcase_03 AC 92 ms
71,736 KB
testcase_04 AC 91 ms
71,732 KB
testcase_05 AC 92 ms
71,804 KB
testcase_06 AC 151 ms
78,544 KB
testcase_07 AC 131 ms
78,216 KB
testcase_08 AC 133 ms
78,944 KB
testcase_09 AC 137 ms
78,968 KB
testcase_10 AC 447 ms
82,292 KB
testcase_11 AC 472 ms
83,040 KB
testcase_12 AC 142 ms
79,440 KB
testcase_13 AC 140 ms
79,204 KB
testcase_14 AC 449 ms
83,212 KB
testcase_15 AC 91 ms
71,652 KB
testcase_16 AC 2,373 ms
117,708 KB
testcase_17 AC 2,330 ms
119,004 KB
testcase_18 AC 2,361 ms
121,376 KB
testcase_19 AC 2,345 ms
118,136 KB
testcase_20 AC 2,328 ms
113,756 KB
testcase_21 AC 1,040 ms
89,460 KB
testcase_22 AC 305 ms
78,968 KB
testcase_23 AC 319 ms
79,068 KB
testcase_24 AC 2,141 ms
115,528 KB
testcase_25 AC 1,204 ms
93,068 KB
testcase_26 AC 1,235 ms
93,080 KB
testcase_27 AC 1,039 ms
87,112 KB
testcase_28 AC 153 ms
78,144 KB
testcase_29 AC 178 ms
78,672 KB
testcase_30 AC 1,955 ms
108,600 KB
testcase_31 AC 1,444 ms
95,012 KB
testcase_32 AC 257 ms
78,668 KB
testcase_33 AC 881 ms
85,012 KB
testcase_34 AC 133 ms
78,800 KB
testcase_35 AC 148 ms
78,440 KB
testcase_36 AC 1,041 ms
86,180 KB
testcase_37 AC 627 ms
82,000 KB
testcase_38 AC 739 ms
83,780 KB
testcase_39 AC 615 ms
81,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
from collections import defaultdict
import sys
input = sys.stdin.readline

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

ans = 0
for i in range(n):
    xi, yi = P[i]
    counter = defaultdict(int)
    flag = False
    for j in range(n):
        if i == j:
            continue
        xj, yj = P[j]
        dx, dy = abs(xi - xj), abs(yi - yj)
        gcd_ = gcd(dx, dy)
        dx, dy = dx // gcd_, dy // gcd_
        plus_x = (xj >= xi)
        plus_y = (yj >= yi)
        counter[dx, dy, plus_x, plus_y] += 1
        if counter[dx, dy, plus_x, plus_y] == 2:
            flag = True
            break
    if flag:
        ans += 1
print(ans)
0