結果

問題 No.2355 Unhappy Back Dance
ユーザー 👑 amentorimaruamentorimaru
提出日時 2023-06-16 22:43:55
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 1,334 bytes
コンパイル時間 412 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 637,972 KB
最終ジャッジ日時 2023-09-06 21:17:53
合計ジャッジ時間 50,154 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,344 KB
testcase_01 AC 74 ms
71,140 KB
testcase_02 AC 75 ms
71,376 KB
testcase_03 AC 73 ms
71,268 KB
testcase_04 AC 72 ms
71,424 KB
testcase_05 AC 72 ms
71,344 KB
testcase_06 AC 898 ms
77,612 KB
testcase_07 AC 855 ms
77,888 KB
testcase_08 AC 942 ms
77,828 KB
testcase_09 AC 1,704 ms
78,028 KB
testcase_10 AC 2,473 ms
361,492 KB
testcase_11 AC 2,438 ms
361,800 KB
testcase_12 AC 983 ms
78,036 KB
testcase_13 AC 967 ms
77,792 KB
testcase_14 AC 2,499 ms
361,804 KB
testcase_15 AC 72 ms
71,140 KB
testcase_16 MLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 MLE -
testcase_21 AC 2,461 ms
335,080 KB
testcase_22 AC 492 ms
127,752 KB
testcase_23 AC 515 ms
131,968 KB
testcase_24 MLE -
testcase_25 AC 2,822 ms
361,228 KB
testcase_26 AC 2,857 ms
362,204 KB
testcase_27 AC 2,776 ms
352,484 KB
testcase_28 AC 134 ms
82,776 KB
testcase_29 AC 194 ms
90,768 KB
testcase_30 MLE -
testcase_31 AC 3,737 ms
456,016 KB
testcase_32 AC 388 ms
115,020 KB
testcase_33 AC 1,971 ms
288,968 KB
testcase_34 AC 106 ms
78,640 KB
testcase_35 AC 133 ms
83,196 KB
testcase_36 AC 2,540 ms
352,556 KB
testcase_37 AC 1,443 ms
235,560 KB
testcase_38 AC 1,631 ms
276,740 KB
testcase_39 AC 1,255 ms
231,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math
input = sys.stdin.readline
def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for _ in range(N)]

def main():
    n=int(input())
    x=[0]*n
    y=[0]*n
    for i in range(n):
        x[i],y[i]=read_values()
    mp=dict()
    for i in range(n):
        for j in range(n):
            if i==j:continue
            dx=y[i]-y[j]
            dy=-x[i]+x[j]
            dc=-(dx*x[i]+dy*y[i])
            g=math.gcd(dx,dy,dc)
            if dx<0 or (dx==0 and dy<0):
                g*=-1
            if g==0:
                continue
            dx//=g
            dy//=g
            dc//=g
            ad=(dx,dy,dc)
            if not ad in mp:
                mp[ad]=set()
            mp[ad].add(i)
    uh=[0]*n
    for vc in mp.values():
        if len(vc) < 3:
            continue
        if len(vc) > 3:
            for v in vc:
                uh[v]|=1
            continue
        vl=list(vc)
        for i in range(3):
            inner = (x[vl[(i+2)%3]]-x[vl[i]])*(x[vl[(i+1)%3]]-x[vl[i]])+(y[vl[(i+2)%3]]-y[vl[i]])*(y[vl[(i+1)%3]]-y[vl[i]])
            if inner > 0:
                uh[vl[i]]|=1
    print(sum(uh))

if __name__ == "__main__":
    main()
0