結果

問題 No.947 ABC包囲網
ユーザー mkawa2mkawa2
提出日時 2019-12-16 18:18:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,035 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 10,836 KB
実行使用メモリ 13,840 KB
最終ジャッジ日時 2023-09-15 18:15:46
合計ジャッジ時間 8,632 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
13,152 KB
testcase_01 AC 17 ms
8,708 KB
testcase_02 AC 16 ms
8,644 KB
testcase_03 AC 16 ms
8,736 KB
testcase_04 AC 16 ms
8,712 KB
testcase_05 WA -
testcase_06 AC 17 ms
8,620 KB
testcase_07 WA -
testcase_08 AC 16 ms
8,576 KB
testcase_09 AC 17 ms
8,484 KB
testcase_10 AC 17 ms
8,300 KB
testcase_11 AC 17 ms
8,756 KB
testcase_12 AC 17 ms
8,580 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 28 ms
8,692 KB
testcase_17 WA -
testcase_18 AC 27 ms
8,696 KB
testcase_19 AC 28 ms
8,708 KB
testcase_20 AC 26 ms
8,732 KB
testcase_21 AC 27 ms
8,760 KB
testcase_22 AC 26 ms
8,568 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 26 ms
8,728 KB
testcase_26 AC 25 ms
8,600 KB
testcase_27 AC 27 ms
8,744 KB
testcase_28 AC 23 ms
9,352 KB
testcase_29 TLE -
testcase_30 AC 25 ms
9,460 KB
testcase_31 TLE -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import *
from math import *
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    n = int(input())
    rad = []
    rxy = []
    for _ in range(n):
        x, y = MI()
        rxy.append((atan2(y, x), x, y))
    rxy.sort()
    rad = [r for r, x, y in rxy]
    #print(rxy)
    #print(rad)
    ans = 0
    for i, (r0, x0, y0) in enumerate(rxy[:-2]):
        if y0 >= 0: break
        L = bisect_right(rad, atan2(-y0, -x0))
        for r1, x1, y1 in rxy[i + 1:]:
            if r0 == r1: continue
            if r1 >= atan2(-y0, -x0): break
            R = bisect_left(rad, atan2(-y1, -x1))
            if y1 >= 0: R = n
            ans += R - L
            #print(i, r0, x0, y0, atan2(-y0, -x0), L)
            #print(r1, x1, y1, atan2(-y1, -x1), R)
    print(ans)

main()
0