結果

問題 No.2355 Unhappy Back Dance
ユーザー flygonflygon
提出日時 2023-06-16 22:40:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,742 ms / 6,000 ms
コード長 615 bytes
コンパイル時間 1,057 ms
コンパイル使用メモリ 87,168 KB
実行使用メモリ 85,012 KB
最終ジャッジ日時 2023-09-06 21:05:32
合計ジャッジ時間 28,751 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
71,980 KB
testcase_01 AC 81 ms
71,816 KB
testcase_02 AC 82 ms
71,568 KB
testcase_03 AC 80 ms
71,776 KB
testcase_04 AC 83 ms
71,820 KB
testcase_05 AC 82 ms
71,820 KB
testcase_06 AC 518 ms
78,440 KB
testcase_07 AC 537 ms
78,624 KB
testcase_08 AC 645 ms
78,980 KB
testcase_09 AC 623 ms
79,072 KB
testcase_10 AC 755 ms
81,152 KB
testcase_11 AC 769 ms
80,748 KB
testcase_12 AC 664 ms
79,212 KB
testcase_13 AC 621 ms
79,116 KB
testcase_14 AC 738 ms
80,496 KB
testcase_15 AC 82 ms
71,548 KB
testcase_16 AC 1,700 ms
84,640 KB
testcase_17 AC 1,683 ms
84,732 KB
testcase_18 AC 1,742 ms
85,012 KB
testcase_19 AC 1,643 ms
84,972 KB
testcase_20 AC 1,639 ms
84,692 KB
testcase_21 AC 767 ms
79,844 KB
testcase_22 AC 232 ms
78,912 KB
testcase_23 AC 245 ms
79,216 KB
testcase_24 AC 1,571 ms
84,496 KB
testcase_25 AC 888 ms
80,276 KB
testcase_26 AC 873 ms
80,532 KB
testcase_27 AC 764 ms
79,880 KB
testcase_28 AC 119 ms
78,100 KB
testcase_29 AC 155 ms
78,792 KB
testcase_30 AC 1,428 ms
82,644 KB
testcase_31 AC 1,072 ms
80,892 KB
testcase_32 AC 204 ms
78,520 KB
testcase_33 AC 652 ms
79,560 KB
testcase_34 AC 107 ms
78,532 KB
testcase_35 AC 118 ms
78,056 KB
testcase_36 AC 764 ms
79,820 KB
testcase_37 AC 464 ms
79,364 KB
testcase_38 AC 560 ms
79,184 KB
testcase_39 AC 458 ms
79,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd
n = int(input())
xy = [list(map(int,input().split())) for i in range(n)]

ans = 0
for i in range(n):
    d = defaultdict(int)
    xi,yi = xy[i]
    mx = 0
    for j in range(n):
        if i==j: continue
        xj,yj = xy[j]
        g = gcd(abs(xi-xj), abs(yi-yj))
        d[((xi-xj)//g, (yi-yj)//g)] += 1
        mx = max(mx, d[((xi-xj)//g, (yi-yj)//g)])
    ans += mx >= 2
print(ans)

    
0