結果

問題 No.2355 Unhappy Back Dance
ユーザー navel_tosnavel_tos
提出日時 2023-06-17 01:21:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 3,693 ms / 6,000 ms
コード長 955 bytes
コンパイル時間 495 ms
コンパイル使用メモリ 87,368 KB
実行使用メモリ 208,128 KB
最終ジャッジ日時 2023-09-07 00:20:30
合計ジャッジ時間 47,635 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 216 ms
89,712 KB
testcase_01 AC 215 ms
89,712 KB
testcase_02 AC 212 ms
89,488 KB
testcase_03 AC 221 ms
89,684 KB
testcase_04 AC 222 ms
89,528 KB
testcase_05 AC 224 ms
89,704 KB
testcase_06 AC 258 ms
90,916 KB
testcase_07 AC 255 ms
91,272 KB
testcase_08 AC 261 ms
91,800 KB
testcase_09 AC 256 ms
91,652 KB
testcase_10 AC 568 ms
95,064 KB
testcase_11 AC 602 ms
95,968 KB
testcase_12 AC 263 ms
91,568 KB
testcase_13 AC 267 ms
91,584 KB
testcase_14 AC 593 ms
95,188 KB
testcase_15 AC 220 ms
89,756 KB
testcase_16 AC 3,020 ms
176,336 KB
testcase_17 AC 2,766 ms
153,668 KB
testcase_18 AC 2,967 ms
171,112 KB
testcase_19 AC 3,027 ms
179,820 KB
testcase_20 AC 3,026 ms
168,944 KB
testcase_21 AC 1,398 ms
115,856 KB
testcase_22 AC 484 ms
93,900 KB
testcase_23 AC 520 ms
96,492 KB
testcase_24 AC 2,799 ms
176,880 KB
testcase_25 AC 3,658 ms
208,128 KB
testcase_26 AC 3,693 ms
204,976 KB
testcase_27 AC 1,443 ms
123,884 KB
testcase_28 AC 289 ms
91,908 KB
testcase_29 AC 322 ms
92,148 KB
testcase_30 AC 2,534 ms
158,088 KB
testcase_31 AC 1,967 ms
145,648 KB
testcase_32 AC 428 ms
94,136 KB
testcase_33 AC 1,227 ms
117,312 KB
testcase_34 AC 265 ms
91,488 KB
testcase_35 AC 283 ms
91,964 KB
testcase_36 AC 1,378 ms
117,136 KB
testcase_37 AC 882 ms
104,552 KB
testcase_38 AC 1,012 ms
107,300 KB
testcase_39 AC 880 ms
106,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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)
0