結果
| 問題 |
No.2355 Unhappy Back Dance
|
| コンテスト | |
| ユーザー |
navel_tos
|
| 提出日時 | 2023-06-17 01:21:26 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 3,336 ms / 6,000 ms |
| コード長 | 955 bytes |
| コンパイル時間 | 215 ms |
| コンパイル使用メモリ | 82,600 KB |
| 実行使用メモリ | 202,616 KB |
| 最終ジャッジ日時 | 2024-06-24 18:14:30 |
| 合計ジャッジ時間 | 41,274 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 |
ソースコード
#yukicoder393F
'''
aftercontest これ解けそう
N^2 * logN が間に合うだろ
えー TLE すいません
角度でソートしなかったため たいへんなことに
'''
from fractions import Fraction as Fc
gcd=lambda x,y: gcd(y,x%y) if x%y else y
f=lambda:tuple(map(int,input().split()))
#直線の切片のx座標y座標を返す 予定でしたが多倍長整数で死
def line(P,Q):
x1,y1=P; x2,y2=Q
if x1==x2: return (x1,10**100)
R=Fc(y2-y1,x2-x1); return (R,-R*x1+y1)
N=int(input()); P=[f() for _ in range(N)]; ans=0
#直線でやるとたいへんなことになってしまいます 偏角ソートで
for now in range(N):
D=set()
for next in range(N):
if now==next: continue
x,y=P[next][0]-P[now][0],P[next][1]-P[now][1]
if x==0: R=(3*10**18,1,y<0)
else: G=gcd(y,x); R=(y//G,x//G,x<0)
if R not in D: D.add(R)
else: break
else: continue
ans+=1
print(ans)
navel_tos