結果
問題 | No.2355 Unhappy Back Dance |
ユーザー |
![]() |
提出日時 | 2023-06-22 15:11:10 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,258 ms / 6,000 ms |
コード長 | 534 bytes |
コンパイル時間 | 156 ms |
コンパイル使用メモリ | 82,032 KB |
実行使用メモリ | 79,636 KB |
最終ジャッジ日時 | 2024-06-29 22:20:58 |
合計ジャッジ時間 | 18,478 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 37 |
ソースコード
N=int(input()) A=[] for _ in range(N): x,y=map(int, input().split()) A.append((x,y)) import math ans=0 for i in range(N): ax,ay=A[i] D=[] for j in range(N): if i==j: continue bx,by=A[j] x,y=bx-ax,by-ay if x==0 and y>0: D.append((0,1)) elif x==0 and y<0: D.append((0,-1)) elif x>0 and y==0: D.append((1,0)) elif x<0 and y==0: D.append((-1,0)) else: d=math.gcd(abs(x),abs(y)) x//=d;y//=d D.append((x,y)) if len(D)!=len(set(D)): ans+=1 print(ans)