結果
| 問題 |
No.2355 Unhappy Back Dance
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-16 22:40:39 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 1,717 ms / 6,000 ms |
| コード長 | 615 bytes |
| コンパイル時間 | 253 ms |
| コンパイル使用メモリ | 82,256 KB |
| 実行使用メモリ | 83,616 KB |
| 最終ジャッジ日時 | 2024-06-24 15:26:23 |
| 合計ジャッジ時間 | 27,500 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 |
ソースコード
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)