結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
72,016 KB
testcase_01 AC 87 ms
71,528 KB
testcase_02 AC 86 ms
71,800 KB
testcase_03 AC 90 ms
71,728 KB
testcase_04 AC 87 ms
71,540 KB
testcase_05 AC 85 ms
72,012 KB
testcase_06 AC 138 ms
79,584 KB
testcase_07 AC 141 ms
79,528 KB
testcase_08 AC 141 ms
79,436 KB
testcase_09 AC 145 ms
79,208 KB
testcase_10 AC 435 ms
82,496 KB
testcase_11 AC 463 ms
83,412 KB
testcase_12 AC 153 ms
78,816 KB
testcase_13 AC 150 ms
79,444 KB
testcase_14 AC 471 ms
84,036 KB
testcase_15 AC 91 ms
71,944 KB
testcase_16 AC 2,268 ms
117,908 KB
testcase_17 AC 2,244 ms
118,580 KB
testcase_18 AC 2,306 ms
121,044 KB
testcase_19 AC 2,249 ms
118,268 KB
testcase_20 AC 2,342 ms
113,628 KB
testcase_21 AC 1,047 ms
89,372 KB
testcase_22 AC 297 ms
79,296 KB
testcase_23 AC 304 ms
78,832 KB
testcase_24 AC 2,105 ms
116,136 KB
testcase_25 AC 1,181 ms
93,060 KB
testcase_26 AC 1,203 ms
92,824 KB
testcase_27 AC 1,017 ms
87,432 KB
testcase_28 AC 144 ms
78,632 KB
testcase_29 AC 171 ms
78,576 KB
testcase_30 AC 1,920 ms
109,696 KB
testcase_31 AC 1,430 ms
95,076 KB
testcase_32 AC 251 ms
78,496 KB
testcase_33 AC 868 ms
85,092 KB
testcase_34 AC 128 ms
78,464 KB
testcase_35 AC 146 ms
78,528 KB
testcase_36 AC 1,031 ms
86,348 KB
testcase_37 AC 626 ms
82,096 KB
testcase_38 AC 728 ms
83,032 KB
testcase_39 AC 592 ms
82,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
from collections import defaultdict

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