結果

問題 No.2355 Unhappy Back Dance
ユーザー navel_tosnavel_tos
提出日時 2023-06-17 00:29:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,163 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 87,272 KB
実行使用メモリ 102,448 KB
最終ジャッジ日時 2023-09-06 23:31:59
合計ジャッジ時間 18,196 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 221 ms
89,688 KB
testcase_01 AC 216 ms
89,472 KB
testcase_02 WA -
testcase_03 AC 219 ms
89,748 KB
testcase_04 AC 214 ms
89,772 KB
testcase_05 AC 219 ms
89,748 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 225 ms
89,628 KB
testcase_16 AC 639 ms
102,448 KB
testcase_17 AC 623 ms
99,476 KB
testcase_18 AC 569 ms
99,368 KB
testcase_19 AC 595 ms
100,276 KB
testcase_20 AC 598 ms
101,240 KB
testcase_21 AC 443 ms
96,200 KB
testcase_22 AC 342 ms
92,652 KB
testcase_23 AC 356 ms
94,664 KB
testcase_24 AC 598 ms
100,688 KB
testcase_25 AC 509 ms
98,408 KB
testcase_26 AC 457 ms
96,256 KB
testcase_27 AC 446 ms
96,256 KB
testcase_28 AC 257 ms
90,904 KB
testcase_29 AC 273 ms
91,108 KB
testcase_30 AC 599 ms
102,160 KB
testcase_31 AC 478 ms
96,100 KB
testcase_32 AC 357 ms
94,708 KB
testcase_33 AC 418 ms
94,472 KB
testcase_34 AC 249 ms
90,392 KB
testcase_35 AC 264 ms
91,416 KB
testcase_36 AC 436 ms
96,052 KB
testcase_37 AC 439 ms
96,684 KB
testcase_38 AC 452 ms
97,448 KB
testcase_39 AC 434 ms
97,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yukicoder393F

'''
aftercontest これ解けそう
N^2 * logN が間に合うだろ
'''
from fractions import Fraction as Fc
from collections import defaultdict as dd
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 i in range(N):
    D=dd(list); hantei=0
    for j in range(N):
        if i==j: continue
        D[line(P[i],P[j])].append(j)
    for k in D:
        if len(D[k])==1: continue
        if k[1]==10**100:
            plus,minus=0,0
            for now in D[k]:
                if   P[i][1]<P[now][1] and not plus: plus=1
                elif P[i][1]>P[now][1] and not minus: minus=1
                else: hantei=1; break
        else:
            plus,minus=0,0
            for now in D[k]:
                if   P[i][0]<P[now][0] and not plus: plus=1
                elif P[i][0]>P[now][0] and not minus: minus=1
                else: hantei=1; break
    ans+=hantei
    if i==4: break
print(ans)
0